Repository navigation
fix(chat): one fold state for a turn that never hides a live row - #20453
Conversation
c7bb4c8 to
f5a20b8
Compare
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that moving the settled default-mode toggle from above the reasoning row to above the first tool row is acceptable, since existing users will see it in a new place. What this change shipsInventory (8 items) — 8 justifiedIntent: Keep a live row in a turn (running, awaiting approval, hosting an MCP App, or opened or focused by the user) from folding out of sight, and keep one fold state from running through completion, reload and session switch. This is a FIX (#20417).
[FIRST-PRINCIPLES-REVIEWED] 610fcbc Description read[DESCRIPTION-READ] bcf7c12d5d7c944093060e58aaed43097991b9e09790c64790c65ac162c25bb9 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the app-sdk [DESIGN-REVIEWED] 610fcbc Description read[DESCRIPTION-READ] 1b0e14af63452a07a61c10cad7a071dc7b46101f5356e88b1094a0f264ec9d78 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS One fold toggle gets two names in the same turn: "N tool calls" while a live row sits above it, then "N earlier steps". A first-time reader could not tell if they mean the same thing. Watch
Suggestions
[UX-REVIEWED] 610fcbc Description read[DESCRIPTION-READ] 780fef0e6155e5df34f899d9d15b5907a60b81293a4c0863200963a60a23573f That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
f5a20b8 to
433a18f
Compare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433a18f to
8b5e59c
Compare
|
|
|
|
a2bfcf4 to
e8e0946
Compare
|
self-added: yes
|
A turn now has one disclosure for its whole life. While running it folds tool rows older than the newest five; once settled it folds by its mode, always a superset, so completion never opens a folded row. A row that is running, awaiting approval, hosting an MCP App, opened by the user or focused never folds: the pill reports itself live through RowActivityContext, so this holds in every host and after a reload. Every row is one plain keyed div folded with `hidden`, in one flat list, and the toggle is keyed by the row it sits above, so no fold, completion or toggle move ever detaches a row (an MCP App iframe keeps its state). The per-row motion.div, the separate `:live` disclosure and ChatPage's pin map are gone. Closes #20417
e8e0946 to
610fcbc
Compare
|
self-added: no
|
|
|
|
|
|
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and readiness passed at 610fcbc; no behavior change.
Problem / Motivation
Goal: A live or user-focused action is never folded away, and one fold state survives running, completion, reload and session switch, without reloading embedded apps or flashing hidden rows.
The running-turn fold from #19932 keeps two states (one while running, one once settled) and folds by position only. Today on main:
Why it matters
A pending approval that the user cannot see stalls the agent. A reloading app loses what the user typed into it. A running call is the one row the user is watching.
Not a goal
LIVE_ACTIVITY_WINDOW = 5.transcriptRows.ts); it orphans any turn disclosure, before and after this change.What changed (motivation → approach → change)
:livekey + settled key + completion effectdisclosure, read at render timemotion.divper row; settled rows re-parented into a sectiondivwhose one grid track eases 1fr↔0frkey="toggle", moves at completionThe fold had two states and two render shapes, so completion re-parented rows, moved the toggle past an app row and opened folded rows for a frame before an effect closed them.
website/src/pages/chat/TurnBlock.tsxnow has one disclosure for the whole turn and one flat render for every mode. The fold set is the running window (tool rows older than the newest five) plus, once settled, the mode's own collapse, so completion only folds more. Any live row is taken out of that set. The toggle sits above the first folded row, so in default mode it does not move at completion, and focus never moves it. Its running label reads "N earlier steps", or the neutral "N tool calls" when a live row older than the fold sits above it. A row folds by easing its own grid track and opacity (CSS transition, 200 ms, none under reduced motion), markedinert; only a fold candidate clips its content. It replaces amotion.divper row because that wrapper cost every row of every mounted turn on each streaming flush: the #19932 review measured a 300-row re-render at about 1.6 ms withmotion.divagainst 0.06 ms with plain divs, plus about 10 KB of heap per row.A row says it is live through
website/src/pages/chat/rowActivity.ts:ToolCallLinereports running, MCP App and user-opened;ToolCallPillinapp-sdk/messageRenderers.tsxreports running and opened. A layout effect reports, so a pill that mounts pending is open in the first paint. An approval or "Tool calls start expanded" opening a pill is not a user choice; the approval's open/close stays local. A closed settled default-mode fold drops the content of rows that cannot go live (not app-bearing, not a pill the user opened per the host'smayBeLive), as main did.ChatPage.tsxdrops the:livekey and passesmayBeLivefrom the pill disclosure map inpages/chat/page/activeSlotState.ts.docs/feature-map/README.mdnames the new helper.Backwards compatibility
Compatible: render-only; props
liveDisclosureandisRowPinnedhad one caller each (ChatPage), both removed here;mayBeLiveis optional.Removes nothing: folded rows stay one click away; the settled default toggle sits above the first tool row instead of above the reasoning row.
Tests
website/src/test/TurnBlock.liveWindow.test.tsx(39): window and count, hidden ✅ rows, live rows never fold (also when mounted live, among the newest five, live at completion, explicit fold), focus (incl. tabbing onto the toggle keeps the same toggle, keyboard focus or a click inside an open fold keeps its toggle in place, with one row, two rows or a running turn, and a focus-kept row survives a tab or window switch while a blank click or a removed element still folds it), one disclosure through completion-while-unmounted / resume / close / no-host flap, search, the grid-track fold and reduced motion, clipping only on candidates, the settled unmount rule (incl. a hostmayBeLiverow), no unfold at completion in default and collapseAll, and an MCP App custom element never disconnected.website/src/test/TurnBlock.reportedGaps.test.tsx(5): the four reported gaps through the realToolCallLine; all 5 fail on main and pass here.website/src/test/ToolCallLine.rowActivity.test.tsx(8): which pill states report live; an approval auto-open writes nothing to the host.overflowstyle to the row'sdata-collapsed.ToolCallLinelive term, approval auto-open, each condition of the settled unmount.--sequence.shuffle.Manual verification
Recorded on a throwaway harness (real
TurnBlock+ToolCallLine+ chat store), on main and on this branch.Screenshots / video
Slow
npm testthen six quick calls. Before: the running call folds.After: it stays open above a "1 tool call" toggle. Recording: rows ease out of the window as calls arrive.
after-running.webm
After a reload with the first call awaiting approval. Before:
After:
Completion of a 12-call turn, before (folded rows flash open, then shrink):
before-completion.webm
After (no row opens):
after-completion.webm
Related Issues
Closes #20417
Follow-up to #19932.
Pattern harvest
Rule candidate: review-prompt
Pattern: two disclosure states for one element across a phase flip, reconciled in an effect, instead of one state read at render time.
Checklist