Repository navigation
feat(chat): migrate chat surface to Reactor - #1055
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 29, 2026, 3:53 PM ET / 19:53 UTC. ClawSweeper reviewWhat this changesThis 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 Review scores
Verification
How this fits togetherThe 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]
Decision needed
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
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Hanselman review follow-upTwo independent reviews found no overlapping issue, but we accepted and fixed the three high-confidence findings:
Validation after the fixes:
The remaining lower-confidence review findings were deliberately not changed in this pass. |
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7b9bc681-ce19-4a8b-b06c-94efb63a5f9f
|
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 Validation on the pushed head:
The tests also cover completed chats, working sessions, input/output/total token signals, selected empty sessions, and context-capacity-only placeholders. |
…add-reactor-dependency
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
|
Re-review against current head The earlier session-picker, slash-command, display-settings, and I still do not think this is merge-ready:
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:
Recommendation: hold for the three numbered fixes plus direct runtime coverage for initial tail, streaming follow, scroll-away, and history replacement. Confidence: 95%. |
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
|
@shanselman Thanks for the detailed re-review. The identified issues are now resolved on the PR head:
Also addressed: 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. |
Native follow-tail architectureThe follow-tail implementation avoids synthetic timeline rows,
This is based on the documented ItemsView/ScrollView extension points and preserves virtualization rather than observing or modifying a virtualized template row. |
Native ItemsView follow-tail architectureflowchart 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
The design intentionally adds no synthetic sentinel row, |
|
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. |
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
ChatPageandChatWindowmountReactorHostControldirectly into their existing XAML chat hosts.OpenClawReactorChatRootowns provider subscription, session selection, history state, composer callbacks, voice/mute state, tool-call visibility, and attachment injection.Timeline and message presentation
ItemsView+ItemContainerrealization and a nativeAnnotatedScrollBarbound throughItemsView.VerticalScrollController.ItemsView, its internalScrollView, 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
/command palette restores leading-slash detection, catalog loading, grouping/filtering, keyboard selection, argument choices, and insertion.Chat display settings
Regression fixes
NO_REPLYand lowercaseno_replyare suppressed from gateway live events and history hydration before the Reactor provider renders them. Literal user messages remain visible.ItemsViewlifecycle.Review follow-up fixes
The Hanselman dual-model review findings with more than 90% fix confidence were applied:
SoftwareBitmapandInMemoryRandomAccessStreamare 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- passeddotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore- 3221 passed, 31 skippeddotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore- 1969 passedNO_REPLYcoverage: 3 shared tests and 2 tray-provider tests passed.NO_REPLYchanges: no significant issues found.Real behavior proof
run-app-local.ps1 -NoBuild -Isolated -AllowNonMain.no_replyis suppressed for both live and history paths, while userno_replyis preserved.Recording.2026-07-29.221112.mp4
Not verified / blocked
dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-arm64 --no-restorewas 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.