Repository navigation
fix(session-ui): fold timeline entries when they settle, not while they run - #63086
Irsyadmr354 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
I reviewed the code but couldn't watch it run. The change is in the desktop/web timeline, and there are no browsers here for the component tests. bun test src in packages/session-ui passes (562/562) and tsc -b is clean. Before/after screenshots or a short video from the desktop app (Compact preset, one turn with thinking, a few reads and a shell command, then an interrupt) would help maintainers judge it.
The public API is unchanged. This is rendering logic inside session-ui only.
Note: #63046 was triaged as a feature request, because collapsed-while-streaming is the current intended design. This PR changes the default for everyone with no setting, so maintainers need to decide whether they want that.
The main concern is the context-group open change (inline). It goes beyond thinking and shell: every grouped context block now unfolds while it is the turn's last group. That includes groups of reads and searches, even after all their members have settled. Each group then snaps shut when the next part arrives, which also shifts the layout for anyone scrolled up reading.
| phase(row().userMessageID).live && | ||
| input.projection.lastAssistantGroupKey().get(row().userMessageID) === row().group.key | ||
| } | ||
| open={input.disclosure.value(key()) ?? (phase(row().userMessageID).live && (live() || active()))} |
There was a problem hiding this comment.
This unfolds more than thinking and shell. Context groups also hold reads, searches, grouped commentary and other context tools. live() counts any running tool, and active() is true for the turn's last group even when every member has finished. So with Compact, every live context group expands and only folds when the next group or text part starts, not when its work settles, as the description says it should. Collapsing a tall group mid-turn also moves content under a reader who has scrolled up. Could this only open for members that are actually live (streaming reasoning, or running shell tools), and drop active() from open?
There was a problem hiding this comment.
Fixed in 6e5af73. open no longer uses active(), and live now counts only a running shell/execute tool or streaming reasoning, so groups of reads and searches never unfold. A group folds as soon as its live member settles, or when the turn is interrupted.
There was a problem hiding this comment.
Thanks, I checked 6e5af73 and this is resolved. The group now opens only on live(). That means a running shell tool or streaming reasoning, and only while the turn is live. active() is only used for busy now, so groups of reads and searches stay closed and fold once their live member settles or the turn is interrupted. The streaming thinking row also no longer has the unused defaultOpen. Whether a streaming entry should open even with Collapse on (instead of the current collapsed row with a live heading) is a product call for maintainers on #63046.
| } | ||
| // This row exists only while the model is still thinking, so it stays open until the | ||
| // reasoning settles into a finished part and then follows the Collapse setting. | ||
| open={input.disclosure.value(current().ref.partID) ?? true} |
There was a problem hiding this comment.
With ?? true, open is always defined, so the defaultOpen just above it is never used, and thinking.details / reasoningMode no longer affect the streaming row. Before, a collapsed streaming row showed the live reasoning heading in its summary line (props.streaming && !open() in AssistantReasoningContent). That is now gone for everyone, including users who chose Collapse on purpose. If this is intended, the dead defaultOpen should go. If not, the open-while-streaming behaviour probably needs its own setting rather than overriding Collapse.
There was a problem hiding this comment.
Opening the streaming row is intended, so the dead defaultOpen is gone (6e5af73). Collapse still takes over the moment the reasoning settles into a finished part, and a manual close on the streaming row still sticks and shows the live heading summary in the collapsed line.
There was a problem hiding this comment.
Thanks, that matches the code at 6e5af73. A manual close stores false, so the row stays closed and AssistantReasoningContent shows the live heading while it streams. The finished part then follows Collapse. Nothing more is needed in this thread. Whether streaming entries should open by default is still for maintainers to decide on #63046.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
8b97d43 to
2019346
Compare
…ey run Collapse applied to an entry for its whole lifetime, so with the default Compact preset (Group on, Collapse on) thinking and shell output stayed hidden while the agent was still producing it. An interrupted turn was worse: the interrupted tool keeps its `running` status, so its entry stayed open forever. Collapse now describes finished content only: - a shell/execute tool that is `streaming` or `running` stays open while its turn is live, then folds back to the configured setting - a context group opens only while it holds a member worth watching, meaning a running shell/execute tool or streaming reasoning. A group of settled reads stays closed even when it is the most recent one, and the group folds as soon as its live member settles - the streaming thinking row opens itself, and follows the Collapse setting once the reasoning settles - an interrupted turn is not live, so its entries fold at once - an explicit open or close still wins and persists for that entry
2019346 to
6e5af73
Compare
There was a problem hiding this comment.
Both earlier points are fixed. A context group now opens only while it has a running shell or execute tool or streaming reasoning, so groups of reads and searches stay closed. The unused defaultOpen on the streaming thinking row is gone. Whether a streaming entry should ignore Collapse is still for maintainers to decide on #63046.
I read the code but couldn't watch it run: this is desktop/web timeline code and there are no browsers here. bun test src in packages/session-ui passes (562/562) and tsc -b is clean. The recording you mentioned (Compact preset with thinking, a few reads, a shell command, then an interrupt) would help maintainers check it.
The public API is unchanged.
|
A week in, so checking in once. Confirmed against current The change only affects the Compact preset default: a live shell/execute and a streaming thought open while the turn runs, then follow Collapse once they settle. An explicit open or close still wins and persists. If changing the default is too much, I'm glad to make this opt-in instead, either through the Timeline preset or a setting, so anyone who wants Collapse to mean "never expand" keeps that behavior. Tell me which shape you prefer and I'll adjust. Context: I see the New timeline experiment has a related report (#64566, expanded thinking collapsing when the turn completes). This PR only touches the current timeline, so it doesn't overlap with that work. |
We love AI and OpenCode, but we can't trust AI fully. So I fixed that issue for everyone.
Issue for this PR
Closes #63046
Type of change
What does this PR do?
With the default Compact preset (Group on, Collapse on), Collapse applied to an entry for its whole lifetime. Thinking and shell output stayed hidden while the agent was still producing them, and an interrupted turn left its entry open forever, because an interrupted tool keeps its
runningstatus.Collapse now only describes finished content:
streamingorrunningstays open while its turn is live, then folds back to the configured settingFiles:
packages/session-ui/src/timeline/session-timeline-row.tsx,packages/session-ui/src/tools/tool-renderer.tsx.How did you verify your code works?
tsc -bclean forpackages/session-uiandpackages/appbun test srcinpackages/session-ui: 562 pass, 0 failScreenshots / recordings
Desktop app on Windows, Compact preset, recorded on this commit (84s, no cuts):
Used 3 Shellsummary; once the work settles the answer reads cleanly underneathUsed 1 Thoughtstraight away under theInterrupteddivider, instead of staying openThe shell commands in this turn return in milliseconds, so their rows fold back as soon as they return; the same rule keeps a long-running command readable while it streams. In this recording one context group is also clicked open by hand, and it stays open because an explicit open wins.
Checklist