Skip to content

fix(web): restore the run list scroll position on return - #16

Merged
XuehaiWang merged 1 commit into
mainfrom
fix/runs-scroll-restore
Nov 25, 2026
Merged

XuehaiWang merged 1 commit into
mainfrom
fix/runs-scroll-restore

Conversation

@kiri603

@kiri603 kiri603 commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Opening a run and coming back landed at the top of the list, so the row the user was reading was lost. The router now saves the offset of every data-scroll-key container right before it changes the location, and the runs list reapplies it once its rows are rendered.

The keyboard cursor no longer scrolls into view on mount, which would have pulled the list back to the top right after the restore.

Validation

Checked in Chrome against a real daemon (27 runs):

  • Grouped list scrolled to 42px, opened a run, went back: scroll offset 42px again.
  • Filtered with ?q=swe-lite, scrolled to 60px, round trip: 60px again.
  • A fresh load of /runs still starts at the top.

New test packages/web/test/scroll.test.ts covers the save/restore helpers.

Opening a run and coming back landed at the top of the list, so the row the
user was reading was lost. The router now saves the offset of every
`data-scroll-key` container right before it changes the location, and the runs
list reapplies it once its rows are rendered. The keyboard cursor no longer
scrolls into view on mount, which would have pulled the list back to the top.
@kiri603
kiri603 requested a review from XuehaiWang as a code owner November 22, 2026 08:44
@XuehaiWang
XuehaiWang merged commit 2d96af2 into main Nov 25, 2026
1 check passed
@crepuscular-drizzle
crepuscular-drizzle deleted the fix/runs-scroll-restore branch November 26, 2026 11:29
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