Skip to content

Mirror connection status dot onto lobster tray and desktop icons - #945

Merged
shanselman merged 3 commits into
openclaw:mainfrom
karkarl:karkarl-tray-icon-status-dot
Jul 9, 2026
Merged

Mirror connection status dot onto lobster tray and desktop icons#945
shanselman merged 3 commits into
openclaw:mainfrom
karkarl:karkarl-tray-icon-status-dot

Conversation

@karkarl

@karkarl karkarl commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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:

  • disconnected / neutral → a grey dot
  • 🔴 error → a red dot with a white (minus) glyph
  • connected / connecting → the plain lobster, no badge

How it works

  • New StatusBadgeIconFactory composes the unplated lobster PNG with the badge into cached, multi-resolution .ico files (16–256px) — written to %TEMP%\OpenClawTray\StatusIcons. Both TrayIcon.SetIcon(path) and Window.SetIcon(path) consume them.
  • Badge policy lives in ShouldBadge() (neutral/critical only) and HasDash() (critical only). Compose() takes a nullable dot colour — null renders the plain lobster — plus an optional white minus glyph for the error state.
  • The dot scales by icon size: 44% on tiny tray sizes (≤32px, for legibility) tapering to a subtle 26% on large taskbar / alt-tab icons (≥256px), with a white ring for contrast on any background.
  • ConnectionStatusPresenter.Accent(overall, status) centralises the accent selection so the tray and desktop icons always agree with the visible HubWindow status pill.
  • TrayIconCoordinator.UpdateTrayIcon and HubWindow (both UpdateTitleBarStatus overloads + initial setup) apply the icon; the tray icon starts on the neutral (disconnected) badge. The existing _isAlive() guard before SetIcon is preserved.
  • Failure-safe: falls back to the plain app icon on any GDI+ error, without pinning the fallback in the cache (so a transient failure can retry).

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 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests — ✅ 1613 passed

New/updated tests (StatusBadgeIconFactoryTests): dot colour mapping, badge policy (ShouldBadge neutral/critical only, HasDash critical 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. Plus ConnectionStatusPresenterTests (Accent() overall-state preference / legacy fallback) and AppRefactorContractTests (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 StatusBadgeIconFactory badge 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

karkarl and others added 2 commits July 8, 2026 12:43
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>
@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 7:53 PM ET / 23:53 UTC.

Summary
The PR adds a WinUI status-badge icon factory, wires tray and HubWindow icons to connection-status accents, and adds focused tests for badge policy, icon composition, and wiring.

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: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add accessible current-head proof from a real Windows run showing the tray and taskbar/HubWindow icon behavior.
  • Make the proof match the latest attention-only policy: grey disconnected badge, plain connected/connecting lobster, and red error badge if that state can be safely captured.
  • Redact private details such as IP addresses, API keys, phone numbers, non-public endpoints, and account data before posting evidence.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Insufficient: the PR body references an unlinked session artifact and says running-app tray/taskbar proof is not yet captured; add a current-head screenshot/video or redacted runtime output, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The current-head visual proof is not accessible from the PR body, and the body explicitly leaves the running Windows tray/taskbar behavior uncaptured.
  • [P1] The tests cover badge bitmap policy and wiring, but they do not prove Windows shell consumption of the generated .ico files in the tray and taskbar.

Maintainer options:

  1. Require current-head Windows proof (recommended)
    Ask for an accessible screenshot or video from a real Windows run showing the grey disconnected badge, plain connected/connecting icon, and red error badge if safely capturable.
  2. Accept unproven visual behavior
    Maintainers could merge based on source/tests alone, but they would own any tray/taskbar shell-rendering mismatch found after merge.

Next step before merge

  • [P1] Needs contributor-accessible current-head visual proof rather than a ClawSweeper code repair.

Security
Cleared: No concrete security or supply-chain regression was found; the diff is scoped to WinUI icon composition/tests and uses an already-present production System.Drawing.Common dependency.

Review details

Best 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 changes

Label changes:

  • add merge-risk: 🚨 other: The PR changes visible Windows shell icon behavior that CI and unit tests do not prove without accessible running-app evidence.

Label justifications:

  • P3: This is low-risk WinUI visual polish for connection status visibility on tray and desktop icons with limited blast radius.
  • merge-risk: 🚨 other: The PR changes visible Windows shell icon behavior that CI and unit tests do not prove without accessible running-app evidence.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Insufficient: the PR body references an unlinked session artifact and says running-app tray/taskbar proof is not yet captured; add a current-head screenshot/video or redacted runtime output, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

What I checked:

Likely related people:

  • shanselman: Blame attributes the current tray coordinator body, App tray initialization, and older HubWindow status methods to commit 4166e0f; GitHub metadata shows shanselman authored and merged the related tray PR. (role: recent tray and HubWindow area contributor and merger; confidence: high; commits: 4166e0fd63f8; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Services/TrayIconCoordinator.cs, src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs)
  • bkudiess: The merged connection snapshot truth work introduced the manager-owned status presenter paths this PR reuses for icon accents. (role: connection-state presenter owner; confidence: high; commits: 74604aebafef; files: src/OpenClaw.Tray.WinUI/Services/ConnectionStatusPresenter.cs, src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs)
  • AlexAlves87: The merged TrayIconCoordinator extraction created the coordinator and contract-test seam this PR extends. (role: introduced tray coordinator seam; confidence: high; commits: 1cc37fea3e01; files: src/OpenClaw.Tray.WinUI/Services/TrayIconCoordinator.cs, src/OpenClaw.Tray.WinUI/App.xaml.cs, tests/OpenClaw.Tray.Tests/AppRefactorContractTests.cs)
  • karkarl: Current main includes this contributor's merged side-by-side app identity work touching App and HubWindow surfaces, so they have adjacent current-main history beyond this PR. (role: recent adjacent contributor; confidence: medium; commits: dae64b6c49e9; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-08T20:00:22.007Z sha c403007 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-08T20:06:09.218Z sha c403007 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-08T23:47:50.776Z sha ee3db70 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added 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. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Jul 8, 2026
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>
@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. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 8, 2026

@shanselman shanselman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants