Skip to content

fix(ui): group chat position markers by assistant run - #143296

Merged
vyctorbrzezowski merged 3 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/chat-rail-user-turns-only
Sep 13, 2026
Merged

vyctorbrzezowski merged 3 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/chat-rail-user-turns-only

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Related: #143290

What Problem This Solves

Fixes an issue where users navigating the chat position rail would see several markers for one assistant run when the loaded history starts after that run's user message. A run with three responses separated by tool calls could appear three times. The current marker could also disappear while reading a later response in the same run.

Why This Change Was Made

The rail now keeps one marker per visible user message and one per assistant run. It uses the first displayed response as the jump target and the latest displayed response for the preview. Tool calls, results, thinking, and status alone create no marker. A streaming marker keeps its identity and focus when the response is saved; an empty failed run creates no marker.

The marker index reuses visibility prepared by transcript grouping, avoiding repeated normalization of loaded history. All visible responses in a run contribute to its current-position highlight. Message jumps replace the virtualizer's row target with the selected bubble's position, so returning from a long continuation reaches the first response reliably. This builds on the compact rail in #142227 by @vyctorbrzezowski.

User Impact

Users can navigate questions and assistant runs without duplicate tool-related entries, keep their place through long responses, and retain user/assistant previews, assistant image previews, and shared-participant attribution.

Evidence

  • Rebased onto main at 2d87daf04b78992382299d552f15ac84a86a23ed, reconciling fix(ui): avoid extra chat rail work while replies stream #146883 by @vincentkoc with assistant-run grouping. The native mutation observer ignores streamed text edits and still reconciles mounted, removed, and renamed bubble targets, including provisional stream messages.
  • The original regression from fix(ui): avoid extra chat rail work while replies stream #146883 is unchanged. The streaming handoff regression additionally covers provisional bubble observation, removal/remount, identity changes, and zero bubble-target rescans while text changes.
  • Current validation: 6,002 unit tests passed across 267 chat files, and all four rail E2E scenarios passed in dark/light Chromium, including returning from a long continuation. The production UI bundle built successfully.
  • Additional verification on this head reported 9,519 passing cases with no test assertion failures. The broad run's parent launcher exited 143; its surviving Vitest child completed 9,489 passing cases, but an exit 0 for that entire launcher chain was not confirmed. The other three invocations exited 0.
  • The initial CI attempt failed in checks-node-compact-large-16, at src/agents/cli-runner/execute-plugin-native-bash.test.ts:50 (applies allowlist/on-miss to native Bash with configured PATH), receiving deny instead of allow. The failing test and its agent/infra owners are outside this PR's diff. This was classified as an external runner/PATH failure; the single rerun of failed jobs passed on the unchanged head. The exact-head watcher finished GREEN, and the CI workflow completed successfully. No assertion, timeout, or baseline was changed.
  • The broad browser run passed 53 tests and timed out once waiting for the HTML file editor to become editable. The complete 54-test browser lane then passed on both the target main and this candidate in an independently installed checkout, without assertion or timeout changes. The initial failure was not reproduced.
  • Current changed-file checks passed, including formatting, core-test and UI types, i18n, lint, styles, declaration guards, and unused-export checks. The source review found no actionable P1/P2 issues in the complete diff, including the provisional-target test extension.
  • Earlier evidence from the pre-rebase revision: 1,112 tests across the 12 changed unit-test files, four Chromium browser scenarios, the production UI build, startup budgets, and changed-file checks passed. That evidence is historical; the current results are listed above.
  • The original marker regression failed before the fix with three assistant markers instead of one. The original browser regression also failed in both themes before the scroll-owner repair. The provisional observation regression fails when target selection is restricted to persisted messages.
  • The existing, inspected real-app captures below predate the rebase and use synthetic history. The primary dark/light pair shows the preview changing from the first response to the latest response of the run. The fixture originally reported 82 markers before and 80 after. The attachment and dark mobile pairs use different scroll offsets and do not establish exact scroll-position parity; the current browser assertions cover navigation and continuation highlighting.
ScenarioBeforeAfter
Desktop dark, three responses share one runBefore: Desktop dark, three responses share one runAfter: Desktop dark, three responses share one run
Desktop light, final response previewBefore: Desktop light, final response previewAfter: Desktop light, final response preview
Desktop dark, shared participant and attachmentBefore: Desktop dark, shared participant and attachmentAfter: Desktop dark, shared participant and attachment
Desktop light, long response midpointBefore: Desktop light, long response midpointAfter: Desktop light, long response midpoint
Mobile dark, 390 pxBefore: Mobile dark, 390 pxAfter: Mobile dark, 390 px
Mobile light, 390 pxBefore: Mobile light, 390 pxAfter: Mobile light, 390 px

Risk and coverage

Grouping relies on the transcript's canonical run identity. Messages without it retain the existing transcript grouping. The rail indexes loaded history; fetching a session-wide index remains separate work. Folded work is excluded from jump targets until expanded. No production Gateway session was accessed; proof uses the actual transcript model and mocked Gateway flows. Mobile visibility and existing rail styling remain unchanged.

The shared display helper's consumers were checked by name: transcript grouping, transcript Markdown rendering, rail previews, New Session draft previews, and Custodian messages. Grouping, Markdown, and rail behavior have focused automated coverage; the New Session and Custodian call-site migrations were inspected in source. The transcript cache compares the prepared visibility fact, and the session virtualizer remains the scrolling owner. No new visual captures were produced during the rebase. The related issue #143290 also requests user-only markers and complete-session indexing; those remain separate from this PR's stated run-grouping fix.

The shared scroll owner also serves Reply to an already loaded source (ui/src/pages/chat/components/chat-transcript-projection.ts:678–688) and Reply after history pagination (ui/src/pages/chat/chat-pane-reply-navigation.ts:126–180). Both call sites were inspected on this head; 14 message-action and Reply-recovery E2E cases and 38 transcript-controller tests passed. Those flows cover source selection/highlighting, avoiding unnecessary lookup, pagination, and recovery after reconnect. The four rail E2E cases cover the shared owner's long-row return geometry; the paginated Reply E2E does not separately measure final bubble alignment, and its unit coverage spies on revealMessage.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 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.

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review September 9, 2026 17:38
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 4:07 PM ET / 20:07 UTC (Revision 7).

ClawSweeper review

What this changes

The Control UI groups assistant responses into one navigation marker per run, preserves streaming marker identity, and aligns previews, highlights, and jumps with displayed responses.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still lacks run-level marker aggregation. No blocking correctness or security defect was found, and the inspected visual evidence supports the change. The broader related navigation request remains separate.

Priority: P3
Reviewed head: a2eea3b6f9cb23c03ebb0ed466ef98c7efe689f0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent repair with useful visual evidence and focused regressions; no actionable blocking defect was found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected dark/light Control UI captures demonstrate the changed run-preview selection using synthetic history and a mocked Gateway. They predate the rebase; reported current-head browser coverage supplements them for continuation highlighting and shared-owner jumps, while paginated Reply alignment is not separately measured.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected dark/light Control UI captures demonstrate the changed run-preview selection using synthetic history and a mocked Gateway. They predate the rebase; reported current-head browser coverage supplements them for continuation highlighting and shared-owner jumps, while paginated Reply alignment is not separately measured.
Evidence reviewed 8 items Current main still needs the aggregation: Current main selects position messages from individual groups or completed frames without aggregating them globally by run identity.
Latest release retains the older projection: The v2026.9.4 source also builds positionMessages from transcript groups and completed frames; it does not contain this run-level index.
Introduced production behavior: The new projection retains the first visible anchor, updates the preview to the latest response, maps continuations to the same marker, and excludes collapsed work. The reveal change sends the bubble offset through the existing virtualizer.
Findings None None.
Security None None.

How this fits together

The Control UI projects loaded chat history and streaming responses into a virtualized transcript. Its position rail uses that projection to preview messages, track reading position, and navigate through the existing scroll owner.

flowchart LR
  A[Loaded history] --> C[Transcript grouping]
  B[Streaming responses] --> C
  C --> D[Visible messages and run identities]
  D --> E[Position rail]
  E --> F[Latest response preview]
  E --> G[Transcript scroll owner]
  G --> H[Highlighted message]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +175, Tests +502, Docs 0. Total +677 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 16 327 152 +175
Tests 13 665 163 +502
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 30 993 316 +677

Review metrics

Metric Value Why it matters
Production versus test growth Production +327/-152 (net +175); tests +665/-163 (net +502) Production growth supports run aggregation and shared scroll ownership; regression coverage accounts for most net growth.

Technical review

Best possible solution:

Keep marker identity derived from canonical transcript runs and navigation within the existing virtualizer, with complete-session indexing handled separately.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: loaded history beginning mid-run can produce multiple assistant landmarks across tool-separated groups. The focused regression exercises that path; this review did not execute it.

Is this the best way to solve the issue?

Yes. The patch derives one index from prepared transcript visibility and uses the existing scroll owner, avoiding competing grouping or navigation implementations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a2b2391e3538.

Labels

Label justifications:

  • P3: This improves desktop chat navigation without changing message delivery, stored transcripts, or configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected dark/light Control UI captures demonstrate the changed run-preview selection using synthetic history and a mocked Gateway. They predate the rebase; reported current-head browser coverage supplements them for continuation highlighting and shared-owner jumps, while paginated Reply alignment is not separately measured.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected dark/light Control UI captures demonstrate the changed run-preview selection using synthetic history and a mocked Gateway. They predate the rebase; reported current-head browser coverage supplements them for continuation highlighting and shared-owner jumps, while paginated Reply alignment is not separately measured.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected dark/light Control UI captures demonstrate the changed run-preview selection using synthetic history and a mocked Gateway. They predate the rebase; reported current-head browser coverage supplements them for continuation highlighting and shared-owner jumps, while paginated Reply alignment is not separately measured.

Evidence

What I checked:

  • Current main still needs the aggregation: Current main selects position messages from individual groups or completed frames without aggregating them globally by run identity. (ui/src/pages/chat/components/chat-transcript-projection.ts:526, a2b2391e3538)
  • Latest release retains the older projection: The v2026.9.4 source also builds positionMessages from transcript groups and completed frames; it does not contain this run-level index. (ui/src/pages/chat/components/chat-transcript-projection.ts, 3a9d69db306c)
  • Introduced production behavior: The new projection retains the first visible anchor, updates the preview to the latest response, maps continuations to the same marker, and excludes collapsed work. The reveal change sends the bubble offset through the existing virtualizer. (ui/src/pages/chat/components/chat-position-projection.ts:22, a2eea3b6f9cb)
  • Scroll-owner dependency contract: The changed reveal directly calls TanStack Virtual's scrollToOffset. At the pinned virtual-core 3.17.8 tag, that operation replaces the index target with an absolute offset and schedules reconciliation, supporting the intended ownership repair. Repository identity and tag commit were verified through GitHub. (packages/virtual-core/src/index.ts, e9874f033c74)
  • Inspected visual proof: Inspected all four prepared images in the media manifest. Both dark and light before/after pairs visibly change the assistant preview from the initial response to the final response. The supplied body explicitly identifies these as pre-rebase real-Control-UI captures using synthetic history and a mocked Gateway; they do not independently demonstrate scrolling or streaming handoff.
  • Focused behavior coverage and review continuity: Read the projection, rail, and browser regressions covering mid-run history, hidden thinking, attachments, intervening user messages, stable streaming focus, provisional target reconciliation, and long-continuation return geometry. The captured body reports current-head validation and distinguishes historical captures, an interrupted broad launcher, and unmeasured paginated-Reply alignment. The previous review covered this same head and recorded no findings. No tests were executed during this read-only review. (ui/src/pages/chat/components/chat-position-rail.test.ts:464, a2eea3b6f9cb)

Likely related people:

  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (6 earlier review cycles)
  • reviewed 2026-09-09T17:44:24.267Z sha 961bc0933ba5832678d345916c9408925f8479ce :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T02:25:03.485Z sha 2005d2a2e77f7f2f39a6fcb6299b56e4a49e4374 :: blocked before merge. :: none
  • reviewed 2026-09-10T02:44:16.260Z sha daa88dd6efd2f6e3357457980a0ce0da6eb9c161 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-11T02:41:54.907Z sha 66e58347902d2374d339bb10946db6b022429774 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T06:52:01.132Z sha aae730b044efe32f0f5f9d6f70ab2715ef437f38 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T19:45:26.820Z sha a2eea3b :: needs maintainer review before merge. :: none

@vyctorbrzezowski
vyctorbrzezowski force-pushed the fix/chat-rail-user-turns-only branch from aae730b to a2eea3b Compare September 13, 2026 19:35
@vyctorbrzezowski
vyctorbrzezowski merged commit d534c31 into openclaw:main Sep 13, 2026
325 of 329 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski
vyctorbrzezowski deleted the fix/chat-rail-user-turns-only branch September 13, 2026 20:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
* fix(ui): group chat position markers by assistant run

* fix(ui): reuse prepared visibility for chat position markers

* test(ui): cover provisional rail target reconciliation
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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