Skip to content

fix(chat): one fold state for a turn that never hides a live row - #20453

Merged
iamwhatever merged 1 commit into
mainfrom
fix/stable-fold-state
Oct 15, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/stable-fold-state

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • A call waiting for approval folds out of sight when its pill mounts already pending (after a reload or a session switch).
  • An MCP App row is moved in the DOM at turn end, so its iframe reloads. In split view, side chat and embeds the app row can fold mid-run.
  • A long turn shows every folded row at full height for a moment when it finishes.
  • A still-running call (a slow test run) folds while newer, finished calls stay open.

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

  • No new setting; the window stays LIVE_ACTIVITY_WINDOW = 5.
  • No change to which kinds of rows never fold (errors, cards, diff cards, hand-backs).
  • Not the virtual row re-key when a turn gains its first MCP App payload (transcriptRows.ts); it orphans any turn disclosure, before and after this change.

What changed (motivation → approach → change)

Before After
Fold state running :live key + settled key + completion effect one disclosure, read at render time
Who never folds user-expanded pills (ChatPage only) running, pending, MCP App, user-opened, focused rows, in every host
Row element motion.div per row; settled rows re-parented into a section one plain keyed div whose one grid track eases 1fr↔0fr
Toggle key="toggle", moves at completion keyed by the row it sits above

The 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.tsx now 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), marked inert; only a fold candidate clips its content. It replaces a motion.div per 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 with motion.div against 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: ToolCallLine reports running, MCP App and user-opened; ToolCallPill in app-sdk/messageRenderers.tsx reports 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's mayBeLive), as main did. ChatPage.tsx drops the :live key and passes mayBeLive from the pill disclosure map in pages/chat/page/activeSlotState.ts. docs/feature-map/README.md names the new helper.

Backwards compatibility

Compatible: render-only; props liveDisclosure and isRowPinned had one caller each (ChatPage), both removed here; mayBeLive is 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 host mayBeLive row), 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 real ToolCallLine; 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.
  • Existing TurnBlock tests: the fold marker moved from the section's overflow style to the row's data-collapsed.
  • Mutation-checked guards (each turns tests red): toggle key, live and focus exclusion, toggle place ignoring focus, an open fold keeping its toggle under focus, focus kept across a tab or window switch, window kept when settled, each ToolCallLine live term, approval auto-open, each condition of the settled unmount.
  • Determinism: the three new files pass 3 times under --sequence.shuffle.
  • Cost of a settled, closed 150-call turn (jsdom, mount / 200 store updates, 3 runs): main 35 / 47 ms, this branch 44 / 43 ms.

Manual verification

Recorded on a throwaway harness (real TurnBlock + ToolCallLine + chat store), on main and on this branch.

Screenshots / video

Slow npm test then six quick calls. Before: the running call folds.

before running

After: it stays open above a "1 tool call" toggle. Recording: rows ease out of the window as calls arrive.

after-running.webm

after running

After a reload with the first call awaiting approval. Before:

before pending

After:

after pending

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

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 14, 2026 19:31
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@iamwhatever
iamwhatever force-pushed the fix/stable-fold-state branch from c7bb4c8 to f5a20b8 Compare October 14, 2026 19:52
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 610fcbcf83e7d964eae897aec68707d836df12c3 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 ships

Inventory (8 items) — 8 justified

Intent: 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).

  1. A running or approval-pending call no longer folds away, including when it mounts already pending — justified
  2. An MCP App row is no longer re-parented at turn end, so its iframe no longer reloads — justified
  3. A row holding keyboard focus stays unfolded — justified
  4. Folded rows no longer flash open for a frame when a long turn finishes — justified
  5. A user's open/closed fold choice survives completion, a resume and a remount (one disclosure, no :live key) — justified
  6. The settled default-mode toggle sits above the first tool row, not the reasoning row, and stays put at completion — justified
  7. The running toggle reads "N tool calls" instead of "N earlier steps" when an older live row sits above it — justified
  8. Rows ease in and out with a CSS grid track instead of a framer-motion spring per row — justified

[FIRST-PRINCIPLES-REVIEWED] 610fcbc

Description read

[DESCRIPTION-READ] bcf7c12d5d7c944093060e58aaed43097991b9e09790c64790c65ac162c25bb9

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 610fcbcf83e7d964eae897aec68707d836df12c3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the app-sdk ChatMessageList hosts, which pass no mayBeLive, can live with a user-opened pill being unmounted and losing its open state when its turn settles folded.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of 610fcbcf83e7d964eae897aec68707d836df12c3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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

  • The toggle's noun changes mid-turn. The new code ? i18nT('pages.chat.turnBlock.earlier_step') : … i18nT('pages.chat.collapsibleToolGroup.tool_call') switches the label when the live row finishes. The user watches the same toggle change from "1 tool call" to "N earlier steps", with a different noun and a different count. The blind reader wrote: "I cannot tell whether a 'step' and a 'tool call' are the same thing. I also cannot tell why the number changes." This shows up on every running turn that has a slow call, but it only causes friction, not task failure. Smallest fix: use one noun in both cases, either "N tool calls" or "N more steps".
  • The live row's state relies on colour and icon. The pinned row is what this PR is for. The reader only guessed that purple means running and that the yellow padlock means waiting. They also asked whether the "Waiting for approval" tag in shot-04 is a button and said they would not click it. The pill is pre-existing, but this PR is what makes it the one row left visible. Pairing a short text status with the running icon would make it unambiguous.

Suggestions

  • In the "after" running state, pages.chat.turnBlock.earlier_step should say "earlier" only when the folded rows really come before the visible ones. Otherwise use a position-neutral label such as "N more steps", so the toggle's wording never depends on where the live row sits.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 610fcbcf83e7d964eae897aec68707d836df12c3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 610fcbc

Verdict parsed from the review's SHA-scoped output markers for commit 610fcbcf83e7d964eae897aec68707d836df12c3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 610fcbcf83e7d964eae897aec68707d836df12c3: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 610fcbcf83e7d964eae897aec68707d836df12c3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 610fcbc

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 610fcbcf83e7d964eae897aec68707d836df12c3: <one-sentence reason>

@iamwhatever
iamwhatever force-pushed the fix/stable-fold-state branch from f5a20b8 to 433a18f Compare October 14, 2026 20:50
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=05d0df77ee90 — fold animation removed

fixed in 433a18f: each row folds by easing its own grid track 1fr to 0fr plus opacity (CSS transition, 200 ms) on the same keyed div; no per-row motion component, so the row-identity and per-row cost goals still hold.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=7573d7195b45 — row vanishes when the window slides

fixed in 433a18f: every row already carries the grid track, so a row leaving the five-row window eases out instead of dropping in one frame; the toggle open/close eases the same way.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=5b100890a0a4 — no hint the row went into the group

fixed in 433a18f: the row now visibly shrinks toward the 'N earlier steps' toggle above it, which is the cue the static shots could not show; see the new after-running recording.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=cc0f4872b80f — no stated reason for dropping the animation

fixed in 433a18f: the animation is back rather than argued away; the body states the mechanism and that reduced motion cuts to the end state.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=55e85dc1f8dc — severity: every turn over five calls

fixed in 433a18f: same change; it applies to every fold on every surface that renders TurnBlock.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=226135930ffb — fix: animate on the same element

fixed in 433a18f: took the suggested shape, a CSS grid-rows 0fr/1fr transition on the single keyed div, motion-reduce:transition-none; only fold candidates clip their content.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=b377e3608da1 — live row sits above the earlier group

rebutted: the live row keeps its own place in time order; moving it below the toggle would move a running or pending row on screen, which the goal forbids. The toggle sits above the first folded row, so the group reads as 'older than what follows'.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=98d013ae3299 — rename the toggle when a live row is above it

rebutted: proportionality. The count already excludes the live row and the label says 'earlier', which is still true of the folded rows; a second label adds copy in 12 locales for a case the row order already shows. Open to a follow-up if a person wants it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=5e2f244af50d — mount cost of folded rows

fixed in 433a18f: a closed settled default-mode fold drops the content of rows that cannot go live (no MCP App on the message, never live while mounted), as main did. Measured on a settled closed 150-call turn, mount / 200 store updates: main 35 / 47 ms, 433a18f 44 / 43 ms (was 291 / 194 ms at f5a20b8).

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=2f2935038206 — compute liveness from the message

fixed in 433a18f in the smaller form: TurnBlock reads the one signal a settled row can still carry (meta.mcp_app) to keep it mounted; running and pending cannot hold in a settled turn, and user-opened stays in-row, so no second liveness path was added.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=186336ebca2e — dropping the height animation rides along

fixed in 433a18f: the fold animates again (grid-track transition on the same element); nothing beyond the fix rides along now.

@iamwhatever

iamwhatever commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=609a532ae9f2 — focus on toggle refolds the row and remounts the toggle

fixed in 433a18f: the toggle's place is computed from live rows only and ignores focus, so tabbing onto it never moves or remounts it; test 'tabbing from a folded-then-shown row onto the toggle keeps the same toggle focused' (mutation-checked).

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=3e3df449d09d — toggle label vs. position

rebutted: 'earlier' is relative to the five newest rows the window keeps, which is what the toggle sits above; every folded row is older than all of them. A live row stays in its own time slot by design (the goal forbids moving a running or pending row), so it can sit above the toggle without the label being false.
self-added: no

@iamwhatever

iamwhatever commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=e02dde46cb52 — 'N more steps' label variant

rebutted (disproportional): a second plural label in 12 catalogs plus pluralKeys for one ordering case widens a state-model fix; the count already excludes the live row. Fine as a separate follow-up if a maintainer wants it.
self-added: no

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • First Principles PASS punchline — settled toggle moves above the first tool row

answer: intended. The toggle sits above the first folded row in both phases, so in default mode it no longer jumps from below the reasoning row to the top at completion (the hard swap the review of #19932 flagged). The reasoning row itself never folds in default mode, so it stays on top as before; stated under Backwards compatibility.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=609a532ae9f2 — user-opened pill unmounted after a remount

fixed in 8b5e59c: ChatPage passes mayBeLive from its pill disclosure map (same toolDisclosureKey/messageRowKey the renderer keys the pill with), so a closed settled fold keeps that pill's content mounted and it reports itself live again after a remount; test 'keeps the content of a row the host says may be live' (mutation-checked).

@iamwhatever
iamwhatever force-pushed the fix/stable-fold-state branch from 433a18f to 8b5e59c Compare October 14, 2026 21:35
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_chat_persistence_composition_contract.py since this head went green (bcedb90 -> 37449b3); CI re-running.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 14, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=7fbf0dec5b32 — no approve or deny control in shot-04

rebutted: shot-04 is a harness of TurnBlock + ToolCallLine with no composer. On the real page Approve and Reject live in the always-visible approval bar of components/ChatInput.tsx (ApprovalCard), not inside the pill.
A pending pill registers with that bar (registerToolPill in pages/chat/ToolCallLine.tsx), which mirrors it as a ghost pill when the row is off screen. This PR changes neither file.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=cd4287de3114 — always say 'N earlier steps' while running

rebutted: same conductor decision as span dab3dcb63078: the neutral label stays. The fallback exists because 'earlier' is false when a live row older than the folded rows sits above the toggle. No copy change in this PR.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Design PASS punchline — an idle-broadcast flap unmounting a folded row

answer: same as span aae4d39f0935 on e99d2f1; TurnBlock is unchanged by this rebase. Only a folded row of a settled default-mode turn that hosts no MCP App and that the host does not mark mayBeLive drops its content, so an app iframe never unmounts.
During a running-flag flap such a row loses its content for that frame. Once running resumes the rule no longer applies (it requires turn.complete): the pill remounts, reports live and unfolds.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • First Principles PASS punchline — the settled toggle sits above the first tool row

answer: accepted, and stated in the body's Backwards compatibility line. The toggle is keyed by the row it sits above, so placing the settled toggle where the running one already sits keeps it still at completion (no row re-insert, no iframe reload). Folded rows stay one click away.
The approved head e99d2f1 shipped the same placement; re-approval of this head is the human check.

@iamwhatever
iamwhatever force-pushed the fix/stable-fold-state branch from a2bfcf4 to e8e0946 Compare October 15, 2026 09:56
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 15, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the toggle's place ignores focus (433a18f, for this span in round 0)

  • span=609a532ae9f2 — an open fold drops its toggle when focus enters its only row

fixed in e8e0946: the fold memo keeps first while the fold is open, (rows.size > 0 || open) ? first : -1, so focus inside an open fold never removes or remounts its toggle; a closed fold with no folded row still shows none.
tests: 'focus inside an open fold keeps its toggle' in website/src/test/TurnBlock.liveWindow.test.tsx (keyboard, mouse click, two rows, running turn, closed-fold guard); the one-row keyboard, one-row click and running-turn cases fail without the fix.
repair over removal: removing the focus-blind toggle place reopens the round-0 defect (focus on the toggle refolds the row and remounts the toggle).
span 609a532ae9f2 is path-scoped (every Opus FINDING in TurnBlock.tsx shares it): 4th hit across rounds, each a different defect, each fixed.

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
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 15, 2026
@iamwhatever
iamwhatever force-pushed the fix/stable-fold-state branch from e8e0946 to 610fcbc Compare October 15, 2026 10:35
@iamwhatever

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: focusedKey cleared on a focusout with no relatedTarget (the focus rule, f5a20b8)

  • span=609a532ae9f2 — a tab or window switch clears focusedKey and folds a focus-kept row

fixed in 610fcbc: onFocusOut clears only when (!e.relatedTarget) && document.hasFocus(). Measured in Chromium: a tab or window switch gives relatedTarget null with hasFocus false (and a focusin on the same element on return), so the row stays; a blank click or a removed focused element give relatedTarget null with hasFocus true, so it still clears.
focus into an iframe inside the row also reads relatedTarget null with hasFocus true, so it clears like a blank click; an inline MCP App row reports itself live and never folds either way.
tests: 'a focusout with no relatedTarget' in website/src/test/TurnBlock.liveWindow.test.tsx (tab/window switch and return, MCP App iframe, blank click, removed element); the tab/window case fails without the guard and the iframe case fails without liveness.
span 609a532ae9f2 is path-scoped: 5th hit; this is the last focus-tracking patch in this PR, a further focus edge is deferred to an issue.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 15, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=729e05d39056 — the toggle's noun changes mid-turn

rebutted: conductor decision recorded on e99d2f1 and kept since: the neutral label stays. 'N tool calls' replaces 'N earlier steps' only while a live row older than the fold sits above the toggle, where 'earlier' would be false; no copy change in this PR.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=9ac3ad4149e5 — the live row's state relies on colour and icon

rebutted: out of this PR's goal. The pill's running and pending visuals are unchanged here (this PR only changes which rows fold); a pending pill already carries the text tag 'Waiting for approval' and the aria-label pages.chat.toolCallLine.aria_awaiting_approval.
The tag is not a control: Approve and Reject live in the always-visible approval bar of components/ChatInput.tsx. A text status beside the running icon is new UI for its own issue.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=097f480b7ff6 — say 'earlier' only when the folded rows come first

rebutted: that is the rule as shipped: 'N earlier steps' shows only when no live row older than the fold sits above the toggle, else the neutral 'N tool calls'. Same conductor decision as span 729e05d39056: no new 'N more steps' copy in this PR.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Design PASS punchline — ChatMessageList hosts and a user-opened pill when its turn settles

answer: an opened ToolCallPill reports itself live (useReportRowActive(!isDone || hasPendingPerm || expanded) in app-sdk/messageRenderers.tsx), so it is not in the fold when its turn settles and the settled unmount rule never reaches it.
It loses its open state only if the host remounts it (a virtualized scroll), because those hosts keep that state in the pill's own useState; a remounted pill comes back closed and folds like any closed pill, as on main.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • First Principles PASS punchline — the settled toggle sits above the first tool row

answer: accepted, and stated in the body's Backwards compatibility line. Keyed by the row it sits above, the settled toggle stays where the running one already was, so completion moves nothing (no row re-insert, no iframe reload); folded rows stay one click away.
The approved head e99d2f1 shipped the same placement; re-approval of this head is the human check.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 15, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) October 15, 2026 11:32

@mbriones98 mbriones98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks green and readiness passed at 610fcbc; no behavior change.

@iamwhatever
iamwhatever merged commit 58a1885 into main Oct 15, 2026
103 checks passed
@iamwhatever
iamwhatever deleted the fix/stable-fold-state branch October 15, 2026 11:44
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat: the running-turn fold can hide a live tool call or reload an MCP App

2 participants