Skip to content

feat: add an animated desktop lobster with notification bubbles - #1681

Merged
karkarl merged 11 commits into
mainfrom
karkarl-desktop-lobster-companion
Nov 13, 2026
Merged

karkarl merged 11 commits into
mainfrom
karkarl-desktop-lobster-companion

Conversation

@karkarl

@karkarl karkarl commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Provides a Clippy-like OpenClaw companion that reacts to notifications while the main app is in the background.

User Impact

Users get an animated desktop lobster (on by default, controlled by Settings > General > Desktop lobster). It shows incoming notification text in speech bubbles, can be dragged, and opens a quick chat on click. Notification severity changes its expression. The right-click menu has a Desktop lobster settings shortcut instead of Hide. The mascot size is a dropdown (50% to 200%, default 100%). Chat notifications offer Quick reply, and quick chat keeps a dedicated conversation per Gateway with attach and mic. The bubble and quick chat live in a windowed popup with a DesktopAcrylicBackdrop (flyout fill LayerOnAcrylicFillColorDefaultBrush, stroke SurfaceStrokeColorFlyoutBrush), so they are legible over any background; the mascot stays in the transparent overlay window.

Privacy: the lobster is on by default and exposes notification text outside the app, including during screen sharing. Notifications still require Show notifications. Position is not persisted across app restarts. This is a stationary companion, not a roaming desktop pet or an independent startup process.

Draft: the final interactive pointer sweep and independent rubber-duck review remain incomplete; this PR is not presented as merge-ready.

Why This Change Was Made

Uses the existing Microsoft.UI.Reactor stack to declare the surface and retains the setup mascot through XamlHostElement, reusing its animation engine, accessibility preferences, and artwork rather than introducing a browser renderer or sprite framework. The eSheep investigation and animation catalog are documented in docs/DESKTOP_LOBSTER.md; no eSheep code or artwork is copied.

AppNotificationService retains notification/history ownership. The new controller tracks arrivals without replaying startup backlog; Reactor owns visual projection, and the native window adapter owns placement, pointer input, timeout, and disposal. The architecture ledger records these boundaries. The latest arrival replaces the bubble instead of creating a second queue.

A shaped transparent, nonactivating topmost window excludes unused space from hit testing. DWM configuration plus WM_NCCALCSIZE remove the outer frame/shadow. Drag handlers observe Button-handled pointer events, with click suppression limited to the drag gesture.

Evidence

Branch rebased onto an earlier main and now merged with current main (origin/main at 3d5f1427). The full build and the required Shared and Tray suites pass on the merged head. In an isolated fixture app on the merged head, I enabled the lobster from Settings > General, sent system.notify through local MCP, and observed the bubble with its heading and message (also with no title, which falls back to "OpenClaw"). Earlier native input coverage passed dragging with and without a bubble, repeated repositioning, capture-loss cancellation, and accessible menu invocation afterward.

Gaps: the final native pointer sweep and independent rubber-duck review are not done,. The acrylic popup has no speech tail, and its blur strength on varied wallpapers was checked on one machine only.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: transparent overlay, visible notification reactions, native pointer dragging, keyboard/accessibility behavior, and Settings opt-in. Final pointer sweep is blocked by a locked desktop.
  • windows-11-arm64: native ARM64 build, launch, and WinUI/Win32 overlay behavior. ARM64 build and isolated launch were exercised; this does not substitute for the incomplete interactive pool.

Validation

Local results from November 12, 2026 on the merged head (9ab8143e), with OPENCLAW_REPO_ROOT set to this worktree and isolated tray data. The native UI suite (OpenClaw.Tray.UITests) was not re-run on this head.

Command Result
.\build.ps1 Passed.
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore Passed: 5,848 passed, 28 skipped, 0 failed.
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore Passed: 6,376 passed, 0 failed.
git diff --check Not re-run on the merge.

Real Behavior Proof

  • Environment tested: native Windows ARM64, .NET SDK 10.0.404, isolated fixture profile (chat-interactive scenario) with its local MCP endpoint.
  • PR head or commit tested: ab192dbb (acrylic popup on top of the origin/main merge).
  • Exact steps or command run: .\scripts\run-gateway-fixture.ps1 -Scenario chat-interactive -AppPath <this build>; turned on Desktop lobster in Settings > General; then winnode --mcp-url <fixture-url> --command app.settings.set --params '{"name":"ShowNotifications","value":"true"}' and winnode --mcp-url <fixture-url> --command system.notify --params '{"title":"Build finished","body":"..."}', with the fixture profile selected through OPENCLAW_TRAY_DATA_DIR.
  • Evidence after fix: system.notify returned {"sent":true} and the app exposed a separate "OpenClaw desktop lobster" window. On the previous head I also observed the bubble visually (heading, message, flyout fill and stroke) and verified WS_EX_TOPMOST on the window; a notification without a title showed the heading "OpenClaw".
  • Observed result: the lobster is on by default, the bubble renders with the flyout surface, and notifications display their literal text.
  • Screenshot or artifact links verified? (Yes/No/N/A): Yes. Captured on ab192dbb with screen.snapshot against the isolated fixture (screen capture enabled only in that profile), cropped to the lobster. Notification bubble, then quick chat opened by clicking the mascot:

Desktop lobster notification on an acrylic popup

Desktop lobster quick chat on an acrylic popup

  • Not verified or blocked: final native pointer sweep, multi-monitor/mixed-DPI dragging, and real Gateway notification delivery. The independent rubber-duck review must be completed before ready-for-review/merge. Local MCP evidence is not Gateway-path proof.

Security Impact

  • New permissions or capabilities? (Yes/No): No.
  • Secrets or tokens handling changed? (Yes/No): No.
  • New or changed network calls? (Yes/No): No.
  • Command or tool execution surface changed? (Yes/No): No.
  • Data access scope changed? (Yes/No): No; uses the existing admitted app notifications.
  • If any answer is Yes, explain the risk and mitigation: N/A. Display exposure does change: notification text can be visible on the desktop and in screen shares. The lobster is on by default; it only shows notifications while Show notifications is on, Settings discloses this, and disabling notifications or the lobster clears its bubble. Text is rendered literally, not as markup or executable actions.

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes.
  • Config or environment changes? (Yes/No): Yes. Adds the default-true ShowDesktopCompanion setting and the DesktopCompanionScalePercent setting (default 100). Native pointer proof requires the opt-in OPENCLAW_DESKTOP_COMPANION_POINTER_PROOF=1 test environment variable.
  • Migration needed? (Yes/No): No.
  • If yes, list the exact upgrade steps: No migration. Users can turn the feature off in Settings > General > Desktop lobster. Existing notifications and Windows toasts retain their behavior.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex review: needs changes before merge.

What this changes

Adds an optional animated desktop lobster that displays incoming OpenClaw notifications in speech bubbles and opens existing app surfaces.

Example: The user enables Desktop lobster and sends a notification titled "Desktop lobster".

  • Before: Existing notification surfaces receive it, but no desktop mascot displays its text.
  • After: The mascot displays "Hold the left mouse button on me and drag to move me around your desktop." in a speech bubble.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful real-app evidence supports the feature, but incomplete interaction coverage and the unresolved ordering defect limit readiness.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (live_output): Copied current-head Windows ARM64 diagnostics connect the real isolated app and winnode system.notify invocation to DesktopCompanionWindow displaying the exact message with Offscreen=false. Earlier native input coverage exercised unchanged product code, while the final expanded pointer and visual pass remain explicitly blocked. The additive default-false setting requires no migration and preserves existing settings through the unchanged persistence owner.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Feature · Worth it: Yes
User problem: Users seeking a desktop companion cannot see incoming notifications beside an animated mascot while Companion is in the background.
Reason: This bounded, opt-in feature comes from a contributor with prior merged native UI ownership work. Reusing existing notifications and animation limits its cost, and the default-off setting preserves existing users' experience.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This collaborator-authored PR provides a distinct capability absent from current main. The previously reported blocking finding remains unchanged.

Priority: P3
Reviewed head: 56caf15eea259d3063d209b0f8fa8b386b5ead70

Before merge

  • Select the latest arrival independently of notification queue order (P2) - The prior finding remains at this head. Let A already be current, enqueue B from a background producer, then coalesce A with newer text before either UI callback runs. The controller reads the final snapshot [A(updated), B], so LastOrDefault selects B although A was the latest arrival. Remember then marks both changes seen, and subsequent callbacks never display A's update. Preserve arrival chronology independently of banner queue order while retaining protection against replaying removed notifications.

Findings

  • [P2] Select the latest arrival independently of notification queue order — src/OpenClaw.Tray.WinUI/Presentation/DesktopCompanionState.cs:22-26

Tests

  • Missing end-to-end proof: No executed before/after check covers delayed-dispatch coalescing; the expanded final native pointer sweep and visual pass remained blocked on a locked Windows desktop.
Agent review details

How this fits together

Companion's existing notification service receives local and Gateway notifications and owns their history. The optional desktop window observes those notifications, displays literal text, and follows the user's Settings choices.

flowchart TD
  A[Local or Gateway notification] --> B[Existing notification service]
  B --> C[Existing notification surfaces]
  B --> D[Desktop arrival tracker]
  E[Settings toggles] --> D
  D --> F[Animated desktop window]
  F --> G[Dismiss bubble or open app]
Loading

Technical review

Best possible solution:

Keep arrival chronology under the existing notification owner and let the optional overlay consume it without creating another notification queue.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the reported ordering failure: enqueue B, then coalesce existing A before flushing UI callbacks. The tracker selects B and consumes A's update; no runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Mostly yes: the implementation reuses existing notification, Settings, and mascot owners. Queue position must be replaced with actual arrival chronology to deliver the stated latest-notification behavior.

Full review comments:

  • [P2] Select the latest arrival independently of notification queue order — src/OpenClaw.Tray.WinUI/Presentation/DesktopCompanionState.cs:22-26
    The prior finding remains at this head. Let A already be current, enqueue B from a background producer, then coalesce A with newer text before either UI callback runs. The controller reads the final snapshot [A(updated), B], so LastOrDefault selects B although A was the latest arrival. Remember then marks both changes seen, and subsequent callbacks never display A's update. Preserve arrival chronology independently of banner queue order while retaining protection against replaying removed notifications.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 037c17dcb581.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -p:Platform=ARM64 -r win-arm64 --no-restore --filter FullyQualifiedName~DesktopCompanionWindowTests
  • Verify delayed dispatch presents updated A after B then A coalescing, while removed notifications and startup backlog remain suppressed.

What I checked:

  • Repository policy: Read the complete root AGENTS.md and applicable proof-validation skill. No nested AGENTS.md or maintainer-notes directory was found. Applied ownership, settings isolation, and UI proof guidance; no builds, tests, or additional reviewers were run. (AGENTS.md:103, 56caf15eea25)
  • Introduced change: Read the pinned introduced delta and its production and test files. Raw test-merge parents match the fetched main and exact PR head; endpoint drift was not attributed to this PR. (56caf15eea25)
  • Current-main necessity: Current-main searches found no desktop companion implementation or opt-in setting. The related merged notification, Settings, and composition-root PRs provide supporting infrastructure. Mirror connection status dot onto lobster tray and desktop icons #945 changes tray/taskbar icon badges, not a desktop notification companion. (src/OpenClaw.Tray.WinUI/App.xaml.cs, 037c17dcb581)
  • Prior finding remains: The earlier reviews examined this exact head. LastOrDefault still selects changed notifications by queue position, and Remember marks every changed occurrence as consumed. (src/OpenClaw.Tray.WinUI/Presentation/DesktopCompanionState.cs:23, 56caf15eea25)
  • Notification ordering contract: The existing service coalesces notifications in place and constructs active notifications from the current banner followed by queued entries. This represents banner rotation order rather than arrival chronology; the controller reads that final snapshot after dispatch. (src/OpenClaw.Tray.WinUI/Services/AppNotificationService.cs:325, 56caf15eea25)
  • Real app evidence: The supplied complete body, sourceRevision 0b24887a0de87f1abc2989a96d65b28c3f48e886d6e19a85f6b5bec8b3dfc576, records an isolated Windows ARM64 app launch, winnode discovery, and system.notify returning {"sent":true}. UI Automation observed the exact supplied message with Offscreen=false. The final UI run reports 11 passing cases and six pointer cases blocked by LockApp; earlier pointer coverage used unchanged product code. (56caf15eea25)

Likely related people:

  • Barbara Kudiess: Raw commit d2638dd adds src/OpenClaw.Tray.WinUI/Presentation/SettingsPageViewModel.cs:102 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d2638ddbef57; files: src/OpenClaw.Tray.WinUI/Presentation/SettingsPageViewModel.cs)

Review metrics

Metric Value Why it matters
Added code production +913, tests/project +717, docs +138; 0 removed The growth supports a new native overlay with separate presentation and lifecycle owners while reusing existing notification and animation components.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.

Label justifications:

  • P3: This optional desktop presentation feature does not unblock a core workflow.
  • merge-risk: 🚨 message-delivery: Delayed dispatch can consume the newest coalesced notification without displaying its updated text in the desktop bubble.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-08T15:34:29.911Z sha 56caf15 :: needs changes before merge. :: [P2] Select the latest arrival independently of notification queue order
  • reviewed 2026-10-09T18:58:25.393Z sha 56caf15 :: needs changes before merge. :: [P2] Select the latest arrival independently of notification queue order

Reviewed October 9, 2026, 3:27 PM ET / 19:27 UTC (Revision 3).

@karkarl karkarl added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Oct 9, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient Contributor real behavior proof is sufficient. label Oct 9, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to inactivity.
Please update it or it will be closed.

@github-actions github-actions Bot added the stale label Oct 24, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Closing due to inactivity.
If this PR should be revived, reopen it with current context and a fresh validation plan.

@github-actions github-actions Bot closed this Nov 1, 2026
karkarl and others added 3 commits November 9, 2026 12:17
Add an opt-in animated desktop mascot with notification speech bubbles, native transparent overlay, localization, and lifecycle coverage.

Co-authored-by: Copilot App <[email protected]>
Observe handled WinUI pointer events, restore click behavior after drag cancellation, and add guarded native pointer regression tests.

Co-authored-by: Copilot App <[email protected]>
Remove the stale Reactor preview pin and use the current isolated app launch command.

Co-authored-by: Copilot App <[email protected]>
@karkarl karkarl reopened this Nov 12, 2026
karkarl and others added 2 commits November 12, 2026 13:11
…urface

Adds per-Gateway quick chat with attach and mic, notification Quick reply,
a 50-200% size setting, default-on lobster with a Settings shortcut in the
options menu, and the LayerOnAcrylic flyout fill and stroke for the bubble.

Co-authored-by: Copilot App <[email protected]>
@karkarl
karkarl force-pushed the karkarl-desktop-lobster-companion branch from 56caf15 to 9ab8143 Compare November 12, 2026 18:36
The overlay window stays transparent for the mascot. The bubble moves to a
Popup with DesktopAcrylicBackdrop so the surface is legible over any wallpaper.

Co-authored-by: Copilot App <[email protected]>
@karkarl
karkarl marked this pull request as ready for review November 12, 2026 20:05
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

karkarl and others added 2 commits November 12, 2026 15:36
Anchor the popup from native window size and re-anchor on move or resize, hide it while a modal prompt or dialog is open, focus the chat on open, keep menu keys out of the composer, cancel Alt+F4 closes, cap compact chat height, windowed slash popup, and guard Windows 11 DWM attributes.

Co-authored-by: Copilot App <[email protected]>
The lobster is on by default, so its overlay window can become the process main window and hide the Workspace window from these tests.

Co-authored-by: Copilot App <[email protected]>
karkarl and others added 3 commits November 13, 2026 02:21
The step takes about 13.5 minutes on a healthy run, so runner variance pushes it past the 15 minute limit and fails the gate with no failing tests.

Co-authored-by: Copilot App <[email protected]>
Resolve design, architecture and workflow conflicts, keep main's CI sharding, and bring the new tests in line with main's timing-pattern guard.

Co-authored-by: Copilot App <[email protected]>
@karkarl
karkarl merged commit fbc0287 into main Nov 13, 2026
29 checks passed
@karkarl
karkarl deleted the karkarl-desktop-lobster-companion branch November 13, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant