Skip to content

feat(chat): migrate chat surface to Reactor - #1055

Merged
shanselman merged 22 commits into
openclaw:mainfrom
karkarl:karkarl-add-reactor-dependency
Jul 30, 2026
Merged

shanselman merged 22 commits into
openclaw:mainfrom
karkarl:karkarl-add-reactor-dependency

Conversation

@karkarl

@karkarl karkarl commented Jul 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR migrates the default native chat experience from FunctionalUI to a direct Microsoft.UI.Reactor surface while preserving the existing gateway/provider model and surrounding WinUI chrome.

Direct Reactor chat surface

  • ChatPage and ChatWindow mount ReactorHostControl directly into their existing XAML chat hosts.
  • OpenClawReactorChatRoot owns provider subscription, session selection, history state, composer callbacks, voice/mute state, tool-call visibility, and attachment injection.
  • The default route no longer nests Reactor under FunctionalUI.

Timeline and message presentation

  • The timeline uses keyed Reactor ItemsView + ItemContainer realization and a native AnnotatedScrollBar bound through ItemsView.VerticalScrollController.
  • Message containers are non-selectable and their container hover/selection visuals are neutralized while message-level actions remain available.
  • User and assistant bubbles follow the seeded Fluent design, with assistant-run grouping and agent identity avatar fallback.
  • Initial history tail positioning is requested after the ItemsView, its internal ScrollView, and first usable layout are ready. This preserves the behavior addressed by Fix chat scrollbar not reaching bottom during streaming via scroll anchoring #1014 without reintroducing height calculations, ChangeView, UpdateLayout, VerticalAnchorRatio, or timer-based settling.

Composer, sessions, and commands

  • The composer uses the seeded 8px Fluent card pattern: transparent input, subtle 32px controls, aligned picker chevrons, and a single accent primary action.
  • Session selection preserves history loading, uses stable item keys, and groups sessions in a scrollable flyout.
  • The / command palette restores leading-slash detection, catalog loading, grouping/filtering, keyboard selection, argument choices, and insertion.

Chat display settings

  • Removed the non-working Read responses aloud option from the main Settings page. Voice settings remain the supported location for that behavior.
  • Show tool calls and usage now synchronizes from every persisted settings save to all live Reactor chat hosts.
  • When disabled, tool-call rows, usage summaries, and hover time/model metadata are hidden. Copy and voice actions remain available.

Regression fixes

Review follow-up fixes

The Hanselman dual-model review findings with more than 90% fix confidence were applied:

  • Explicit send scroll tokens participate in the Reactor initial-tail request key.
  • Bitmap paste suppresses default text paste synchronously before asynchronous image extraction.
  • SoftwareBitmap and InMemoryRandomAccessStream are disposed after image attachment encoding.

Follow-up

A custom bottom-origin virtualizing layout and hardened streaming-follow behavior are tracked in #1054. The follow-up must preserve the annotated scrollbar controller binding while avoiding height/extent calculations, ChangeView, UpdateLayout, VerticalAnchorRatio, and timer-driven scrolling.

Validation

  • ./build.ps1 - passed
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore - 3221 passed, 31 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore - 1969 passed
  • Focused NO_REPLY coverage: 3 shared tests and 2 tray-provider tests passed.
  • Scoped code reviews for the display-settings and NO_REPLY changes: no significant issues found.

Real behavior proof

  • Current-head isolated tray preview launches successfully through run-app-local.ps1 -NoBuild -Isolated -AllowNonMain.
  • The Suppress assistant NO_REPLY chat directives #884 regression coverage proves assistant no_reply is suppressed for both live and history paths, while user no_reply is preserved.
Recording.2026-07-29.221112.mp4

Not verified / blocked

  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-arm64 --no-restore was blocked after test discovery: the ARM64 UI runner hung with no individual test output or result. A prior attempt was also blocked by a stale companion-process DLL lock.
  • Video proof for the manual scroll scenarios is not available in this session because no computer-use/video-capture tool is exposed and Local MCP Server is disabled in the isolated tray data.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 29, 2026, 3:53 PM ET / 19:53 UTC.

ClawSweeper review

What this changes

This PR migrates OpenClaw’s default native WinUI chat page and chat window from FunctionalUI to Microsoft.UI.Reactor, including the timeline, composer, session picker, display settings synchronization, and chat host lifecycle.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 5 items remain

Keep this PR open. The latest branch addresses the earlier parity and analyzer concerns, but the default native chat migration still lacks inspectable current-head real-behavior proof across the live session, streaming, scroll-away, and history-replacement paths before it can safely replace the established surface.

Priority: P2
Reviewed head: 13f31cb4ce6c559f6f349e984b23855c933bba0b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The branch shows serious implementation and test effort, but its broad default-surface change remains unready without inspectable current-head native-chat proof and a maintainer architecture decision.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The PR reports successful builds, tests, an isolated launch, and an attachment, but lacks inspectable redacted current-head evidence showing the migrated native chat behaves correctly with live sessions, streaming, scrolling, history changes, and the detached window. Please add a recording, terminal/live output, or redacted logs and screenshots, removing private endpoints, IP addresses, tokens, and user content; after updating the PR body, a fresh review should trigger automatically or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR reports successful builds, tests, an isolated launch, and an attachment, but lacks inspectable redacted current-head evidence showing the migrated native chat behaves correctly with live sessions, streaming, scrolling, history changes, and the detached window. Please add a recording, terminal/live output, or redacted logs and screenshots, removing private endpoints, IP addresses, tokens, and user content; after updating the PR body, a fresh review should trigger automatically or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current PR implementation: The branch adds the Reactor chat root, Reactor timeline, host extensions, scroll-controller binding, and command controller, then switches both the chat page and detached chat window to mount that new native surface.
Prior blockers addressed: The latest contributor update says the branch restored follow-mode handling, returning-user zero-state settling, scoped Reactor diagnostics, queued-message presentation, and dismissed slash-palette behavior after the collaborator’s re-review.
Repository policy applied: The repository AGENTS policy requires visible current-head proof for tray UX changes and a rubber-duck review before PR publication; this PR is a broad native chat UX migration and therefore needs direct runtime evidence in addition to its unit and UI test claims.
Findings None None.
Security None None.

How this fits together

The tray app receives gateway-backed chat snapshots and renders them in the native chat page or detached chat window. This PR changes the renderer and scroll/session interaction layer while retaining the existing provider, gateway, voice, and surrounding WinUI shell paths.

flowchart LR
  A[Gateway chat snapshots] --> B[Chat data provider]
  B --> C[Native chat host]
  C --> D[Reactor chat root]
  D --> E[Timeline and composer]
  E --> F[Session selection and user actions]
  F --> G[Gateway commands and messages]
Loading

Decision needed

Question Recommendation
Should OpenClaw adopt Microsoft.UI.Reactor preview as the default native chat renderer once the branch supplies direct current-head runtime proof for the preserved chat interaction contracts? Validate and continue the migration: Require redacted current-head native-chat evidence for the critical session and scrolling paths, then review the Reactor default as the intended architecture.

Why: This is an architectural and dependency-direction choice affecting the default user-facing chat surface, not a narrow mechanical repair that automated review can safely decide.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR reports successful builds, tests, an isolated launch, and an attachment, but lacks inspectable redacted current-head evidence showing the migrated native chat behaves correctly with live sessions, streaming, scrolling, history changes, and the detached window. Please add a recording, terminal/live output, or redacted logs and screenshots, removing private endpoints, IP addresses, tokens, and user content; after updating the PR body, a fresh review should trigger automatically or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Replacing the default native chat renderer can regress existing users’ session selection, history positioning, stream-follow behavior, scroll-away intent, or detached-window parity even when unit and source-contract tests pass.
  • Resolve merge risk (P1) - The new renderer depends on a preview Reactor package and changes 43 files, so maintainers need current-head runtime evidence before accepting compatibility and session-state risk.
  • Complete next step (P2) - A maintainer must decide whether the default native chat should move to the preview Reactor renderer after reviewing direct current-head behavior proof; automation cannot supply evidence from the contributor’s live setup.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Migration scope 43 files affected; 4,764 added, 604 removed The PR replaces the default native chat renderer and touches its host, session, timeline, settings, tests, and dependency configuration.
Runtime proof coverage 0 inspectable current-head critical-path demonstrations Reported builds and tests do not directly establish preserved behavior for the live chat interaction paths most changed by the migration.

Root-cause cluster

Relationship: canonical
Canonical: #1055
Summary: This PR is the central native-chat renderer migration; the remaining specialized tail-follow and bottom-origin layout work is separately tracked.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Require native-chat proof before merge (recommended)
    Attach redacted current-head runtime evidence covering session selection, history positioning, streaming follow, scroll-away, and detached-window behavior before approving the default renderer switch.
  2. Defer the default renderer change
    Pause or narrow the migration if maintainers do not want to accept preview-dependency and existing-session compatibility risk without broader live validation.

Technical review

Best possible solution:

Keep the existing provider and gateway contracts, but land the Reactor surface only after a redacted current-head native-chat proof run demonstrates session selection, initial history position, streaming follow, scroll-away, history prepend/replacement, slash commands, and detached-window behavior.

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

Not applicable as a bug reproduction. The branch is an architectural migration; the relevant question is whether its changed native-chat behavior has been demonstrated against a current-head real session, which is not yet inspectably shown.

Is this the best way to solve the issue?

Unclear. Migrating the surface directly to Reactor may be maintainable, but the branch needs direct runtime parity proof and maintainer approval of the default-renderer and preview-dependency direction before it is the best supported solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c04c5fb06238.

Labels

Label justifications:

  • P2: This is a substantial user-facing native chat migration with meaningful but not currently demonstrated release-blocking impact.
  • merge-risk: 🚨 compatibility: Changing the default WinUI chat renderer and adding a preview rendering dependency can alter established chat behavior for existing installations.
  • merge-risk: 🚨 session-state: The new session picker, history revision flow, selected-session handling, and scroll restoration can affect users’ live conversation state and navigation.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR reports successful builds, tests, an isolated launch, and an attachment, but lacks inspectable redacted current-head evidence showing the migrated native chat behaves correctly with live sessions, streaming, scrolling, history changes, and the detached window. Please add a recording, terminal/live output, or redacted logs and screenshots, removing private endpoints, IP addresses, tokens, and user content; after updating the PR body, a fresh review should trigger automatically or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR reports successful builds, tests, an isolated launch, and an attachment, but lacks inspectable redacted current-head evidence showing the migrated native chat behaves correctly with live sessions, streaming, scrolling, history changes, and the detached window. Please add a recording, terminal/live output, or redacted logs and screenshots, removing private endpoints, IP addresses, tokens, and user content; after updating the PR body, a fresh review should trigger automatically or a maintainer can request @clawsweeper re-review.

Evidence

What I checked:

  • Current PR implementation: The branch adds the Reactor chat root, Reactor timeline, host extensions, scroll-controller binding, and command controller, then switches both the chat page and detached chat window to mount that new native surface. (src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs, 13f31cb4ce6c)
  • Prior blockers addressed: The latest contributor update says the branch restored follow-mode handling, returning-user zero-state settling, scoped Reactor diagnostics, queued-message presentation, and dismissed slash-palette behavior after the collaborator’s re-review. (src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs, 13f31cb4ce6c)
  • Repository policy applied: The repository AGENTS policy requires visible current-head proof for tray UX changes and a rubber-duck review before PR publication; this PR is a broad native chat UX migration and therefore needs direct runtime evidence in addition to its unit and UI test claims. (AGENTS.md:1)
  • Proof remains insufficient: The PR body reports builds, tests, an isolated launch, and an attachment, but it does not provide inspectable redacted evidence demonstrating the highest-risk changed paths on the current head: real signed-in session selection, streaming tail follow, scroll-away preservation, history prepend/replacement, and detached-window behavior. (13f31cb4ce6c)
  • Scope and compatibility surface: The PR changes 43 files with 4,764 additions and 604 deletions, replaces the default native renderer, and changes session/history and settings interaction paths. That is too broad to treat test totals alone as upgrade proof. (src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs, 13f31cb4ce6c)

Likely related people:

  • karkarl: Previously delivered the merged chat scrolling work that this migration must preserve, and authored the current Reactor migration and follow-up parity fixes. (role: prior merged feature contributor; confidence: high; commits: daa34d5b80b4, 13f31cb4ce6c; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs, src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs)
  • shanselman: Performed the detailed parity re-review, tested against signed-in session data, and added the focused session-picker correction on this branch. (role: reviewer and recent area contributor; confidence: high; commits: b8822f9a046a; files: src/OpenClaw.Tray.WinUI/Services/SessionVisibilityFilter.cs, src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach a redacted current-head recording or live diagnostics for the real signed-in session, stream-follow, scroll-away, history prepend/replacement, slash palette, and detached window.
  • Have the likely owners confirm whether a preview Reactor dependency is acceptable as the default native chat surface after reviewing that evidence.

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 (7 earlier review cycles)
  • reviewed 2026-07-25T00:30:38.245Z sha 2c7fc5b :: needs real behavior proof before merge. :: [P2] Avoid suppressing Reactor accessibility diagnostics project-wide
  • reviewed 2026-07-25T05:05:08.095Z sha b515013 :: needs real behavior proof before merge. :: [P2] Scope Reactor diagnostic suppression to legacy surfaces
  • reviewed 2026-07-25T05:46:33.757Z sha b515013 :: needs real behavior proof before merge. :: [P2] Scope Reactor diagnostic suppression to legacy surfaces
  • reviewed 2026-07-27T19:58:58.244Z sha b8822f9 :: needs real behavior proof before merge. :: [P2] Scope Reactor warning suppression to legacy surfaces
  • reviewed 2026-07-28T02:47:02.249Z sha 2a42ffe :: needs real behavior proof before merge. :: [P1] Remove the privileged dispatch workflow from this chat PR | [P2] Scope Reactor warning suppression to legacy surfaces
  • reviewed 2026-07-28T04:09:42.502Z sha 1adc52b :: needs real behavior proof before merge. :: [P1] Remove the privileged dispatch workflow from this chat PR | [P2] Do not suppress Reactor diagnostics project-wide
  • reviewed 2026-07-29T19:23:34.750Z sha 13f31cb :: needs real behavior proof before merge. :: none

@karkarl

karkarl commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator Author

Hanselman review follow-up

Two independent reviews found no overlapping issue, but we accepted and fixed the three high-confidence findings:

  1. Explicit send-to-latest: the Reactor timeline's initial-tail request key now includes ScrollToBottomToken, so a successful send issues a supported tail bring request.
  2. Image paste suppression: the paste handler now synchronously checks for a bitmap and sets Handled before awaiting extraction, preventing default text paste from being inserted alongside an image attachment.
  3. Native image resource cleanup: SoftwareBitmap and InMemoryRandomAccessStream are now disposed via using declarations.

Validation after the fixes:

  • ./build.ps1
  • Shared tests: 3221 passed, 31 skipped
  • Tray tests: 1961 passed
  • ARM64 UI suite initially hit two order-dependent accessibility fixture failures; both pass in isolated reruns.

The remaining lower-confidence review findings were deliberately not changed in this pass.

@karkarl
karkarl marked this pull request as ready for review July 25, 2026 05:13
steipete and others added 2 commits July 26, 2026 18:53
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 7b9bc681-ce19-4a8b-b06c-94efb63a5f9f
@shanselman

Copy link
Copy Markdown
Collaborator

Hi @karkarl, I pushed a focused session-picker fix onto this branch after testing the PR against real signed-in session data.

The picker was using done/ended status as its visibility rule. That hid useful completed chats while leaving idle zero-usage sessions with unknown status in the menu. It now keeps the selected session and sessions with actual activity or token usage regardless of lifecycle status, while the existing presentation policy continues to hide background sessions.

Validation on the pushed head:

  • ./build.ps1: passed
  • Shared tests: 3,221 passed, 31 skipped
  • Tray tests: 1,961 passed
  • Signed-in UI proof: completed chats appeared in the picker; idle zero-usage placeholders were absent
  • Rubber-duck review: no blocking or high-confidence issues remain

The tests also cover completed chats, working sessions, input/output/total token signals, selected empty sessions, and context-capacity-only placeholders.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Jul 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 28, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

Re-review against current head 1adc52be, merged locally with current main for validation.

The earlier session-picker, slash-command, display-settings, and NO_REPLY issues are fixed. The ClawSweeper privileged-dispatch-workflow finding is stale: .github/workflows/clawsweeper-dispatch.yml is not in the authoritative origin/main...HEAD net diff.

I still do not think this is merge-ready:

  1. Streaming tail-follow and scroll-away intent were not migrated. ReactorChatTimeline only changes its tail request key for session/generation/history replacement or an explicit-send ScrollToBottomToken. Incremental assistant streaming has no follow-mode state, and the new controller has no user scroll-away gate. The legacy production timeline preserves both invariants. Issue Add a bottom-origin virtualizing chat layout #1054 explicitly lists their restoration as acceptance criteria, so merging this PR would knowingly ship the regression rather than merely defer an enhancement. History replacement also reissues a tail bring instead of preserving prepend position.
  2. The returning-user zero-state settling guard was dropped. The legacy root waits for welcome eligibility to remain stable before showing suggestions, specifically to prevent a flash during reconnect/session materialization. The Reactor root renders empty mode immediately from entries.Count == 0, which reintroduces that race.
  3. The global Reactor suppression hides defects in the newly migrated production code. Rebuilding without the four suppressed codes reports REACTOR_A11Y_002 in ReactorChatTimeline.cs at the empty-state and assistant-avatar images (lines 334 and 521), plus REACTOR_THEME_004 at lines 709 and 728. The suppression therefore is not limited to unrelated legacy surfaces.

Two smaller parity gaps are also worth fixing while this is open: queued messages lost their bounded scroll region and polite live-region summary, and a command-catalog refresh can reopen a slash palette that the user dismissed while the input still begins with /.

Current-main merged validation passed:

  • ./build.ps1
  • Shared: 3,221 passed, 31 skipped
  • Tray: 1,970 passed

Recommendation: hold for the three numbered fixes plus direct runtime coverage for initial tail, streaming follow, scroll-away, and history replacement. Confidence: 95%.

@karkarl

karkarl commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

@shanselman Thanks for the detailed re-review. The identified issues are now resolved on the PR head:

  1. Native ItemsView tail follow now uses the public inner ScrollView and ItemsView.TryGetItemIndex to determine the bottom visible item, with VerticalAnchorRatio updated only when follow state changes. Initial load and explicit sends retain one-shot StartBringItemIntoView; history prepends no longer force a tail request.
  2. 128c583d restores the returning-user zero-state settle guard with an eligibility-keyed 800 ms authorization, including stale-timer and null-key race protection.
  3. 13f31cb4 removes project-wide Reactor NoWarn, scopes legacy imperative-surface exceptions by file, and fixes the direct Reactor timeline accessibility/theme diagnostics.

Also addressed: 960dd6e2 restores bounded, polite queued-message presentation; b99a7f25 keeps a dismissed slash palette closed across catalog refreshes.

Current validation: build passed; shared 3,221 passed / 31 skipped; tray 1,972 passed; ARM64 UI 117 passed. The full UI run had one order-sensitive ChatPage clickable-point scan failure, and its isolated accessibility rerun passed all 18 scans.

@karkarl

karkarl commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Native follow-tail architecture

The follow-tail implementation avoids synthetic timeline rows, ElementRef, custom virtualizing layouts, extent calculations, ChangeView, UpdateLayout, and settle timers.

  • ItemsView continues to own keyed ItemContainer realization and virtualization unchanged.
  • The public ItemsView.ScrollView is the scroll owner. On ViewChanged, ItemsView.TryGetItemIndex(0.5, 1.0, out bottomIndex) identifies the item at the viewport's bottom edge.
  • Follow mode is true only when bottomIndex reaches the current transcript tail. Entering/leaving that state applies ScrollView.VerticalAnchorRatio = 1.0 or double.NaN once.
  • Initial history and explicit sends use one non-animated StartBringItemIntoView(lastIndex, VerticalAlignmentRatio = 1.0) request. History prepends do not request a tail bring, preserving the reader's native anchor.
  • The bound AnnotatedScrollBar remains the ItemsView.VerticalScrollController; its navigation drives the same public inner ScrollView lifecycle.

This is based on the documented ItemsView/ScrollView extension points and preserves virtualization rather than observing or modifying a virtualized template row.

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. and removed merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Jul 29, 2026
@karkarl

karkarl commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Native ItemsView follow-tail architecture

flowchart TB
    Provider["OpenClawChatDataProvider<br/>timeline entries, generation, history revision"]
    Root["OpenClawReactorChatRoot<br/>timeline props and explicit send token"]
    Timeline["ReactorChatTimeline<br/>keyed ItemsView plus ItemContainer rows"]
    Decorator["ItemsViewVerticalScrollControllerElement<br/>Reactor decorator handler"]

    subgraph Native["Native ItemsView composition"]
        IV["ItemsView<br/>StackLayout virtualization"]
        SV["ItemsView.ScrollView<br/>public loaded template part"]
        SP["ScrollPresenter<br/>owned by ScrollView"]
        ASC["AnnotatedScrollBar<br/>IScrollController source"]
    end

    subgraph Policy["Follow policy"]
        Bring["StartBringItemIntoView<br/>tail index, non-animated<br/>VerticalAlignmentRatio = 1.0"]
        Index["TryGetItemIndex(0.5, 1.0)<br/>bottom visible item"]
        Follow["following: true<br/>VerticalAnchorRatio = 1.0"]
        Reading["following: false<br/>VerticalAnchorRatio = NaN"]
    end

    Provider --> Root --> Timeline --> Decorator --> IV
    IV --> SV --> SP
    ASC -->|"AnnotatedScrollBar.ScrollController"| IV
    Decorator -->|"VerticalScrollController"| ASC
    Root -->|"initial history or explicit send"| Bring --> IV
    SV -->|"ViewChanged"| Index
    Index -->|"bottom index reaches tail"| Follow --> SV
    Index -->|"bottom index precedes tail"| Reading --> SV
Loading
Native surface API Responsibility
Reactor ItemsView and keyed ItemContainer Owns virtualization, realization, recycling, and stable row identity.
ItemsView VerticalScrollController Binds the external scrollbar controller to the native list.
AnnotatedScrollbar ScrollController Provides thumb/track navigation through the same inner scrolling pipeline.
ItemsView ScrollView Public access to the loaded inner native scroll owner.
ScrollView ViewChanged Triggers native viewport-state evaluation after scrolling.
ItemsView TryGetItemIndex(0.5, 1.0, out bottomIndex) Maps the bottom-center of the viewport to a virtualized item index without realizing or observing template rows.
ScrollView VerticalAnchorRatio Native persistent bottom pin: 1.0 while following, NaN while reading history.
ItemsView StartBringItemIntoView One-shot initial-history and explicit-send placement, using non-animated VerticalAlignmentRatio = 1.0.

The design intentionally adds no synthetic sentinel row, ElementRef, custom layout, extent calculation, ChangeView, UpdateLayout, or settle timer. ItemsView continues to own virtualization, ScrollView owns scrolling/anchoring, and AnnotatedScrollBar supplies navigation input through the same native scroll pipeline.

@shanselman

Copy link
Copy Markdown
Collaborator

Maintainer decision: I reviewed the current-head attached video and accept it as proof of the connected Reactor chat surface handling a long live stream with tail following. I also validated the exact latest-main integration locally: conflict-free merge, full build, Shared 3,399 passed / 32 skipped, and Tray 2,022 passed after restoring the merged dependency graph. Independent review found no code blocker; the remaining session-switch and detached-window lifecycle risk is accepted for landing.

@shanselman
shanselman merged commit 9acafa6 into openclaw:main Jul 30, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. P2 Normal priority bug or improvement with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants