fix(ui): backport bottom-edge scroll snap-back fix to 0.9.x#196
Conversation
Backport of f6de1cb from main without the changelog update.
Greptile SummaryThis PR backports the bottom-edge scroll snap-back fix ( Confidence Score: 5/5Safe to merge — targeted fix with full unit and PTY regression coverage, no regressions identified. All findings are P2 or lower. The logic change is minimal and self-consistent: both the scroll dispatch (scrollFileHeaderToTop) and the settle comparison (pendingFileTopAlignFileIdRef effect) use the same clampReviewScrollTop call against the same totalContentHeight, so they agree on what settled means. New tests directly exercise the scenario that was broken. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[selectedFileTopAlignRequestId changes] --> B[scrollFileHeaderToTop called]
B --> C["scrollTo(clampReviewScrollTop(bodyTop, vh))"]
C --> D[Scroll box settles at reachable bottom edge]
D --> E[Settle-check useLayoutEffect runs]
E --> F{"currentTop ≈ clampReviewScrollTop(bodyTop, vh)?"}
F -- "Yes (new: clamped target matches)" --> G[clearPendingFileTopAlign]
G --> H[Manual upward scrolling works freely]
F -- "No (old: raw bodyTop was unreachable)" --> I[scrollFileHeaderToTop re-called]
I --> J[Snap-back loop — manual scroll fought]
Reviews (1): Last reviewed commit: "fix(ui): stop bottom-edge scroll snap-ba..." | Re-trigger Greptile |
Summary
mainonto0.9.xNotes
CHANGELOG.mdupdate because0.9.xpredates that file.f6de1cbfrommainwithout the changelog change.Testing
This PR description was generated by Pi using OpenAI o3