Repository navigation
Restore #6405 extent-changed scroll pinning dropped in 0.48 sync - #366
Merged
Merged
Conversation
Reintroduce the no-input extent comparison dropped during the 0.48 sync merge, including the fork bottom-scroll path that defers to reconcile instead of handleScroll. Co-authored-by: Cursor <[email protected]>
Guard against re-pinning during input when the viewport clamps, and against a second deferred reconcile after bottom extent layout scrolls. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Reset the reconcile spy after setup so the regression fails when onScroll schedules a second reconcile pass. Co-authored-by: Cursor <[email protected]>
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.
Human comments
What was wrong
Sync merge #360 kept most of upstream get-bb#6405 but dropped the no-input
extentChangedbranch inScrollPositionKeeper.handleScroll. On our fork, attached-bottom scroll events often bypasshandleScrolland defer toreconcile, so a clamp scroll after the scroll extent changes (for example when iOS grows the scrollerclientHeightandmaxScrollTopdrops) could be treated like navigation and unpinned the timeline.What changed
scroll-position-keeper.ts: Restored upstream’s cached-maxScrollTopvsrefreshExtentcomparison for no-input scrolls inhandleScroll, split from the existingfollowsUnexplainedScrollbranch so extent/floor layout scrolls still re-attach without treating them as user navigation. Added the same extent/floor block on the fork’s attached-bottomonScrollpath (upstream callshandleScrollfor every scroll; we only restore parity on the bottom defer path).scroll-position-keeper.test.ts: Guard test that grows the fake viewport by 225px, takes a clamp, fires a no-input scroll before ResizeObserver flush, and expects the reader to stay attached at the new end.Diff vs upstream
c6c23be71f: Upstream routes all scrolls throughhandleScroll; the extent clause lives only there. This PR keeps fork-only input deferral, shrink-clamp, window-find, pointer/touch attach, and bottomonScrollrAF reconcile, and duplicates the extent/floor clause on that bottom path.Diff vs
oursbefore this PR: Replaces the single(isFloorStale() || !followsUnexplainedScroll())early return with extent-aware layout handling plus the separate unexplained-scroll branch unchanged in intent.RED note: On
ours(9e011235), the new test still passes without the restored clause (~/projects/bb-fork-6405-logs/red-scroll-keeper.log, exit 0). RED not reproducible: the floor and deferred reconcile cover every path this harness produces; the clause is kept for upstream parity and the real iOS client-height path.No issue: issues disabled
How you verified
pnpm exec turbo run test --filter=@bb/app -- scroll-position-keeper.test.ts -t "225 px viewport"(GREEN:~/projects/bb-fork-6405-logs/green-scroll-keeper.log)pnpm exec turbo run test --filter=@bb/app -- scroll-position-keeper timeline(~/projects/bb-fork-6405-logs/green-focused-tests.log)pnpm exec turbo run generate --filter=@bb/server && pnpm exec turbo run typecheck lint test --filter=@bb/app— typecheck and lint passed; one unrelated terminal focus replay test failed on hsrpc (~/projects/bb-fork-6405-logs/green-full-app.log)Need help on this PR? Tag
@codesmith-botwith what you need.