Skip to content

fix(ui): a chat pinned to the bottom stops following turns sent from elsewhere - #165484

Merged
steipete merged 2 commits into
mainfrom
codex/stab-passive-scroll
Oct 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/stab-passive-scroll

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #153061

Maintainer decision (2026-10-05): approved. This intentionally reverses the "local send intent controls following" rule from #153061 and 2a3aee2. A reader who scrolled up never moves; a viewer already pinned to the bottom follows new turns from any source.

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

Scenario main this branch
B pinned to the bottom before the turn B stays at scrollTop 1641, fromBottom 889, jump arrow showing (Codex and built-in runtime sessions) B follows to fromBottom 0 (scrollTop 1136 -> 2049, height 1814 -> 2727)
B scrolled up 500 px before the turn stays put (unchanged; not re-measured) B stays at scrollTop 1524 while the thread grows 2702 -> 3615 (fromBottom 500 -> 1413)

A followed to fromBottom 0 in every run.

Passive viewer after an incoming turn
Before before
After after

(Mocked-Gateway e2e captures with synthetic content.)

TMPDIR=/private/tmp/oc-passive-scroll pnpm test ui/src/pages/chat/chat-input-scroll-ownership.test.ts --maxWorkers=1
main:   4 failed
branch: 4 passed (22.3 s wall)

204 focused/sibling tests and 9 mocked-browser tests pass; mocked-browser proof moved fromBottom from 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 4304c49a8ea76c6f165115fc9502d70c5e56a224 into this branch without rebasing, producing 6fbafc0c7bd4fa3d892479ae82de7f28b2bdecb2. CI run 37417552972 tested stale merge cacf0d67a63e31820d87546f4328361b513c61c5 with main parent 39231741d8c09c5e19857ee18a1f01eb5c5b3410, 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 2:51 AM ET / 06:51 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: 6fbafc0c7bd4fa3d892479ae82de7f28b2bdecb2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused simplification with sufficient real behavior evidence, retained reader protections, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The real-Gateway two-context measurements exercise remote composer submission through chat arrival and transcript scrolling: the passive follower reaches the tail while the scrolled-up reader stays fixed. Inspected before/after browser screenshots supplement those observations, and the changed UI patch remains identical after the main merge. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The real-Gateway two-context measurements exercise remote composer submission through chat arrival and transcript scrolling: the passive follower reaches the tail while the scrolled-up reader stays fixed. Inspected before/after browser screenshots supplement those observations, and the changed UI patch remains identical after the main merge. No stored-data contract changes.
Evidence reviewed 9 items Current main still contains the reported mechanism: At the pinned fetched main revision, observeInputArrivals identifies remote user input and captureRenderLifecycleChanges calls lockChatScroll with remote-input. This still disables following for an already bottom-pinned viewer.
Introduced repair preserves the existing scroll owner: The pinned introduced diff removes remote-input tracking and typing-specific anchor clearing. Existing committed scroll scheduling, reader takeover, restoration rejection, and pane-owned follow permission remain in place; retired manual-scroll queries have no remaining references.
Accepted behavior change: The captured PR body explicitly records maintainer approval dated October 5, 2026, for replacing local-send-only following with reader intent. This covers the current removal of remote-arrival and typing locks. The earlier merged collaboration work at #153061 remains relevant for scrollback protection, rather than superseding this repair.
Findings None None.
Security None None.

How this fits together

Gateway 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -129, Tests +38, Docs 0. Total -91 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 7 5 134 -129
Tests 8 246 208 +38
Docs 2 9 9 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 260 351 -91

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a limited Control UI scrolling problem with a visible jump-to-latest recovery path.
  • merge-risk: 🚨 compatibility: The PR intentionally changes the documented response to remote activity; the captured maintainer approval explicitly accepts that change while retaining scrollback protection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The real-Gateway two-context measurements exercise remote composer submission through chat arrival and transcript scrolling: the passive follower reaches the tail while the scrolled-up reader stays fixed. Inspected before/after browser screenshots supplement those observations, and the changed UI patch remains identical after the main merge. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The real-Gateway two-context measurements exercise remote composer submission through chat arrival and transcript scrolling: the passive follower reaches the tail while the scrolled-up reader stays fixed. Inspected before/after browser screenshots supplement those observations, and the changed UI patch remains identical after the main merge. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-05T09:36:14.125Z sha 6d9689d :: blocked before merge. :: none
  • reviewed 2026-10-06T05:20:21.813Z sha 6d9689d :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review October 6, 2026 05:14
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 6, 2026
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.
@steipete
steipete merged commit cd060c5 into main Oct 6, 2026
85 checks passed
@steipete
steipete deleted the codex/stab-passive-scroll branch October 6, 2026 07:00
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant