fix(ui): use full agent-note set for section geometry measurement#243
fix(ui): use full agent-note set for section geometry measurement#243aldevv wants to merge 1 commit intomodem-dev:mainfrom
Conversation
The visible-viewport agent-note set is correct for rendering (skip painting cards on off-screen files) but using it for section measurement made total content height fluctuate with scroll position: as a file with notes left the viewport its geometry shrank back to the no-notes baseline, which shrank totalContentHeight, which tightened clampReviewScrollTop's ceiling and snapped the viewport upward by the height of the off-top note rows. Always include notes in geometry for stable bottom-edge clamping; rendering keeps using visibleAgentNotesByFile. Fixes modem-dev#234.
Greptile SummaryFixes a viewport snap-back bug where
Confidence Score: 5/5Safe to merge — a minimal, well-commented swap in a single memo with no side-effects on the rendering path. The change is a one-variable substitution in a single No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[allAgentNotesByFile\nfull set, all files] -->|BEFORE: only used for visibleAgentNotesByFile| B
A -->|AFTER: also used here| C
B[visibleAgentNotesByFile\nviewport + selected only] -->|rendering| D[DiffSection paint]
C[sectionGeometry\nmemo] -->|stable heights| E[estimatedBodyHeights]
E --> F[fileSectionLayouts]
F --> G[totalContentHeight]
G --> H[clampReviewScrollTop\nstable ceiling]
Reviews (1): Last reviewed commit: "fix(ui): use full agent-note set for sec..." | Re-trigger Greptile |
User-visible: with agent notes attached, scrolling to the last line of the diff bounces the viewport upward by ~1–2 lines (~the height of the off-top note rows).
Steps to reproduce (on
main)hunk diff <range>on a multi-file diff.Without notes attached, the bottom edge is stable.
Fix: section geometry now measures with the full agent-note set so total content height is stable regardless of scroll position. Rendering still uses the viewport-restricted set, so painting cost is unchanged.
No user-facing docs or workflows change.
Fixes #234.