Skip to content

fix: scroll the build list back to the top on page change - #381

Merged
nGervasyuk merged 2 commits into
Visual-Regression-Tracker:masterfrom
nGervasyuk:fix/build-list-scroll-to-top
Jul 27, 2026
Merged

fix: scroll the build list back to the top on page change#381
nGervasyuk merged 2 commits into
Visual-Regression-Tracker:masterfrom
nGervasyuk:fix/build-list-scroll-to-top

Conversation

@nGervasyuk

@nGervasyuk nGervasyuk commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What & why

The build list keeps its scroll offset when the page changes. Scroll to the bottom of page 1, click 2, and you land in the middle of the next page and have to scroll back up to see its first builds.

The skeletons shown during the fetch don't reset it: SkeletonList is height: 100% inside a <List> that has no definite height, so it collapses to its content and the container stays tall enough to keep the offset.

Changes

  • Hold a ref to the scrollable list container and reset it to the top whenever a page is requested. This also covers the refetch after a bulk delete, which can drop you onto a shorter page.
  • mockGetBuilds now serves any take/skip by slicing the given builds and reporting a real total, instead of matching only skip=0 and hardcoding total: 3. Existing callers pass three builds, so they see the same response as before.

Testing

  • New Playwright test: with 25 builds, scroll the list to the bottom, go to page 2, and assert the container is back at scrollTop === 0.
  • Verified it fails without the fix — the container stayed at 438px.
  • Playwright 22/22, tsc --noEmit, eslint, prettier and vite build clean on changed files. No snapshot change.

Screenshots

Screen.Recording.2026-07-27.at.11.44.04.mov

The list keeps its scroll offset when the page changes, so paging from
the bottom of one page lands you in the middle of the next one. Reset
the scroll container whenever the page is requested.

The build mock now serves any take/skip so the test can page through a
list longer than one page.
@nGervasyuk nGervasyuk self-assigned this Jul 27, 2026
@nGervasyuk
nGervasyuk requested a review from pashidlos July 27, 2026 10:04

@pashidlos pashidlos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…ll-to-top

# Conflicts:
#	integration_tests/test/projec.spec.ts
@sonarqubecloud

Copy link
Copy Markdown

@nGervasyuk
nGervasyuk merged commit fdbfb87 into Visual-Regression-Tracker:master Jul 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants