Repository navigation
fix(tui): keep low verbosity summaries in place when toggled - #52357
Merged
Merged
Conversation
jlongster
force-pushed
the
verbosity-expand-anchor
branch
from
October 8, 2026 17:20
70a78cc to
da95f3d
Compare
2 of 6 tasks
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.
Issue for this PR
No issue.
Type of change
What does this PR do?
With
session.verbosity: "low", clicking an activity summary (for example+ 4 commands, 1 edit, 4 thoughts) moved it. At the bottom of the transcript the scrollbox follows the bottom, so the new details pushed the summary up, often off screen. When scrolled up, collapsing near the bottom clamped the scroll position and the summary jumped down.Now the summary stays on the row that was clicked when expanding and collapsing. Details still open below it, as before.
OpenTUI has no scroll anchoring, so the click passes the summary row to
setGroupExpanded, which records its viewport row. The session listens for the scrollbox contentresizeevent and correctsscrollTopfrom the row's computed layout. That event fires inside the layout pass before rows get screen positions, so the correction lands in the same frame with no visible jump. The hold is released after layout settles. At the bottom, the correction leaves the bottom, so the transcript stops following it and "Jump to latest" appears. The exception is a summary that ends the transcript (ignoring the message footer and turn usage) while the reader is at the bottom, such as a running turn. There the hold is skipped so the details stay visible and new output keeps following, as before.Other disclosures (Thought, Explored, Instructions) are unchanged.
Known limit: if collapsing leaves too little content below the summary to keep it on its row, the scroll position is clamped and the summary moves down.
How did you verify your code works?
packages/tui/test/session-activity-anchor.test.tsx. It records every rendered frame after each click and checks that the summary stays on the same row for expand and collapse, at the bottom and 1 and 3 wheel steps up. Another case checks that the summary ending the transcript opens like before at the bottom. Without the resize correction, these cases fail.bun run checkpasses.bun testinpackages/tuipasses exceptdialog-shell-output.test.tsx, which times out onv2without this change too.bun run dev:liveon a real session, at the bottom and scrolled up, and recorded an OpenCode Drive video of both.Screenshots / recordings
Recorded with OpenCode Drive; I'll attach the video in a comment.
Checklist