Mirror connection status dot onto lobster tray and desktop icons - #945
Conversation
Compose the lobster mascot with a coloured status dot in its bottom-right corner (green=connected, amber=connecting/attention, red=error, gray= disconnected), mirroring the companion-app HubWindow status pill onto both the tray icon and the desktop/taskbar window icon. - Add StatusBadgeIconFactory: builds cached multi-resolution .ico files per status accent by badging the unplated lobster PNG; thread-safe, falls back to the plain app icon on failure without pinning the fallback in cache. - Add ConnectionStatusPresenter.Accent() so tray and window derive the same accent used by the visible status pill. - Wire TrayIconCoordinator and HubWindow (both UpdateTitleBarStatus overloads and initial setup) to apply the badged icon; initialise the tray icon with the badged neutral lobster from first paint. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The dot diameter now interpolates from 44%% of the icon on tiny tray icons (<=32px, for legibility) down to 26%% on large taskbar / alt-tab icons (>=256px, a subtler corner dot), instead of a fixed 44%%. The white ring is tied to the dot so it shrinks proportionally. Adds DotFraction(size) with a unit test covering the scaling curve. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 7:53 PM ET / 23:53 UTC. Summary Reproducibility: not applicable. this is a new tray/HubWindow visual feature, not a broken existing behavior report. Source inspection confirms current main lacks the badged-icon behavior this PR adds. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the focused implementation path, but require an accessible current-head Windows screenshot or video showing the tray and taskbar/HubWindow icon behavior under the latest attention-only badge policy before merge. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a new tray/HubWindow visual feature, not a broken existing behavior report. Source inspection confirms current main lacks the badged-icon behavior this PR adds. Is this the best way to solve the issue? Yes for the implementation shape: it reuses ConnectionStatusPresenter accents and keeps the behavior scoped to tray and HubWindow icons. The remaining blocker is accessible real Windows proof, not a better code path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 02f2421a5e75. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (3 earlier review cycles) |
Per group feedback a constant green connected dot is distracting. The tray and desktop icons now show a status badge only for attention states: - disconnected / neutral -> grey dot - error -> red dot with a white minus (-) glyph Connected and connecting render the plain lobster with no badge. - StatusBadgeIconFactory.ShouldBadge()/HasDash() encode the policy; Compose takes a nullable dot colour (null = plain lobster) and an optional dash. - Update StatusBadgeIconFactoryTests for the new policy and dash rendering. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
shanselman
left a comment
There was a problem hiding this comment.
Reviewed and live-tested with >90% confidence. CI is green, local build passed, generated icon tests cover badge policy/ICO composition, and maintainer visually confirmed the live tray/taskbar icon behavior on current head.
Summary
Surfaces the gateway connection status on the lobster tray icon and desktop/taskbar (HubWindow) icon as a small badge in the bottom-right corner.
Per group feedback (a constant green "connected" dot is distracting), the badge only appears for attention states:
How it works
StatusBadgeIconFactorycomposes the unplated lobster PNG with the badge into cached, multi-resolution.icofiles (16–256px) — written to%TEMP%\OpenClawTray\StatusIcons. BothTrayIcon.SetIcon(path)andWindow.SetIcon(path)consume them.ShouldBadge()(neutral/critical only) andHasDash()(critical only).Compose()takes a nullable dot colour —nullrenders the plain lobster — plus an optional white minus glyph for the error state.ConnectionStatusPresenter.Accent(overall, status)centralises the accent selection so the tray and desktop icons always agree with the visible HubWindow status pill.TrayIconCoordinator.UpdateTrayIconandHubWindow(bothUpdateTitleBarStatusoverloads + initial setup) apply the icon; the tray icon starts on the neutral (disconnected) badge. The existing_isAlive()guard beforeSetIconis preserved.Other transient windows (dialogs, ChatWindow, CanvasWindow, ConnectionStatusWindow) intentionally keep the static
openclaw.ico.Validation
All required AGENTS.md closeout checks pass on this branch head:
./build.ps1— ✅ all projects built (Shared, Cli, WinNodeCli, SetupEngine, WinUI)dotnet test ./tests/OpenClaw.Shared.Tests— ✅ 2697 passed, 31 skippeddotnet test ./tests/OpenClaw.Tray.Tests— ✅ 1613 passedNew/updated tests (
StatusBadgeIconFactoryTests): dot colour mapping, badge policy (ShouldBadgeneutral/critical only,HasDashcritical only), bottom-right dot placement, plain-lobster rendering for healthy states, red-dot-with-white-dash for error, per-accent colour distinction, size-scaling curve (DotFraction), valid multi-size ICO (badged + plain), tray/taskbar size coverage. PlusConnectionStatusPresenterTests(Accent()overall-state preference / legacy fallback) andAppRefactorContractTests(tray + HubWindow wiring; liveness-guard-before-SetIcon contract preserved).A rubber-duck review was run earlier; both findings were fixed (initial tray icon starts badged; fallback path is not cached after a transient failure).
Real behavior proof
The four states were rendered directly from the shipping
StatusBadgeIconFactorybadge policy on the real lobster asset, at both 256px (taskbar/alt-tab) and 32px (tray) sizes: disconnected shows a grey dot, connecting/connected show the plain lobster, and error shows a red dot with a white minus — legible at both sizes. Proof image is attached in the session artifacts (status-badge-proof.png).Live running-app proof: current PR head was built locally and launched against the maintainer normal OpenClaw profile (
OPENCLAW_TRAY_DATA_DIR=%APPDATA%\OpenClawTray) with the Hub opened to Connection. Maintainer visually confirmed the live tray/taskbar icon behavior looks good: connected/connecting shows the plain lobster with no badge, and the updated attention-state badge policy is acceptable.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com