Skip to content

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

Open
karkarl wants to merge 2 commits into
openclaw:mainfrom
karkarl:karkarl-tray-icon-status-dot
Open

Mirror connection status dot onto lobster tray and desktop icons#945
karkarl wants to merge 2 commits into
openclaw:mainfrom
karkarl:karkarl-tray-icon-status-dot

Conversation

@karkarl

@karkarl karkarl commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Mirrors the companion app's connection-status dot onto both the lobster tray icon and the desktop/taskbar (HubWindow) icon. The tray/desktop lobster now shows a coloured status dot in its bottom-right corner, matching the HubWindow status pill:

  • 🟢 green — connected
  • 🟡 amber — connecting / attention (degraded, pairing required)
  • 🔴 red — error
  • gray — disconnected / neutral

How it works

  • New StatusBadgeIconFactory composes the unplated lobster PNG with a coloured corner dot into cached, multi-resolution .ico files (16–256px) — one per status accent — written to %TEMP%\OpenClawTray\StatusIcons. Both TrayIcon.SetIcon(path) and Window.SetIcon(path) consume them.
  • The dot scales by icon size: 44% of the icon on tiny tray sizes (≤32px, for legibility) tapering to a subtle 26% on large taskbar / alt-tab icons (≥256px). A white ring (tied to the dot) provides contrast on any background.
  • ConnectionStatusPresenter.Accent(overall, status) centralises the accent selection so the tray and desktop icons always agree with the visible HubWindow pill (it delegates to the same Pill(state).Accent).
  • TrayIconCoordinator.UpdateTrayIcon and HubWindow (both UpdateTitleBarStatus overloads + initial setup) apply the badged icon; the tray icon is initialised with the badged neutral lobster from first paint. 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 — only the tray and the companion HubWindow mirror status.

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 — ✅ 1602 passed

New/updated tests:

  • StatusBadgeIconFactoryTests — dot colour mapping, bottom-right dot placement, per-accent colour distinction, valid multi-size ICO container, size-scaling curve (DotFraction), tray/taskbar size coverage.
  • ConnectionStatusPresenterTestsAccent() prefers overall state and falls back to legacy status.
  • AppRefactorContractTests — tray coordinator uses the status-badged lobster; HubWindow desktop icon mirrors the status accent; existing liveness-guard-before-SetIcon contract preserved.

A rubber-duck review was run on the change; both findings were fixed:

  1. Initial tray icon now starts badged (neutral) instead of the plain fallback.
  2. Fallback icon path is no longer cached permanently after a transient build failure.

Real behavior proof

The four badged states were rendered directly from the shipping StatusBadgeIconFactory.Compose / DotColor code on the real lobster asset, at both 256px (taskbar/alt-tab) and 32px (tray) sizes. Result: the lobster with a green/amber/red/gray dot in the bottom-right corner; the dot is a subtle corner badge at 256px and a clearly legible dot at 32px.

Screenshot:
image

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 maintainer review before merge. Reviewed July 8, 2026, 4:06 PM ET / 20:06 UTC.

Summary
The PR adds a status-badged lobster icon factory, applies those icons to the tray and HubWindow/taskbar surfaces, and adds focused tests for accent mapping and icon composition.

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: 1 noteworthy metric.

  • Changed files: 9 files changed, 426 added, 7 deleted. The diff is a focused tray/HubWindow visual update with one new helper and matching tests, not broad repository churn.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair is needed because the patch has no concrete code defect from this review pass.

Security
Cleared: No concrete security or supply-chain regression was found; the PR does not touch workflows, secrets, install scripts, or production package sources beyond existing System.Drawing usage.

Review details

Best possible solution:

Land the focused icon-mirroring change after ordinary maintainer review and completed CI, keeping the existing transient-window static icon boundary.

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; the PR uses the existing ConnectionStatusPresenter accent model and keeps the change scoped to tray and HubWindow icons with focused tests. The screenshot now gives enough real visual proof for the neutral status path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 87634727b65b.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes a viewable screenshot showing the current Windows tray/taskbar and HubWindow with the gray badged lobster status icon.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body now includes a viewable screenshot showing the current Windows tray/taskbar and HubWindow with the gray badged lobster status icon.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body now includes a viewable screenshot showing the current Windows tray/taskbar and HubWindow with the gray badged lobster status icon.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is low-risk visual polish for connection status visibility on tray and desktop icons with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body now includes a viewable screenshot showing the current Windows tray/taskbar and HubWindow with the gray badged lobster status icon.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes a viewable screenshot showing the current Windows tray/taskbar and HubWindow with the gray badged lobster status icon.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body now includes a viewable screenshot showing the current Windows tray/taskbar and HubWindow with the gray badged lobster status icon.
Evidence reviewed

What I checked:

  • Repository policy read and applied: AGENTS.md was read fully; its tray UX proof policy applies because the PR changes visible tray and HubWindow icon behavior. (AGENTS.md:57, 87634727b65b)
  • Current main lacks the requested tray icon behavior: Current main initializes the tray icon from IconHelper.GetStatusIconPath(ConnectionStatus.Disconnected), not from a status-badged lobster icon. (src/OpenClaw.Tray.WinUI/App.xaml.cs:763, 87634727b65b)
  • Current main tray updates still use the plain icon: Current main TrayIconCoordinator.UpdateTrayIcon builds Assets/openclaw.ico before SetIcon, so tray refreshes do not mirror the HubWindow pill accent. (src/OpenClaw.Tray.WinUI/Services/TrayIconCoordinator.cs:42, 87634727b65b)
  • PR implementation wires the tray to the new badge factory: At the PR head, TrayIconCoordinator captures the current snapshot, resolves a ConnectionStatusPresenter accent, and calls StatusBadgeIconFactory.GetBadgedIconPath before SetIcon. (src/OpenClaw.Tray.WinUI/Services/TrayIconCoordinator.cs:43, c403007df7df)
  • PR implementation creates multi-size badged icons: StatusBadgeIconFactory composes the lobster asset with per-accent colors, writes cached multi-resolution ICO files under temp, and avoids caching fallback paths after failures. (src/OpenClaw.Tray.WinUI/Helpers/StatusBadgeIconFactory.cs:37, c403007df7df)
  • PR proof attachment resolves and shows the changed visual surface: The PR body image downloaded as a 405x317 PNG and visibly shows the Windows tray/taskbar surface with the gray lobster status badge and disconnected HubWindow pill.

Likely related people:

  • shanselman: Blame attributes current App tray initialization, TrayIconCoordinator body, and HubWindow status methods to commit 4166e0f, and GitHub metadata shows shanselman merged related tray/connection PRs. (role: recent area contributor and merger; confidence: medium; commits: 4166e0fd63f8, 1cc37fea3e01, 74604aebafef; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Services/TrayIconCoordinator.cs, src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs)
  • bkudiess: Merged PR Fix connection snapshot truth #918 changed the manager-owned connection snapshot truth and status presentation paths that 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: Merged PR refactor: extract TrayIconCoordinator from App.xaml.cs #818 extracted TrayIconCoordinator and added the 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 adjacent WinUI app identity work from commit dae64b6 touching App and HubWindow surfaces, so the PR author also has recent merged history nearby. (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 (1 earlier review cycle)
  • reviewed 2026-07-08T20:00:22.007Z sha c403007 :: 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant