Repository navigation
Commit 84ceee1
Rebuild Debug page as task-oriented Diagnostics page (rebased on single-app-model)
Replaces the legacy raw-Expander Debug page with a Fluent-style
"Diagnostics" surface composed of CommunityToolkit SettingsCard /
SettingsExpander, an in-page detail view, and a preview-then-share
diagnostics bundle dialog. The internal route stays Tag="debug" so
every existing command-palette / deep-link alias keeps working.
Rebased onto Ranjesh's single-app-model branch
(user/ranjeshj/singleappmodel). The page now observes AppState
directly per docs/DATA_FLOW_ARCHITECTURE.md and routes user
intents through IAppCommands — no HubWindow dependency:
- DebugPage.Initialize() takes no arguments; pulls AppState +
ConnectionManager from ((App)Application.Current) and
subscribes to AppState.PropertyChanged for live Status /
GatewaySelf updates.
- "Manage on Connection page" hyperlink calls
((IAppCommands)CurrentApp).Navigate("connection").
- "Reconfigure..." confirmation calls
((IAppCommands)CurrentApp).ShowOnboarding() after the
ContentDialog returns Primary.
- Diagnostics-bundle preview pulls the GatewayCommandCenterState
via App.BuildCommandCenterState() (made internal so pages can
call it without the now-deleted HubWindow.GetCommandCenterStateAction).
- DiagnosticsBundleDialog gets its parent HWND via the new
App.GetHubWindowHandle() (mirrors App.GetOnboardingWindowHandle).
- AboutPage.OnCopySupportClick unifies on the same BuildCommandCenterState
path; "More diagnostics ->" hyperlink uses IAppCommands.Navigate("debug").
## Page
- Renames the nav-item label "Debug" -> "Diagnostics" (resw
HubWindow_NavigationViewItem_145.Content). The Tag, route table,
and command palette aliases ("debug", "connectionstatus", "log",
"supportcontext", "debugbundle", "browsersetup", "portdiagnostics",
"capabilitydiagnostics") are unchanged.
- Three task-oriented sections instead of an inventory of features:
1. Share diagnostics with support — primary "Create diagnostics
bundle" SettingsCard opens a preview ContentDialog (Copy /
Save to file / Close). Four previously invisible
diagnostic-text commands (debug bundle, browser setup, port
diagnostics, capability diagnostics) are surfaced behind a
"Copy specific diagnostic text" SettingsExpander.
2. Inspect local diagnostics — Connection event timeline +
Recent log cards (both open the new in-page detail view),
plus a Device identity SettingsExpander with click-to-copy
Device ID and Public key.
3. Developer tools — Warning InfoBar, Chat surface overrides
SettingsExpander, Open chat explorations, and Reconfigure...
(canonical verb per naming.md) with ContentDialog
confirmation.
- All cards live in a single centered Width=900 StackPanel so the
title block and cards share the exact same column and left edge.
## In-page detail view
- Replaces the separate ConnectionStatusWindow entry on this page
with an in-page detail view that swaps in via Visibility, matching
ConnectionPage.AddGatewayPanel.
- Two modes share a single RichTextBlock body:
- Timeline — subscribes to ConnectionDiagnostics.EventRecorded
and renders live state-machine / websocket / handshake /
credential events with the same direction-arrow + category
tag + severity coloring used by ConnectionStatusWindow.
- Log — reads the last 200 lines of openclaw-tray.log and
colors each line by severity ([info]/[warn]/[error]/[debug]/
[trace] + legacy uppercase forms) with the timestamp prefix
rendered dim.
- Both modes resolve their severity brushes from system theme
tokens (SystemFillColorCritical/Caution/Attention/Success +
TextFillColorSecondary) so the colors track light/dark/HC.
## Design-reference compliance (docs/design/*)
- Eight new Segoe Fluent Icons constants in FluentIconCatalog
(Bug, Briefcase, Folder, Copy, Document, Refresh, Clear,
Develop), pinned in FluentIconCatalogTests, used via
{x:Bind helpers:FluentIconCatalog.X, Mode=OneTime}.
- Canonical "Reconfigure..." verb (with ellipsis) per naming.md.
## Hanselman dual-model review fixes (Opus + Codex consensus)
- #1 OnNavigatedFrom + Unloaded both unsubscribe the
ConnectionDiagnostics.EventRecorded handler so the page can no
longer leak its subscription when the user navigates away.
- #2 ReadLogTail uses FileStream with FileShare.ReadWrite to
coexist with Logger.cs:109's active writer; the previous
File.ReadLines silently failed on every Logger-active read.
- #3 Timeline subscribes before snapshotting and dedupes via
HashSet<ConnectionDiagnosticEvent> (records use value equality)
so events arriving during the snapshot/subscribe window are not
dropped.
- #4 Log tail reads on a background thread via Task.Run so a
large rotated log doesn't stall the UI thread.
- #5 RichTextBlock.Blocks + plain-text Queue<string> mirror are
capped at MaxTimelineRows=500 (matches ConnectionDiagnostics
capacity).
- #6 DiagnosticsBundleDialog.OnSaveClick drops the dead
GetDeferral/ContinueWith path; the dialog stays open after
Save (mirrors Copy).
## Wiring
- App.BuildCommandCenterState() is now `internal` so pages can
pull the GatewayCommandCenterState directly without going
through HubWindow.
- App.GetHubWindowHandle() new helper for parenting file pickers
from in-Hub pages (mirrors GetOnboardingWindowHandle).
- HubWindow loses GetCommandCenterStateAction (was only used for
the now-removed forwarding chain).
## Tests
- DiagnosticsPageContractTests (17 source-level guards) updated
for the new pattern: asserts CurrentApp / AppState observation,
no HubWindow dependency, Width=900 column, and BuildCommandCenterState
internal accessor.
- FluentIconCatalogTests.ExpectedConstants extended with the eight
new constants.
- Required validation per AGENTS.md is green:
./build.ps1 -> all four projects build
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore -> 1620 passed, 28 skipped
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore -> 984 passed
Co-authored-by: Copilot <[email protected]>1 parent 4ab640f commit 84ceee1
13 files changed
Lines changed: 1734 additions & 288 deletions
File tree
- src/OpenClaw.Tray.WinUI
- Helpers
- Pages
- Strings/en-us
- Windows
- tests/OpenClaw.Tray.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
193 | 208 | | |
194 | 209 | | |
195 | 210 | | |
| |||
2584 | 2599 | | |
2585 | 2600 | | |
2586 | 2601 | | |
2587 | | - | |
2588 | | - | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
2589 | 2615 | | |
2590 | 2616 | | |
2591 | 2617 | | |
| |||
2745 | 2771 | | |
2746 | 2772 | | |
2747 | 2773 | | |
2748 | | - | |
| 2774 | + | |
2749 | 2775 | | |
2750 | 2776 | | |
2751 | 2777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
102 | 116 | | |
103 | 117 | | |
| 118 | + | |
104 | 119 | | |
105 | 120 | | |
106 | 121 | | |
| |||
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
| |||
0 commit comments