Conversation
|
markov12 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Persist each grid view's vertical and horizontal scroll offset in localStorage (keyed by user + view) and restore it when the view is reopened or the page is reloaded. If the view was scrolled to the bottom, it stays pinned to the bottom after new rows are appended. The grid gets an `initialScrollState` prop that seeds its scroll state on mount, so the restore doesn't race the async layout. InfiniteScroller aligns the DOM scrollbars (and the touch scroller) with that initial offset once they are scrollable, and snaps back to the top/left edge when the content no longer overflows.
markov12
force-pushed
the
feat/persist-grid-scroll-position-v2
branch
from
September 14, 2026 15:04
a69fbe2 to
585db14
Compare
Author
|
Hi! Just a quick note that the CLA check is now passing. Is there anything else I should do on my side to move this forward? Happy to rebase or adjust the implementation if needed. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The grid always opens scrolled to the top-left. On wide tables, or tables where new rows are appended at the bottom, you have to scroll back to where you were every time you switch views, switch tables or reload the page.
Change
Remember each grid view's scroll position (vertical and horizontal) in
localStorage, keyed by user + view, and restore it when the view is opened again. If the view was scrolled to the bottom, it stays pinned to the bottom after new rows are appended, so freshly added rows remain visible.Gridgets an optionalinitialScrollStateprop that seeds its scroll state on mount.GridViewBasealready re-mounts the grid (viaViewSkeleton) on every view switch, so the restore is declarative and doesn't race the async layout with an imperativescrollTo.InfiniteScrolleraligns the DOM scrollbars with that initial offset once they are actually scrollable, and syncs the touchScrollerwith the real position (on mount and at the start of each gesture) — otherwise its internal offset is stale and the first swipe jumps back to the top.useGridScrollPosition(app) computes the initial state from storage and persists on scroll: debounced (500 ms),try/catch-guarded, and it ignores the transient zeros emitted while the grid lays out, so they can't overwrite the saved position.Browser-only, no server or schema changes.
Gridbehaves exactly as before wheninitialScrollStateisn't passed.Testing
Manually tested on desktop and in Chrome device emulation (touch):
🤖 Generated with Claude Code