Repository navigation
fix(ui): a chat pinned to the bottom stops following turns sent from elsewhere - #165484
Conversation
Let reader scroll intent own transcript following regardless of which client started a turn. Remove remote-input tracking and typing-specific anchor clears, while preserving scrollback, restoration, prepend anchors, and manual commands. Cover remote arrivals and deferred typing growth with regressions that fail on the original implementation. Mocked Gateway browser proof keeps following viewers at the end and preserves reading anchors across two client contexts.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 2:51 AM ET / 06:51 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Control UI keeps bottom-following chats tracking messages and typing previews from other clients while preserving deliberate scrollback, with updated documentation and regression coverage. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still pauses following on remote arrivals. The recorded approval covers the intentional behavior change, the supplied proof demonstrates the desired result, and no actionable correctness or security findings remain. Priority: P2 Review scores
Verification
How this fits togetherGateway events feed messages, replies, and typing previews into the Control UI chat transcript. The transcript uses the reader’s scroll intent to decide whether incoming content stays visible or preserves the current reading position. flowchart TD
A[Gateway messages and typing] --> B[Chat transcript]
B --> C[Reader follow intent]
C --> D[Following latest content]
C --> E[Reading earlier content]
D --> F[Move viewport to latest]
E --> G[Preserve reading position]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -129, Tests +38, Docs 0. Total -91 across 17 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Let reader intent consistently own following across incoming turns and typing growth, with deliberate scrollback and explicit navigation retaining priority. Do we have a high-confidence way to reproduce the issue? Yes: current main explicitly locks following when remote input arrives in an initialized pane, and the captured two-context real-Gateway run reports the resulting below-fold reply. This review verified the source path without executing it. Is this the best way to solve the issue? Yes: removing origin-specific locks lets the existing scroll owner enforce the approved reader-intent policy without adding another mode, setting, or state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f70dff05e8c0. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
CI run 37417552972 tested cacf0d67a63e, whose main parent predates the source-map-js fix in #165902. Merge current main to include that fix without rebasing. The PR patch is unchanged; 160 focused UI tests and the production dependency audit pass.
|
Merged via squash.
|
…#165484) Let reader scroll intent own transcript following regardless of which client started a turn. Remove remote-input tracking and typing-specific anchor clears, while preserving scrollback, restoration, prepend anchors, and manual commands. Cover remote arrivals and deferred typing growth with regressions that fail on the original implementation. Mocked Gateway browser proof keeps following viewers at the end and preserves reading anchors across two client contexts.
Related: #153061
What Problem This Solves
Fixes: a Control UI tab that is pinned to the bottom of a session stops following the conversation when the new turn did not come from this tab — another device or browser, an RPC/API client, a channel, cron, or a run resumed after a Gateway restart. The new message and reply land below the fold behind the jump-to-latest arrow.
User Impact
User impact: if you are at the bottom of a chat, you stay at the bottom as new turns arrive from any source. If you scrolled up to read, nothing moves (unchanged), including with collaborator messages and remote typing indicators. Jump-to-latest, scrollback, prepends, restoration, and keyboard/wheel takeover are unchanged.
Why This Change Was Made
The chat state controller explicitly locked following whenever a user message arrived that this tab had not sent, even when the reader was already at the bottom. Following now uses the reader's own scroll intent (at bottom vs. scrolled away) instead of the message's origin. That removes the arrival cache and the typing-specific locks (+5/−134 production lines).
Evidence
Live (real Gateway with an OpenAI-backed agent, two headless Chromium contexts A and B on the same session; A sends a turn through the composer):
scrollTop 1641,fromBottom 889, jump arrow showing (Codex and built-in runtime sessions)fromBottom 0(scrollTop 1136 -> 2049, height1814 -> 2727)scrollTop 1524while the thread grows2702 -> 3615(fromBottom 500 -> 1413)A followed to
fromBottom 0in every run.(Mocked-Gateway e2e captures with synthetic content.)
204 focused/sibling tests and 9 mocked-browser tests pass; mocked-browser proof moved
fromBottomfrom 974 px to 0 while both reading cases kept 0 px anchor drift. UI production/test types, targeted lint, formatting, and ratchets pass. The real-Gateway collaborator e2e fixture was updated and typechecked but not executed; no native Safari run.Production +5/−134; tests +246/−208.
Landing verification
Merged main at
4304c49a8ea76c6f165115fc9502d70c5e56a224into this branch without rebasing, producing6fbafc0c7bd4fa3d892479ae82de7f28b2bdecb2. CI run 37417552972 tested stale mergecacf0d67a63e31820d87546f4328361b513c61c5with main parent39231741d8c09c5e19857ee18a1f01eb5c5b3410, before the source-map-js audit fix in #165902. Its security-fast dependency audit failed and cancelled the other selected lanes. The refreshed branch includes that fix and the production dependency audit passes locally.The PR patch is unchanged after the clean main merge (identical stable patch ID). Independent Codex review found no actionable P0–P2 findings. All 160 tests in the six focused scroll/typing/transcript suites passed in 20.31 seconds of runner time. Scrolled-up reader protections, restoration, and takeover assertions pass; no additional UI assertions were changed during landing. Existing live and browser proof remains applicable to the unchanged patch. Fresh ClawSweeper review and CI must bind the new head.