Repository navigation
refactor(tray): extract Hub and tray presentation models - #1082
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 5:29 PM ET / 21:29 UTC. ClawSweeper reviewWhat this changesThis PR moves Hub navigation, notification-banner, and tray-menu presentation policy into WinUI-free, tested components while keeping WinUI rendering and application actions in their existing layers. Merge readinessKeep open. Current main does not contain the extracted Hub or tray presentation owners, and this actively landing collaborator PR remains the coherent implementation for that layer with no confirmed patch defect. Priority: P2 Review scores
Verification
How this fits togetherCached connection, session, settings, and notification state feeds the tray menu and Hub. The new presentation layer converts that state into menu, route, search, and banner decisions before WinUI applies controls and the App performs actions. flowchart LR
A[Cached connection, session, and settings state] --> B[Tray snapshot]
B --> C[Tray presentation]
C --> D[WinUI tray menu]
E[Hub routes, search, and notifications] --> F[Hub presentation registry]
F --> G[Hub window controls]
D --> H[App actions and persisted settings]
G --> H
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the A1 presentation layer only after the current-head integration checks remain clean, preserving one semantic source for tray and Hub behavior and leaving WinUI mechanics in the renderer and views. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor rather than a reported defect. Current-head isolated runtime and UI Automation proof exercise the changed tray and Hub paths. Is this the best way to solve the issue? Yes. The split keeps pure semantic projection in tested presentation owners while retaining WinUI control construction and App-side effects at their established boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f4e1cf3a9894. 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)
|
53006e8 to
a69043d
Compare
a69043d to
b77dfba
Compare
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 529161b9-67ce-4fde-98b4-c96d8991faff
Current-head UI proofRe-launched a single fresh isolated tray instance from Sessions presentationPermissions presentationHub routing and capability gatingThe fresh instance was the only running |
b77dfba to
8438930
Compare



Establishes WinUI-free, behavior-tested presentation owners for Hub navigation/search, notification banners, and the complete tray menu. This is layer 2 of the App architecture stack and depends on #1075.
What changed
HubPageRegistryas the single owner of Hub tag aliases, page mapping, command metadata/order/search, and gateway back-prune classification.AppNotificationInfoBarPresenterfor Warning/Error banner selection, semantic severity, action-vs-Show-more projection, and current-page action state.TrayMenuPresentation/TrayMenuPresenterplusConnectionTogglePresenteras the only owners of tray semantic presence, ordering, text, actions, enabled/checked state, accelerators, and accessibility names.TrayMenuRendereras the mechanical WinUI control/resource/callback applicator.TrayMenuStateBuilderand remove duplicate semantic paths from Hub/App tray rendering.TrayMenuWindowWin32 positioning/focus/light-dismiss ownership and App action/lifetime orchestration.Ownership transfer
HubWindowinline page/command/banner policy andTrayMenuStateBuildermixed presentation/render logic.HubPageRegistry,AppNotificationInfoBarPresenter,TrayMenuPresenter, andConnectionTogglePresenter.HubWindowretains Frame/NavView/back-stack/control/route application;TrayMenuRendererandTrayMenuWindowretain WinUI and Win32 mechanics; App remains the composition/action owner.Validation
./build.ps1: all projects passedOpenClaw.Shared.Tests: 3,415 passed, 32 skipped, 0 failedOpenClaw.Tray.Tests: 2,187 passed, 0 skipped, 0 failedgit diff --cached --check: clean before commitReal behavior proof
Current-head isolated App ran with local MCP on port 8766.
app.navigate,app.menu, andapp.search.app.navigate {"page":"permissions"}and the legacycapabilitiesalias both returnednavigated=true.app.menureturned the current disconnected/idle state with zero sessions and nodes.HubPageRegistrycharacterization tests; this isolated runtime had no search-result data and returned[].Right-click popup and deterministic runtime InfoBar triggering were not automation-addressable on this host because the controller lacked computer-use and SendInput was rejected by UIPI. Complete menu/flyout/toggle and InfoBar state matrices are covered by pure presentation, source-contract, and accessibility tests.
UI media proof
Not verified / blocked: no screenshot or video is published for exact head
a69043d08c239d926117c37647d558a3c7ec3d9b. Crabbox is not installed in the approved local paths, and this RDP session has no computer-use or GitHub attachment uploader. No blank or unverifiable frame was published.Manual capture steps:
bkudiess-presentation-modelsand verifygit rev-parse HEADequalsa69043d08c239d926117c37647d558a3c7ec3d9b.$env:OPENCLAW_TRAY_PREVIEW_DATA='1', then run.\run-app-local.ps1 -Isolated -AllowNonMain.OPENCLAW_TRAY_PREVIEW_DATA=1, save the draft body, and verify the rendered image URL resolves.Review
AbortedLastRunpreservation and a full snapshot/build-path regression test were added.a69043d08c239d926117c37647d558a3c7ec3d9bfound no significant issues with 92% confidence and confirmed the A1 ownership boundary and A0 Permissions lifecycle remain preserved.Deferred work
ITrayControllerandIWindowManagerownership move in the next stack layer.