Repository navigation
fix(site/src): split live Working blocks at assistant text and scroll to their end on expand - #30656
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 715f799a8e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7f98a67d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
bde29b9 to
ab2fdee
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
jaaydenh
left a comment
There was a problem hiding this comment.
Two performance notes on the reveal chase in the vendored scroller, from reading the code (not measured in a browser).
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29a3bcb14b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffcae5a6b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
💡 Codex ReviewWhen a live-only block starts after earlier reasoning or text in the same stream, its AGENTS.md reference: site/AGENTS.md:L11-L11 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Re the Codex finding Preserve later live blocks across simultaneous paging handoff: confirmed and fixed in 8bb9e94. A test reproduced it: a stream of reasoning, text, and then a tool call, with the live block expanded, followed by one render that brings the prompt page, the persisted step, and no stream. The block remounted and lost focus. The live block identity now records the block's own start, and the fallback compares the persisted block's start with it instead of with the stream's start. The new
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
jaaydenh
left a comment
There was a problem hiding this comment.
Accessibility pass on the reveal-on-expand and block-splitting changes. Three inline comments below, roughly in priority order: the first two are worth fixing before merge, the third is worth considering.
One more, smaller point with no single line to anchor it: splitting at every assistant text produces many more Working disclosures with near-identical accessible names (several Worked for 3s (1 step) buttons in one turn). Screen reader users who navigate by the button list cannot tell them apart. That pattern existed before, but this PR makes it much more common; adding some context to the name (for example a short step summary) would help.
The scroll findings follow from how browsers handle focus navigation and the CSSOM behavior option; I did not reproduce them in Chromium.
…ocks and list them under Attachments (#30788) In `/agents` chats with **Collapse assistant steps** on, files the agent attaches (`attach_file`, computer-use screenshots, the `propose_plan` plan file) rendered as the answer after a Working block: the block closed at the attachment, and a turn that kept working split into several blocks. They now fold into the Working block of the step that made them and show when it is expanded. Rows outside every block (an uncollapsible `propose_plan` or `ask_user_question` row, a parked running tool) hide their files, and an agent row left with nothing else is not rendered. With the preference off, the transcript is unchanged, except that download cards get the focus ring the text-preview button beside them already has. To keep those files reachable, the right panel's Summary tab gets a collapsible **Attachments (N)** section, open by default. It lists the files the agent attached in the loaded messages, newest first, as the transcript's download cards (expired tile included); user uploads stay in their messages. While older history is unloaded, the section says so and offers **Load earlier messages**. Until the first message page reaches the chat store, the header shows no count, so a chat with files never flashes "(0)", and live messages do not make the list blink. Frontend only: production code changes 366 lines; the rest is tests, stories, and fixtures. This overlaps #30656, which renders attached files below the Working block; this PR keeps them inside the block, as the newer request asks, so whichever lands second reconciles `workingBlockGrouping.ts` and `ConversationTimeline.tsx`. **Collapse on.** The turn's files stay in the collapsed Working block, and the Summary panel lists them under Attachments (3), newest first.  **Block expanded.** Each file follows the step that attached it.  **Expired file.** After `old.zip` expires, the panel shows the expired tile in its place.  Follow-ups, out of scope: split `ConversationTimeline.tsx` (795 lines before, 805 now); keep focus on load-more buttons while they fetch (`HistorySidebar`, `InboxPopover`, this one); show the fetch error in both message pagers; share probe-learned expiry between the transcript and the panel; flag evicted files newer than the newest linked one, such as an evicted newest file (`deriveEvictedFileIds` cannot yet tell them from files the chat has not linked yet); name the file on the expired tile. ## Testing - `pnpm lint`, the AgentsPage unit tests (122 files, 2133 tests), and the story tests for the touched area (13 files, 261 tests) pass on 30007ac. - New unit tests cover a step's attachment staying in its block, rows outside blocks dropping files, `isAgentAttachmentOnlyRow`, `getAgentAttachments` (agent files only, newest first), the loading gate (a live message does not blank the list), and the load button. Each fails when its behavior breaks. - New stories: `ChatAttachments` (12 states), four `ChatSummaryPanel` states, and three working-block states. - Remote UAT round 4: **PASS** on 3e47d30, on a dev deployment built from the branch. It checked expired files on both surfaces, mouse and Enter downloads against the source files' sha256, no "(0)" on reload or chat switch, one count change per live attachment, and the focus ring. 30007ac changes only a doc comment after it, and the screenshots come from this round. Rounds 1 to 3 passed on earlier heads; round 3 covered Load earlier messages, rows outside blocks, and 18 real-model runs on four models. <details> <summary>Review record</summary> - 11 rounds of `coder-frontend-review` (8 global roles), `frontend-deep-review` (8 project roles), and `frontend-review` (FE1 to FE10), read-only. Round 9 ran all 17 roles on b53897c; rounds 10 and 11 re-checked the comment-only fixes on 3e47d30 and 30007ac. - Final verdicts: every checkpoint PASS except FE5 and FE6 (justified below). RP6's PASS requires the `ConversationTimeline.tsx` split follow-up listed above. - Test audit: PASS through b53897c. Every finding not listed below was fixed. - Codex: four rounds on 30007ac. Each of its five P2 findings was declined in its thread with evidence: a spinner for the one-commit hydration gap, the file name on the shared expired tile, the copy action for a text-and-file message that chatd never stores, gating the load button on hydration, and the `ChatAttachments` doc. Round 4 found no major issues. Justified FAILs: - FE5, no error text for a failed page: the transcript's pager shows the same retry-only state for the same query; follow-up. - FE6 and SA6, the button disables while fetching and loses focus: the repo's load-more pattern (`InboxPopover`, `HistorySidebar`); follow-up for all three. Dropped findings (finding: reason): - RO6 stack split: the component is 94 lines, and the hiding needs the panel, so the halves are not independent. - RP6 and RO5, split `ConversationTimeline.tsx` now: the PR adds call sites, a prop, and two flags; follow-up, and #30656 edits it. - RO1 `SidebarSectionHeader`: a sidebar h2 with no aria-controls; the section uses the Radix Collapsible in `SectionHeader`. - RO1 `isFileRenderBlock`: inline `block.type` checks are the grouping module's idiom. - RO2 shared retry button: the two share only variant, size, and label. - RO3 `every` helper: a one-line idiom with different predicates in two modules. - RO3 shared guard with `getMemberRow`: two conditions, and #30656 rewrites `getMemberRow`. - RO3 `Omit` over `Pick`: the `Pick` reuses the exported `EarlierMessagesProps` types. - RO3 page-level spread: `AgentChatPageView` passes every prop explicitly. - RO4 move `isAgentAttachmentOnlyRow`: it takes the grouping module's row type and sits beside `getRowBlocks`. - RO5 transcript focus ring: intended; it matches the text-preview button. - SD1 inline single-use story constants, and repeated fixture values: FE9 asks for named spread constants. - SD2 `{ message }` wrapper: retyping moves the map into `ConversationTimeline.tsx`, which #30656 edits. - SA2 `cva` for `fullWidth`: one boolean in a pre-existing component. - TN4 inline `type` imports: the repo's style for mixed imports. - TN4 `ChatStoreHandle`: `ChatStore` is the exported type; the handle is a file-local alias. - TN4 named `FileCardProps`: the file types its components inline. - TN4 `GetRowBlocksOptions`: named like `GroupWorkingBlocksOptions`. - TN5 `AgentAttachment` beside `readAgentAttachmentText`: that one reads user uploads, in another module. - TN6 copy: the repo's paged empty state (`SessionTimeline.tsx`) and the transcript's retry label. - CD1 `getAgentAttachments` doc: it states the ordering and the upload exclusion. - CD1 trim exported docs: AGENTS.md requires docs on exported symbols. - CD4 `isHydratingMessages` comment: pre-existing and consistent with its source. - CD5 consumers in the `EarlierMessagesProps` doc: the doc states the contract. - `splitRowBlocks` doc: the base text stays; a comment at the file condition gives the reason. - Hydration comment placement: it sits on the operand it explains. - Deleted `NotVisible` comment: this PR made it false. - TS1 and TS5 `NotVisible` assertions: pre-existing. - TS7 panel story with `hasMoreMessages`: tsc enforces the forward; `WithEarlierMessages` is the visual. - TS7 streamed-file story: live rows share the `getRowBlocks` call. - TS7 text-plus-file case and `ChatError` story: the grouping test fails on the same break; no new state. - TS7 raster image fixture: grouping treats every file part alike. - TS7 text and a file in one message: chatd persists a file as its own message; the unit test covers the branch. - Play-function assertions and a collapse test: plays drive state, and Radix owns collapsing. - `useChatMessages` unit test: a moved derivation with no new logic. - Drop `LoadingMessages` and `LiveMessageArriving`: each catches a call-site break (test audit). - A store per story, built in render: as `ChatPageContent.stories` does. - `NotVisible` capture shows the section: it renders whatever `isVisible` is. - RP4 hoist the `.map` callback: a single-use wrapper (site/AGENTS.md). - RP5 `useChatMessages` as a function: it owns two subscriptions that three components share. - RP8 pre-existing render helpers: unchanged; the split follow-up covers them. - Per-render derivations and a second subscription: pure derivations; only the queries are gated. - `useFileProbes()` before the branches: hooks cannot be conditional, and the default context is safe. - DF5 share probes with the panel: FileCard never probes; both read `chat.files`, polled every 5 s while the chat runs. - DF5 every loaded file evicted: a pre-existing `deriveEvictedFileIds` gap; follow-up. - DF5 empty before query data: the page shows its loading view then. - Spinner before the store fills: a one-commit window, so it would flash. - Previous chat after a switch: the page remounts per chat with its own store. - `void onFetchMoreMessages()`: `fetchNextPage` reports errors in its result, and the transcript calls it the same way. - Later parts first within a message: later parts are newer. - Up chevron when open: as `ChatSectionHeader` does. - `messageHelpers.ts` imports `chatAttachments.ts`: the page already loads it; dpdm finds no cycle. - Live status on a live row whose file is hidden: intended. - `m-0` on the empty state: `index.css` sets paragraph margins. - FileCard's name omits "Download file", and the expired tile names no file: pre-existing; naming the file is a follow-up. UAT observations, not failures: - A file in a message that also holds text after the tool call is listed only under Attachments, as for any row outside a block. Round 3 first reported it as a FAIL; only DB-seeded rows had that shape, and 18 real-model runs never did. - An evicted newest file keeps its link until a newer linked file exists (follow-up above). - The panel scroller clips the bottom of a card's focus ring at its bottom edge. - The load button has no aria-busy, and after a failure two buttons read "Retry loading earlier messages". - One parallel step with two files renders both tool rows before both cards. - The transcript's expired tile is 112px wide beside 384px cards, and its tooltip is mouse-only (pre-existing). </details> > Xum opened this PR on behalf of @ibetitsmike.
…h finished turn into one Working block A running or parked turn keeps the split view from #30656, where text between steps closes the open block. Once the turn ends (any turn before the latest user prompt, or the latest turn when the chat is no longer running, interrupting, or requires_action), its text between steps, the text before its first step, and its labeled narration fold back into one block per segment, leaving only the final message and attached files visible. Block and piece keys stay stable, so an expanded block keeps its scroller item and focus through the fold.
da079c0 to
5cb3cb5
Compare
|
@jaaydenh thanks for the accessibility pass. The three inline threads are fixed in 1b737f2 and 52530bb, with replies in each thread. Not changed here: the near-identical accessible names from your summary (several
|
…h finished turn into one Working block A running or parked turn keeps the split view from #30656, where text between steps closes the open block. Once the turn ends (any turn before the latest user prompt, or the latest turn when the chat is no longer running, interrupting, or requires_action), its text between steps, the text before its first step, and its labeled narration fold into one block per run of rows between rows that never fold, leaving only the final message visible. The fold starts collapsed. An ended turn's block records its expansion under a turn key taken from its last work piece, so what the reader expanded while the turn ran does not carry over, and what they expand afterwards survives paging. The fold takes over the scroller item of the turn's last block, so its summary keeps focus, and an output run is keyed by the count of output pieces before it in its row, so the answer below the fold does not remount when the text before it folds.
52530bb to
a2d857a
Compare
…box's own opener The timeline's lightbox host drops an open while another lightbox is open, but the openers recorded their trigger in a shared ref before opening. A text preview that loaded while an image lightbox was open replaced the image's trigger, so closing the image moved focus to the text file instead. Each open now keeps its own opener through returnFocusTo. The grouping comment on hidden provider calls now matches the precedence in the code.
… member no opener uses rememberTriggerButton existed for the timeline's attachment previews, which now keep their opener per open through returnFocusTo.
Expanding a collapsed Working block in the Agents chat kept the view where it was (#29354), so a block that expanded near the bottom of the view opened its steps below the fold, and the reader had to scroll to reach the latest one.
Expanding a Working block now brings its end into view. If the expanded block ends below the viewport, the transcript scrolls smoothly until the block's end sits at the bottom of the view; if it already ends in view, nothing moves. A block taller than the view scrolls only until its header reaches the top of the view, so the header button and the first step stay in view, and the reveal never scrolls up. If the reader prefers reduced motion, the view jumps instead of gliding. If a step then grows and pushes the end back out of view (an image loading), the view scrolls toward the new end the same way, until the reader scrolls or toggles a row, 2 seconds pass after its last scroll starts, or the block changes width because the view resized. When the block is the last row of the transcript, expanding it jumps to the end and resumes following new output. While a turn is anchored at the top of the view and one of its blocks expands in view, the view stays put and the anchor hold hands off to following once the reply fills the view, even with rows below the block; if the expansion already used up the hold's tail spacer, it hands off at once. Collapsing is unchanged.
ToolCall.Rootgets an opt-inrevealEndOnExpandprop, set only byWorkingBlockDisclosure, so other tool rows keep their behavior. It passes{ revealEnd }to the vendored message scroller'suserLayoutIntent, whose toggle-commitMutationObservercalls the newrevealItemEnd. When the reveal scrolls, it places the row and the tail spacer itself, so the existing resize pass (the anchor hold) runs only when the reveal does not scroll. The reveal records the row's size and an expiry, and the scroller's resize handler scrolls to the row's new end while that jump is still settling and the expiry has not passed. A change in the row's width ends the reveal. The jsdomMessageScrollerlayout harness moves fromToolCall.test.tsxtosite/src/testHelpers/messageScrollerLayout.tsxsoWorkingBlockDisclosure.test.tsxcan reuse it.Working blocks also split at assistant text while a turn runs. Text the assistant wrote between steps streamed below the live block, then folded into it when the next tool call arrived. While the turn runs or waits on the reader, every assistant text now closes the open block, and the next step opens a new block below it. That includes OpenAI narration and the lead-in before a provider-executed call such as a web search, which #30529 folded into the block. Files the agent attaches with
attach_filedo not close a block: as onmainsince #30788, they stay in the block of the step that attached them.groupWorkingBlockssplits each message row into alternating work and output pieces. Parsing records each content part's block index (ParsedMessageContent.partBlockIndices), so grouping can place each part without parsing the message again.Finished turns fold back into one Working block, as on
main: the steps, the files the agent attached, the text between steps, the text before the first step, and labeled narration go into the block, and only the final message stays below it. A turn is finished once a later prompt exists or the chat status leavesrunning,interrupting, andrequires_action, so nothing folds and unfolds while the agent works. Rows that never fold (questions, plans, hook notices, cleared or summarized context) still split a finished turn. The fold always starts collapsed. Its expansion is recorded under a key taken from the turn's last work piece, so what the reader expanded while the turn ran does not carry over, and what they expand afterwards survives paging and later turns. The fold takes over the scroller item of the turn's last block, so a focused summary keeps focus.The fold keeps the reader's place. Focus inside what the fold removes (a control in an expanded earlier block, a link in text between steps, the summary of a block only the stream had) moves to the fold's summary instead of falling to the page body. An open image, text file, recording, or Mermaid diagram lightbox stays open: lightboxes opened from the timeline render in a
LightboxHostabove its rows instead of in the component that opened them. One lightbox opens at a time, so a text preview whose fetch finishes after the reader opened another lightbox is dropped. A Markdown text preview has a host of its own, so a diagram in it still opens over the preview.Splitting blocks at text puts one-line block rows and narration rows next to each other, so transcript rows now sit 12px apart instead of 8px, the gap the chat loading skeleton already uses. Steps inside an expanded block keep their 8px gap.
While the turn runs, the text between two steps closes the first Working block, and the next step opens a new block below it:
Once the turn finishes, the same steps and the text between them fold into one Working block (expanded here), and only the final message stays below it:
Review notes
Deliberate choices from self-review (
frontend-reviewFE1 to FE10 andcoder-frontend-review):site/src/index.css(scroll-behavior: auto), and the growth chase repeats the reveal's scroll without a gesture, so the reveal readsprefers-reduced-motionand passesbehavior: "auto"when it is set. The existing chat scroll commands (submitChatTurn.ts, thescrollToMessagecallers inConversationTimeline.tsx) still passbehavior: "smooth". Each runs once per reader action, and moving them to the same check is a follow-up.main. Remote UAT hit this at 1440x560; at 1440x700 the view handed off. Handing off in that case would mean jumping to the end at the expand, which moves the block the reader just opened.scrollTop.mainjumps the same way from the same scroll position; the collapse path is unchanged here.requestAnimationFramewithsetTimeout. jsdom runs frames on the globalsetInterval, and the existing live-label test fakes timers while amotioncomponent requests a frame, which stalls every later frame in the file.BlockRowstays separate fromToolCall.test.tsx'sToolRow: sharing them would add a render-prop abstraction for two callers.Working block grouping:
main, files the agent attaches are work pieces of the step that attached them, a slice outside every block hides its files (mainlists them under Attachments in the Summary panel), and an agent row of only files outside a block renders nothing. While a turn runs, only text closes a block.TextBetweenStepsOpensNextBlockandAttachmentFoldsIntoLiveBlockshow the live split,TextBetweenStepsFoldsandRequiresActionKeepsTextBetweenStepsthe fold, andPaginatedFromAttachedFilethe paging case below.frontend-reviewFE9 asks for story variants in named constants, whilecoder-frontend-reviewTS3 and TS4 ask for overrides at the call site and no single-use story constants, and that skill lets its checkpoints win. The two new single-use message variants inConversationTimelineWorkingBlocks.stories.tsxstay inline, like the file's existing ones.attach_fileresult carries onlyname, the one fieldAttachFileLabelreads.mainalready shows for a turn with no tools. While that reasoning streams, a live Working block shows and dissolves when the text arrives. The same applies to reasoning between two texts. A block the reader focused or toggled stays a block instead, so focus and the content the reader opened stay where they were.ConversationTimelinekeeps those block keys in component state, so once the timeline remounts, for example after a reload, that reasoning renders on its own again.<body>: the block has its step, so grouping keeps it anyway, and keeping a block the reader focused does not change the key it gets in that render.Finished-turn fold:
ChatMessagehas no turn ID (chatd's turn ID is per prompt, for hooks, and is not stored), so the turn key isworking:turn:plus the slice key of the turn's last work piece. A turn's newest work always loads first, so older pages do not change it.main, a finished turn that ends in text and then narration, with no later work, folds both.FoldFocusRestoreris a class component because onlygetSnapshotBeforeUpdatesees the focused element before React commits the fold; a layout effect runs after the element is gone. It finds the focused element's scroller item throughdata-message-idand focuses the first ended-turn block whose persisted message IDs include one of that item's. A block that only the stream had has no persisted rows; its content persists as messages newer than any rendered before, so it matches the fold that holds one of those.Lightboxes:
useLightbox; outside a host they keep the lightbox themselves, as before.mainsince feat: list every chat attachment in the Summary panel #31140. Each open keeps its own opener (returnFocusToinuseDialogFocusReturn.ts) instead of the hook's shared ref: the host drops an open while another lightbox is open, so a text preview that loaded late would otherwise have moved the open lightbox's focus return to its own button.VideoLightboxnow uses the sharedLightbox, which unmounts on close like the image and diagram lightboxes. It drops itsopenprop and its exit fade, andRecordingPreviewdrops the key it bumped to reset the video's error state, since each open now mounts a newVideoLightbox.ConversationTimeline.tsxonly re-indent the timeline items under<LightboxHost>.Row spacing:
ChatMessageScroller(theConversationTimeline,ChatPageContent,AgentChatPageView, andAgentChatPagestories). TheWorkingBlocksandLiveWorkingBlocksstories render a bareMessageScroller.Contentwith no gap, so they do not change.getFlexGapingeometry.ts), so its spacer math follows the class.Delivery record
Remote dogfood UAT through Coder Agents on an isolated dev deployment, desktop viewport, 8 scenarios on
ccbb338f5cb. Round 1: FAIL on the collapse clamp above, which reproduces onmainfrom the same scroll position; that scenario was reworded to record the clamp as an observation. Round 2 on the same SHA: PASS. That run did not test a turn split across history pages or non-desktop viewports; the later run below does. Between runs, unit tests and a Chromium probe story (not committed) that records everyscrollTocall and the scroll position each frame cover the changes.Nine new
WorkingBlockDisclosurescroller tests (11 cases). Removing the reveal call, the prop, the!expandedguard, the in-view check, the anchored hand-off, the whole anchored branch, the spacer check, the growth chase, itssettling-jumpcheck, its in-view check, either height record, the clear on another jump, or the clear on a scroll up each fails at least one of them. The chase's growth check is only visible in a browser, where jsdom's instantscrollTohides it: in the Chromium probe, removing it re-issued the smooth scroll on every resize during the glide (3 calls instead of 1 when a row below the block grew mid-glide).Chromium probe on the final code: a block that grew 300 px mid-glide got a second smooth scroll at the growth and settled with its end 24 px above the bottom of the view; growth after the glide settled did the same; after
focus()moved the view up to an earlier row, a later growth left the view there.Codex round 1 on
715f799a8ed: two P2 findings (a cut-short smooth reveal at the last row; no hand-off when the expansion used up the anchor spacer). Both confirmed by execution and fixed inc7f98a67d99.Codex round 2 on
c7f98a67d99: one P2 finding (content that grows after the reveal, such as a lazy image, pushed the end back out of view). Confirmed with a failing test and fixed in990cb3542af. Self-review then found that a scroll with no gesture left that chase armed; fixed inb928354858dandd7053a2de50.Codex round 3 on
d7053a2de50: no findings.Rebased onto
mainat99afdc3b0fbto pick up fix: fold web searches, answer reasoning, and OpenAI narration into working blocks #30529, which folds an answer's reasoning into the Working block it ends. The first commit now also exportsisViewportfromtestHelpers/messageScrollerLayout.tsx, because theToolCall.Scrollabletests from refactor(site/src/pages/AgentsPage/components/ChatElements/tools): add ToolCall.Scrollable #30648 use it and this PR moved it there. Commit SHAs above are from before the rebase; each rebased commit keeps its subject. Codex round 4 on the pre-rebase mergebde29b9a1cc: no findings. Codex round 5 onab2fdeec307: no findings.Self-review:
coder-frontend-review(eight roles) andfrontend-review(FE1 to FE10) over five rounds, the last on the Codex fixes, re-running each failing role after its fix until every role passed ond7053a2de50; findings fixed or justified above.Working block grouping,
f97f2a911d3to5f87b148d88: written and reviewed on a separate branch, then cherry-picked ontoab2fdeec307with no conflicts and the same patch (git patch-id).coder-frontend-reviewran 13 rounds until all eight roles passed, andfrontend-reviewFE1 to FE10 passed apart from the FE9 note above. Red-green: letting attached files close the block fails both new attached-file tests, and the old live rule fails the live one.On
5f87b148d88: tsc, biome, oxlint (including the design-system config), knip, the React Compiler check, and dpdm pass, and so do the unit tests insrc/pages/AgentsPage,src/vendor, andsrc/testHelpers(2128 passed, 2 skipped) and the ChatConversation story tests (118).A long dogfood chat with attached files, loaded read-only and rendered with the attached-file fix: the reasoning before the final answer is the last row inside its block, and the files and the answer follow the block. The rebase onto feat(site/src/pages/AgentsPage): keep agent attachments in working blocks and list them under Attachments #30788 below replaced that file placement.
Row gap,
aac53217c4a: compared 8px, 12px, and 16px on the same read-only dogfood chat in Chromium at 1280 and 390 px widths. The story tests that renderChatMessageScrollerpass (7 files, 215 tests), andcoder-frontend-review(eight roles) andfrontend-reviewFE1 to FE10 pass.Review by @jaaydenh on
aac53217c4a, fixed in29a3bcb14b6: the growth chase had no end besides user input, and an expand forced up to four full transcript layouts. The chase now expires and ends on a width change. The reveal runs before the anchor hold, which it replaces when it scrolls, and the row's rect is read once, before the scroll's writes. Two new cases (the window passes, the block re-wraps at a new width) each fail with their check removed. The reorder changes no test outcome (29 pass either way); in a throwaway jsdom probe, an anchored expand made 21getBoundingClientRectcalls instead of 69. Not measured in a browser.coder-frontend-reviewpassed after four rounds; the size check reusesSCROLL_POSITION_EPSILON, which upstream also applies to row positions. Site checks pass on the new head (unit 2130 passed, 2 skipped; ChatConversation stories 118).Codex round 6 on
29a3bcb14b6: two P2 findings. When the newest loaded page opened with files the agent attached and later rows continued their block, the files rendered above a block labeled complete, and loading the older page moved the block above the files. Confirmed with a failing test and fixed inffcae5a6b7e: the block on that page is partial and renders above the files from the start (storyPaginatedFromAttachedFile). Since the rebase onto feat(site/src/pages/AgentsPage): keep agent attachments in working blocks and list them under Attachments #30788, the files open that partial block instead. Declined: running the scroller tests in a real layout engine. They assert the rows the scroller publishes as visible, with the jsdom modelmainalready uses, and the Chromium probe and remote UAT cover browser behavior.Codex round 7 on
ffcae5a6b7e: five style and structure findings. Fixed inacbd47dcc88: a hidden-entry assignment that nested a ternary, a nullish fallback, and a conditional, and a doc comment that restated a field name. Declined: extracting the row renderer into a component (the closure is onmain, and the file goes from 795 to 798 lines), a named props type for theTranscripttest helper (moved unchanged fromToolCall.test.tsx), and splitting a streamed row once rather than once per slice (the live row holds only the current step; in jsdom, a streamed update cost 0.04 ms for 3 sections and 1.8 ms for 50).Codex round 8 on
acbd47dcc88: one P2 finding. A live-only block that starts after text in the same stream remounted, collapsed, and lost focus when its prompt page, its persisted step, and a cleared stream arrived in one render. Confirmed with a failing test and fixed in8bb9e94b76b. Codex round 9 onda079c0b460: no findings.Remote UAT through Coder Agents on dogfood: an isolated dev deployment, real Anthropic and OpenAI models, desktop and 390 px viewports. Run 1 on
29a3bcb14b6: the reveal, the last row, the anchored turn, growth follow, grouping with real models, the row gap, collapse, and the mobile viewport pass, and the collapse clamp matchesmain. It also found gaps thatmaindoes not handle either: an anchored expand of a block with attached files below it never handed off to following (da079c0b460fixes it while some tail spacer is left), an expand within about 30 ms of an older page starting to load loses the reveal, and growth after an expand that did not scroll is not followed. Part 2 onacbd47dcc88: with the page boundary at the attached files, the partial block renders above the files before and after the older page loads (the control,29a3bcb14b6, reorders them); the reveal, growth follow, and real-model grouping pass, and the grouping refactor renders 4 web-search chats the same asffcae5a6b7e. Part 3 onda079c0b460, withacbd47dcc88as the control: an anchored expand of the live block with attached files below it hands off to following at 1440x700 (2 of 2 runs, control 0 of 1), and so does an expand of an earlier block of the turn (2 of 2, control 0 of 2); the reveal below the fold and the anchored expand of the last block pass. At 1440x560 the files used up the tail spacer before the expand, so the hold stayed, as on the control andmain(see the review notes). Verdict onda079c0b460: PASS. Not tested: an OpenAI lead-in before a web search, OpenAI narration across three or more tool calls, and a real image that loads late inside a block (the growth checks injected it).On
da079c0b460: tsc, biome, oxlint (including the design-system config), knip, the React Compiler check, and dpdm pass, and so do the unit tests insrc/pages/AgentsPage,src/vendor, andsrc/testHelpers(2134 passed, 2 skipped) and the ChatConversation story tests (119).coder-frontend-review(eight roles) andfrontend-reviewFE1 to FE10 pass on each fix, with the failing roles re-run after their fixes.CI on
da079c0b460: the required checks pass. The Storybook (Pixel) job fails on one story this PR does not touch: theUserEngagementChartLoaded story's play function cannot find its "User engagement" group. fix(site/src): replace role="application" on recharts charts #30375 added that check tomainwith the wrong case, and fix: match chart accessible name in story #30907 fixed it onmainafter this run started. A re-run reuses this run's merge commit, so the job stays red until the next push.Rebased onto
mainat23c7f1fa61eto pick up feat(site/src/pages/AgentsPage): keep agent attachments in working blocks and list them under Attachments #30788, which keeps the files an agent attaches in their Working block and lists files outside every block under Attachments.5cb3cb519a0replaces this PR's files below the block with that model and movesgetSliceContentintoworkingBlockGrouping.tsbesidesplitRowPieces. Partial blocks render in place again, so files at the top of a page open the block. The files-below-block test and story are gone. Commit SHAs above are from before this rebase.88f9d835f5dtrims a story comment after frontend review.On
5cb3cb519a0: biome, tsc, oxlint, knip, the React Compiler check, and the ChatConversation unit and story tests pass. CI passes on5cb3cb519a0and88f9d835f5d.Accessibility review by @jaaydenh on
88f9d835f5d, fixed in1b737f2064dand52530bb2ca1. The reveal aligns a block taller than the view with the top of the view and never scrolls up, the reveal and its growth chase honorprefers-reduced-motion, and a reasoning-only block the reader focused or toggled stays a block when text follows it. New tests: a tall block stops at its header, and later growth does not pull the view back up; the reveal passessmoothorautoby motion preference; a focused or expanded reasoning-only block keeps its summary button through the next text and the persisted message. Removing the start alignment, the never-up check, the motion check (always smooth or always auto), the kept-key check in grouping, or either call that records a kept block each fails at least one of them. Not changed: the last-row reveal and the remount in the paging render (both above), and the near-identical block names from the review summary (answered in a PR comment).coder-frontend-reviewpassed after three rounds with one finding declined (splitting the PR), andfrontend-reviewFE1 to FE10 pass. On52530bb2ca1: the pre-commit hook (make pre-commit, which runs biome, oxlint, tsc, dpdm, the React Compiler check, and knip for the site) and the design-system oxlint config pass, and so do the unit tests insrc/pages/AgentsPage,src/vendor, andsrc/testHelpers(2214 passed, 2 skipped; the 8 failures are all inProjectChatsList.test.tsx, which also fails on88f9d835f5dwithout these changes) and the ChatConversation story tests (121).Folded feat(site/src): fold each finished turn into one Working block #31025 (finished-turn fold), fix(site/src/pages/AgentsPage/components/ChatConversation): move focus the turn's fold removes to its summary #31138 (fold focus), and fix(site/src/pages/AgentsPage/components): keep an open lightbox through the turn's fold #31139 (lightboxes through the fold) into this PR and rebased it onto
mainat7283fff69feas one commit,a2d857aea5e; the three PRs are closed. Before the fold, each passedfrontend-deep-review(eight roles, three rounds), a test audit, andfrontend-reviewFE1 to FE10, with CI green. Each of their new tests failed without its fix: every fold focus case without the restorer, the image test without the timeline's host, the late text preview test when a late open replaces the open lightbox, and the diagram test without the Markdown preview's own host.Rebase conflicts with feat: list every chat attachment in the Summary panel #31140 and feat: show web searches and the pages they found in chats #29861, resolved to keep both sides: lightbox openers keep
useLightboxand feat: list every chat attachment in the Summary panel #31140's focus return, and grouping counts only provider calls that render no row as searches (web searches now render as tool rows) and skips cited sources when a provider tool row is in the block. Three grouping tests that used aweb_searchcall as a call with no row now use acode_executioncall, as feat: show web searches and the pages they found in chats #29861 did for its own tests.frontend-deep-reviewof the resolution (one reviewer over the eight roles) found that a text preview loading while another lightbox was open replaced that lightbox's focus return target, so closing it focused the text file.db53e1872ebgives each open its own opener, and the late text preview test now also checks that focus returns to the image; that check fails without the fix. The re-review found the hook member this left unused, whichdf1fb8a4cb8removes. Not changed: the two known limits under Lightboxes.frontend-reviewFE1 to FE10 pass on both commits.On
db53e1872eb: the story tests of the ChatConversation and ChatElements folders andVideoLightboxpass (414), and so do the unit tests insrc/pages/AgentsPage,src/vendor, andsrc/testHelpers(2303 passed, 2 skipped) apart from 30 failures in five project and create-page test files this PR does not touch. Those fail the same way onmainin this workspace, where requests that escape the mocks reach a local server on port 3000 (skillsQuery.data?.filter is not a functionand similar); CI's test-js passes ondf1fb8a4cb8. Ondf1fb8a4cb8, which only drops the unused member: the pre-commit hook (biome, oxlint, tsc, dpdm, the React Compiler check, knip), tsc, and the focus return tests pass.doc-checkauthor self-check: no findings. The docs do not describe how the chat transcript groups steps, so no page changes.The screenshots are from the
TextBetweenStepsOpensNextBlockandTextBetweenStepsFoldsstories ondb53e1872eb; the earlier screenshots showed finished turns split at text, which no longer happens.