Repository navigation
feat(app): fold tall file diffs in the timeline - #65329
Conversation
There was a problem hiding this comment.
Works as described. I mounted the long-write story in the component harness: the opened file goes from 4,801px on dev to 453px here, with the fade and the "Show more" toggle (screenshots below). The session-ui type check (tsc -b) and the full component suite (235 tests) pass. I did not run the app e2e specs or check the Show less scroll compensation by hand.
Public API: unchanged. This is UI only, in packages/session-ui.
No blocking concerns. One small point: tall is only ever set to true. If a diff later becomes shorter than the threshold, for example when a wider window unwraps its lines, it keeps a "Show more" toggle that reveals nothing. Resetting it in the resize callback would cover that.
There was a problem hiding this comment.
The new commits still work as described. In the component story, the opened 200-line write is 421px, 4,833px after "Show more" and 421px after "Show less". On dev it is 4,801px. The session-ui type check (tsc -b) and the full component suite (235 tests) pass.
My earlier point is addressed: tall is now measured again on every resize, so a diff that drops below the limit no longer keeps a toggle that reveals nothing.
Public API: unchanged.
No new concerns.



Issue for this PR
No linked issue.
Type of change
What does this PR do?
With edits set to expanded, a file diff in the timeline has no height limit, so a 300-line write takes over 7,000px. These blocks were capped at 420px (240px for writes) with inner scrolling until aaf8317 removed the caps when it added the expand setting.
Now an opened file diff shows at most 420px. A taller one fades out under a "Show more" button. "Show less" folds it again and keeps the button where it was pressed. Shorter diffs look the same as before. It covers writes, edits and patches in both timelines.
UserMessageFold) and its existingui.common.showMore/showLessstrings, so there is no nested scrolling.fileOpencall site.How did you verify your code works?
packages/session-ui/component-tests/file-tool.spec.tsthat opens a 200-line write, presses "Show more" and "Show less". It fails without the fix.--check --base origin/dev, 7 runs):main.work35.9ms on dev, 34.6ms here. The timed comparison would not run on my machine (tiled window, on battery), so this is a reading, not a verdict.bun run check, the session-ui component suite, and thepatch-sticky-header,patch-border,timeline-geometryandsession-timeline-tool-projectione2e specs pass.Screenshots / recordings
Checklist