Repository navigation
fix(ui): transcript end hides under the PR chip and Side chat questions cannot wrap - #144703
Conversation
…questions wrap Users following a long coding session saw the newest transcript rows clipped behind the pull-request chip and task-progress dock while the view believed it was at the end and hid the scroll-to-latest button; a width change "fixed" it. Live on a stable team instance the thread rested 48px short with the last row 25px under the PR chip. End-follow runs in a requestAnimationFrame after the commit that grows a row. For task-driven commits (tool-stream sync, session events) that frame precedes the row's ResizeObserver, so the follow scrolled to a stale maximum, and the outstanding end command never settled. The transcript host now records the maximum an end command targeted and re-targets it after commits when the committed maximum moved. The render-lifecycle change capture also tracks chatStreamSegments identity, so Codex-harness preamble growth schedules a follow at all. Pending-offset restoration moves to a sibling module to stay under the file-length cap. The Side chat prompt becomes an auto-growing textarea that reuses the main composer's sizing owner and send-key rule (Enter or the configured modifier shortcut asks, Shift+Enter adds a line); its composer lifecycle lives in chat-session-rail-composer.ts. Proof: chat-transcript-end-follow.browser.test.ts fails on the previous host (distance 48, programmatic true) and passes now; chat-scroll-dock.e2e.test.ts rests 181-601px short without the stream-segment capture and at 0 with it; chat-session-companion-composer.e2e.test.ts covers wrapping, Shift+Enter, verbatim multi-line asks, shrink-back, and modifier shortcuts.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Security-sensitive changes notedThis PR includes security-sensitive file changes. The guard is informational because the PR author is a repository admin or a member of
Changed files:
Security review is still recommended before merge when the change is intentional. |
Repair the exact-head CI failures in checks-ui (1/3) and checks-node-compact-large-9. The retained Review fixture must initialize settings before the Side chat shortcut binding reads them. Reuse loadSettings as production does; preserve runtime code and assertions.
Exact-head CI exposed synthetic scrollTop writes racing outstanding end commands in position-rail, focused-row, and native-history scenarios. Send real wheel input through the existing cancellation owner before asserting reader geometry. Preserve all assertions, timeouts, and runtime behavior. The ten targeted E2E cases, changed checks, and scoped autoreview pass.
The first end-follow repair re-targeted any outstanding end command when the committed maximum moved. An instant follow that does not move emits no scroll event, so that command lingered, and a reader who later left the end without an input event (find-in-page, focus navigation, programmatic scroll) was pulled back by the next growth; three e2e tests had been switched to wheel input to hide exactly that. The host now keeps an explicit end anchor: the maximum a reader is known to rest at, set by an instant end-follow or observed after any commit. A commit that moves the end while the reader still sits at the previous end re-pins them; a reader found anywhere else clears the anchor and is never pulled back. The three e2e tests return to their original programmatic scrolls. Proof: chat-transcript-end-follow.browser.test.ts adds a programmatic departure case (348px yank on the previous retarget, 0 now) and an observed-at-end growth case (48px short without the anchor, 0 now); the restored e2e files pass unmodified.
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 3:49 AM ET / 07:49 UTC (Revision 2). ClawSweeper reviewWhat this changesKeeps growing chat transcripts above the bottom dock and makes Side chat questions wrap, grow, and honor the existing send shortcut, with regression coverage and documentation. Merge readiness✅ Ready for maintainer review The PR remains useful: current main lacks the repairs, and the latest commit addresses the previous disclosure-anchor finding. No further blocking correctness defect was identified. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI renders Gateway session events into a virtualized transcript and a separate Side chat panel. These changes govern the reader’s scroll position and question entry before submission through the existing Gateway API. flowchart TD
A[Gateway session events] --> B[Chat render lifecycle]
B --> C[Transcript measurement]
C --> D{Reader still at end?}
D -->|Yes| E[Keep newest content visible]
D -->|No or disclosure interaction| F[Preserve reader position]
G[Side chat question and send preference] --> H[Growing textarea and existing submission]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +155, Tests +674, Docs 0, Other +1. Total +830 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep end-follow within the existing transcript owner while yielding to reader interactions, and reuse the main composer’s sizing behavior and saved send preference for Side chat. Do we have a high-confidence way to reproduce the issue? Yes, source inspection and the supplied regression scenarios establish a concrete path: task-driven row growth can outpace virtual-sizer measurement, while Side chat’s existing input cannot wrap. This review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes. The patch repairs the existing rendering owners, preserves stored preferences, and now yields to disclosure geometry instead of competing with it. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1531482dc3bc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Exact-head CI exposed transcript disclosure expansion moving the clicked row by 120-357 px. Retire the end anchor when the interaction captures its row and defer end reconciliation during its measurement commit, so the pending virtual sizer cannot re-arm a stale end. The three existing disclosure cases fail before and pass after. All three browser end-follow regressions and 20 focused E2E cases pass; changed checks and scoped P0-P2 autoreview are clean.
|
Merged via squash.
|
…ns cannot wrap (openclaw#144703) * fix(ui): keep the transcript end above the PR chip and let Side chat questions wrap Users following a long coding session saw the newest transcript rows clipped behind the pull-request chip and task-progress dock while the view believed it was at the end and hid the scroll-to-latest button; a width change "fixed" it. Live on a stable team instance the thread rested 48px short with the last row 25px under the PR chip. End-follow runs in a requestAnimationFrame after the commit that grows a row. For task-driven commits (tool-stream sync, session events) that frame precedes the row's ResizeObserver, so the follow scrolled to a stale maximum, and the outstanding end command never settled. The transcript host now records the maximum an end command targeted and re-targets it after commits when the committed maximum moved. The render-lifecycle change capture also tracks chatStreamSegments identity, so Codex-harness preamble growth schedules a follow at all. Pending-offset restoration moves to a sibling module to stay under the file-length cap. The Side chat prompt becomes an auto-growing textarea that reuses the main composer's sizing owner and send-key rule (Enter or the configured modifier shortcut asks, Shift+Enter adds a line); its composer lifecycle lives in chat-session-rail-composer.ts. Proof: chat-transcript-end-follow.browser.test.ts fails on the previous host (distance 48, programmatic true) and passes now; chat-scroll-dock.e2e.test.ts rests 181-601px short without the stream-segment capture and at 0 with it; chat-session-companion-composer.e2e.test.ts covers wrapping, Shift+Enter, verbatim multi-line asks, shrink-back, and modifier shortcuts. * test(ui): initialize settings in retained panel fixture Repair the exact-head CI failures in checks-ui (1/3) and checks-node-compact-large-9. The retained Review fixture must initialize settings before the Side chat shortcut binding reads them. Reuse loadSettings as production does; preserve runtime code and assertions. * test(ui): use reader input before transcript scroll assertions Exact-head CI exposed synthetic scrollTop writes racing outstanding end commands in position-rail, focused-row, and native-history scenarios. Send real wheel input through the existing cancellation owner before asserting reader geometry. Preserve all assertions, timeouts, and runtime behavior. The ten targeted E2E cases, changed checks, and scoped autoreview pass. * fix(ui): re-pin only a reader still resting at the transcript end The first end-follow repair re-targeted any outstanding end command when the committed maximum moved. An instant follow that does not move emits no scroll event, so that command lingered, and a reader who later left the end without an input event (find-in-page, focus navigation, programmatic scroll) was pulled back by the next growth; three e2e tests had been switched to wheel input to hide exactly that. The host now keeps an explicit end anchor: the maximum a reader is known to rest at, set by an instant end-follow or observed after any commit. A commit that moves the end while the reader still sits at the previous end re-pins them; a reader found anywhere else clears the anchor and is never pulled back. The three e2e tests return to their original programmatic scrolls. Proof: chat-transcript-end-follow.browser.test.ts adds a programmatic departure case (348px yank on the previous retarget, 0 now) and an observed-at-end growth case (48px short without the anchor, 0 now); the restored e2e files pass unmodified. * fix(ui): preserve disclosure anchors during end-follow Exact-head CI exposed transcript disclosure expansion moving the clicked row by 120-357 px. Retire the end anchor when the interaction captures its row and defer end reconciliation during its measurement commit, so the pending virtual sizer cannot re-arm a stale end. The three existing disclosure cases fail before and pass after. All three browser end-follow regressions and 20 focused E2E cases pass; changed checks and scoped P0-P2 autoreview are clean.
What Problem This Solves
Fixes an issue where users following a long-running coding session in the Control UI chat would see the newest transcript rows clipped behind the pull-request chip and task-progress dock at the bottom, even though the view believed it was scrolled to the end and hid the scroll-to-latest button. Opening or closing a side panel (any width change) suddenly "fixed" it. Observed live on a stable team instance: the thread rested 48px short of its end, the last row's bottom sat 25px under the PR chip, and the scroll-to-latest affordance stayed hidden.
Also fixes the Side chat question box, which was a single-line input: long questions scrolled horizontally instead of wrapping, and Shift+Enter could not add a line.
Why This Change Was Made
Transcript end-follow runs in a requestAnimationFrame after the Lit commit that grows a row. When that commit comes from a task (tool-stream sync, session events) rather than the rAF-throttled stream frame, the follow's frame runs before the row's ResizeObserver enlarges the virtual sizer, so it scrolls to a stale maximum and leaves the reader short by the growth. Nothing re-followed afterwards, and the outstanding "end" command never settled, so scroll events were treated as programmatic and the new-messages state was never published.
The transcript host now keeps an explicit end anchor: the maximum a reader is known to be resting at (set by an instant end-follow or observed after any commit). After each commit, if the end moved while the reader still sits at the previous end, it re-pins them; a reader who left the end by any means (input, find-in-page, focus, programmatic scroll) clears the anchor and is never pulled back. Reader takeover still cancels commands; the existing settle logic remains the terminal state. Expanding a disclosure (tool group, details) is an interaction, not the end moving: it clears the anchor so the clicked row stays put.
A second gap compounded it for Codex-harness sessions: their transient commentary/preamble deltas update the stream segments but were not part of the render-lifecycle change capture, so those growths scheduled no follow at all. The capture now tracks stream-segment identity alongside tool messages. Scroll policy in
scroll.tsis unchanged. Two owner files crossed the 700-line cap and each hands one cohesive unit to a sibling module (pending-offset restoration; the Side chat composer textarea).The Side chat composer becomes an auto-growing textarea that reuses the main composer's sizing owner and send-key rule (Enter or the configured modifier shortcut asks, Shift+Enter adds a line), keeps its 400-character limit, and shrinks back after asking.
User Impact
Evidence
chat-transcript-end-follow.browser.test.tsdrives the real transcript controller, grows the last row from a task while an end command is outstanding, and asserts the settled position. On the previous code it fails withdistance: 48, overhang: 26, programmatic: true; with the fixdistance: 0, overhang ≤ 0,programmatic: false(re-verified by reverting only the host change). Two further cases guard the anchor: a reader who leaves the end programmatically is not pulled back when the row grows (a command-based retarget displaced them by 348 px), and a reader observed resting at the end stays pinned when a row grows without any scheduled follow (48 px short without the anchor).chat-scroll-dock.e2e.test.ts: PR chip and task-progress card appearing after settle, scroll-to-latest, and a growingagent-runframe row through preamble commentary and tool events all keepdistance ≤ 8pxand the last row clear of the dock. Without the stream-segment change capture the growing-run scenario rests 181, 321, 461, and 601 px short of the end with the scroll-to-latest button hidden (re-verified by reverting only that change).chat-session-companion-composer.e2e.test.ts: wrapping and growth, Shift+Enter newline without sending, verbatim multi-line submission and shrink-back, and Control/Meta+Enter under themodifier-entershortcut.chat-scroll,chat-flow.streaming,chat-pull-requests,chat-session-companion-focus,chat-selection-to-main,chat-rail-columns,chat-responsive.browser(127), rail/transcript unit and isolated lanes;check-changedclean.Side chat composer, synthetic mock captures (before / after):