Repository navigation
feat(themes): paint the desktop lobster's bubble with the Gateway theme - #2270
paulcam206 wants to merge 8 commits into
Conversation
Add the shared theme model the Companion's appearance will build on: CSS Color 4 parsing, resolved light and dark palettes in the Control UI's vocabulary (including the surfaces it derives in CSS: sidebar mix, shell, 78% composer fill and accent-subtle user bubble), the Gateway's themes.list/themes.get wire shapes and definition limits, plugin palette expansion, a 3:1 legibility floor, and a persisted, tolerant appearance setting. Built-in palettes come from a table generated by scripts/Update-GatewayThemeTable.ps1, which resolves the Control UI cascade in headless Edge at a pinned openclaw/openclaw ref (here the packaged Gateway 2026.11.1, 4ffdd204). Nothing applies a theme yet.
General settings gains a Gateway theme picker with the built-in OpenClaw dashboard themes. AppThemeApplicator recolors the bound Fluent, App and chat brushes in the light and dark dictionaries from the theme's palette, including the surfaces the dashboard derives in CSS (sidebar mix, opaque shell, 78% composer, accent-subtle user bubble), and moves accent-driven visuals (navigation indicator, working claw, voice) onto the theme's accent ramp. The theme's typefaces are bundled (OFL, google/fonts) and reach all text through ContentControlThemeFontFamily and a re-declared type ramp. A themed window paints the theme's opaque canvas over its own backdrop, as the dashboard does, and clearing the theme restores every recolored brush. High Contrast dictionaries are never touched, so High Contrast always wins. A caught layout cycle now logs the active theme, focus and open popups.
General settings gains a "Mica backdrop" toggle. It governs the Windows default look only: on shows the window's own Mica, off paints the opaque Fluent canvas over it. Gateway themes stay opaque either way, as the dashboard is, and High Contrast keeps the system backdrop. The change applies to every open window and dialog live by painting the window root, never by swapping backdrops (which faults inside WinUI across a theme refresh), and each window logs its backdrop mode.
While connected, the theme picker also offers the Gateway's plugin and imported themes (themes.list and themes.get, operator.read, Gateway 2026.9+), re-read on plugins.changed and users.prefs.changed. A chosen Gateway theme is saved as a validated definition snapshot, so it still renders offline; themes below a 3:1 text contrast are neither offered nor applied. A new "Follow Gateway theme" setting (off by default) shows the theme selected in the dashboard and updates live; a theme the Companion can't render keeps the last followed one, then the manual choice. The Companion never calls themes.set or writes preferences. The fixture Gateway gains a themes scenario for tests and proof.
The generator now resolves each built-in's radius-sm, radius-md and corner scale, reading the circular geometry WinUI draws (Edge's 1.25 squircle compensation is neutralized; CRT's own 0.25 still wins). Controls take the small and medium radii (ControlCornerRadius, OverlayCornerRadius) from the theme in effect at startup and keep them for the session. WinUI resolves a control style's radius when the first control of that type is created, so a later change would reshape some control types and not others. Chat surfaces scale their radii by the theme's corner scale and follow every switch, including mounted messages that do not render again. Windows default and High Contrast keep Fluent's geometry.
While following the Gateway theme, the Companion reads the person's saved dashboard accent (users.prefs.get ui.accent, operator.read) with themes.list and re-reads it on users.prefs.changed. A hex accent is drawn over the theme's accent tokens exactly as the Control UI's applyControlUiAccent does, so the user bubble takes the same 16% wash. "theme" or unset uses the theme's own accent; an unknown read (no durable profile, older Gateway, failure) keeps the last followed accent, which is persisted for offline starts. Nothing is written back.
Bundle the Control UI's light and dark artwork for each built-in theme (and its neutral pair for plugin and imported themes), re-encoded as PNG from the pinned release's lossless WebP by scripts/Update-ThemeBackgrounds.ps1. Chat draws it behind the new-chat surface and conversations with the dashboard's ui.background model: faded or full-bleed, visibility and the two placement toggles. While following, the person's dashboard choice is read with users.prefs.get and followed live; otherwise Settings offers the Companion's own style and strength. Windows default, High Contrast and transparency effects off show no artwork. A custom dashboard image is not fetched yet.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: ready, awaiting a maintainer decision. What this changesThis PR adds Gateway appearance support and makes the desktop lobster bubble follow the selected theme, backdrop setting, and light or dark mode. Example: Select Rosé dark while the desktop lobster bubble is open.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep open: current main retains the Fluent-only bubble, and this draft contains distinct, unmerged work. Priority: P3 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCompanion appearance settings resolve a palette that App applies to native resources; the desktop lobster's separate popup now receives the corresponding surface and acrylic configuration. flowchart LR
Settings[Appearance settings] --> App[App theme application]
App --> Backdrop[Backdrop policy]
Backdrop --> Surface[Popover surface policy]
Surface --> Window[Desktop companion window]
Window --> Bubble[Reactor bubble]
Technical reviewBest possible solution: Approve the theme direction once, land its prerequisites in order, and retain the existing popup owners with the focused surface policy and theme-aware acrylic adapter. Do we have a high-confidence way to reproduce the issue? Current-main source fixes the popup to Fluent resources, and contributor before/after captures demonstrate the separate dark-Companion/light-Windows acrylic failure; this review executed no target code. Is this the best way to solve the issue? The bubble repair uses the existing window and presentation owners, preserves notification revision semantics, and resolves the previous contrast finding without expanding the shared palette model. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a0a2a24ec1dd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 17, 2026, 6:12 AM ET / 11:12 UTC (Revision 3). |
7042b66 to
9f7770c
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
The desktop lobster's notification and quick-chat bubble lives in a windowed popup that neither AppThemeApplicator nor BackdropPolicy reached. Its translucent Fluent fill, which the theme projection skips, stayed grey under every theme. PopoverSurfacePolicy chooses the bubble's backdrop, fill and stroke through ThemeBackdropPolicy, like Mica windows: a Gateway theme paints the dashboard toast's opaque --popover and --border with the acrylic removed, Windows default keeps Fluent's acrylic with the Mica setting on and its opaque flyout fill with it off, and High Contrast keeps Fluent's resources. DesktopCompanionWindow re-applies it on BackdropPolicy.Configured and when the bubble's light/dark mode changes, without replaying the entrance. The stock DesktopAcrylicBackdrop on a popup follows the application theme (the Windows app mode), so a dark Companion on light Windows drew white text on white acrylic. PopoverAcrylicBackdrop drives a DesktopAcrylicController with the bubble's own theme. A source-text test that grepped for the stock backdrop is replaced by behavioral UI tests.
9f7770c to
f01a05c
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Superseded by # in native stack #2302. |
The desktop lobster's notification and quick-chat bubble now follows the Companion's appearance. It lives in its own windowed popup, outside the windows the theme and backdrop code reached, and its translucent Fluent fill is one the theme projection deliberately skips, so it stayed grey (
#333333) under every theme. Under a Gateway theme the bubble now paints the dashboard toast's surface, an opaque--popoverfill with the--borderstroke and no acrylic, like Gateway-themed windows. Windows default keeps Fluent's acrylic with the Mica setting on and Fluent's opaque flyout fill with it off. High Contrast keeps Fluent's resources.The bubble re-applies live whenever the Companion reconfigures its appearance (
BackdropPolicy.Configured) and when its own light/dark mode changes, without replaying its entrance or re-announcing. A second issue surfaced in proof: the stockDesktopAcrylicBackdropon a popup follows the application theme, which tracks the Windows app mode, so a dark Companion on light Windows drew white text on white acrylic.PopoverAcrylicBackdropdrives aDesktopAcrylicControllerwith the bubble's own theme instead. The dashboard defines no per-theme lobster color, so the mascot keeps its own palettes.This is part 8 of 10 in the Companion themes stack. Each PR targets
mainand carries the commits below it; review only this PR's own commit,f01a05cd feat(themes): paint the desktop lobster's bubble with the Gateway theme. It depends on #2268 (background artwork).What Problem This Solves
Fixes: the desktop lobster's chat bubble stays grey under a Gateway theme, and shows white text on white acrylic when the Companion is dark and Windows is light.
User Impact
User impact: the lobster's bubble matches the theme the rest of the Companion uses, and stays readable whatever the Windows app mode.
Why This Change Was Made
PopoverSurfacePolicydecides the bubble's backdrop, fill and stroke through the sameThemeBackdropPolicyas windows, so popovers can't drift from the window rule. A translucent plugin--popovertoken is composited onto the canvas first, so the desktop never shows through.BackdropPolicyexposes its current Mica setting and theme plus aConfiguredevent for surfaces it doesn't own; the window unsubscribes when it closes.Theme.Ref, the running Companion kept the frame on the app mode's fill: a dark Companion on light Windows that cleared a theme with Mica off showed a blank white bubble (captured below). The dictionary brushes for the mode the app isn't running in can carry the app mode's colors until that mode renders, so the color tokens are read instead.--popover-foreground. When that text can't be read on a theme's--popover(an imported theme whose popover expects its own foreground), the bubble uses the theme's--card, which the legibility floor checks with that text.new DesktopAcrylicBackdrop()is replaced by behavioral UI tests that cover its markers.Evidence
Lobster bubble over a stand-in canvas in each theme's shell color, captured by
DesktopCompanionWindowTests.OpenBubble_FollowsGatewayThemeMicaAndLightDarkLivein proof mode at this PR's head (f01a05cd) on a Windows 11 guest (Crabbox Hyper-V, build 29683) in light mode:The running Companion at this PR's head, same guest, App theme Dark on light Windows: the lobster's quick chat open over the Workspace, Gateway theme and Mica setting changed in Settings through UI Automation, the bubble's header and rim sampled from the screen after each change:
#333333(acrylic)#26233A#26233A#2C2C2C#26233A#26233A#333333(acrylic)The earlier head of this PR,
7042b665, run through the same sequence, drew the bubble blank#FFFFFFonce the theme was cleared with Mica off, under its white text, and stayed that way until Mica was turned back on:The mascot overlapping a maximized Workspace's send button is placement, not sizing: it spawns 16 px from the work area's bottom-right and its position isn't saved yet.
Upgrade from the released Companion, run on a Windows 11 guest in light mode for the runtime-palette PR stacked on this one (#2264 at
2e98953a, which contains this stack's top783b9ed7): the latest stable Companion, v2026.11.3 (portable zip, SHA-256 verified against the release digest, the artifact CI's released-profile check uses), was paired to a real Gateway 2026.11.4 on an isolated profile, then that build opened the same profile. Notification settings, App theme Dark, the gateway record, device id and device token were preserved, with no new pairing request. Manuscript, picked in Settings, stayed applied in dark mode after a restart (canvas#211E18), and the only settings.json change was the addedAppearanceblock. Capture after the upgrade and restart; the settings diff and full record are in #2264's description.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: the desktop lobster's popup surface and backdrop change; proven with native UI tests and captures on an interactive Windows guest.Validation
On
f01a05cd:./build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 86 passed, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Settings|FullyQualifiedName~Appearance|FullyQualifiedName~DesktopCompanion|FullyQualifiedName~Chat": 2586 passed, 0 failed.dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme"(developer machine, Windows dark mode): 24 passed, 0 failed.dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~DesktopCompanionWindowTests"(developer machine, Windows dark mode): 26 passed, 0 failed, 4 skipped (opt-in pointer tests).783b9ed7, which contains this commit:./build.ps1succeeded;dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5982 passed, 0 failed, 29 skipped (existing opt-in integration skips);dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6791 passed, 0 failed.016f6e1b(Crabbox Hyper-V Windows 11 build 29683, interactive desktop, isolated tray profile, proof captures on), once with Windows in light mode and once in dark:dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --filter "Category!=Accessibility&...&(FullyQualifiedName~GatewayTheme|FullyQualifiedName~DesktopCompanionWindowTests|FullyQualifiedName~ChatThemeProofScope|FullyQualifiedName~SettingsPageInsetTests|FullyQualifiedName~ChatMarkdown)": 53 passed, 4 skipped (opt-in pointer tests), 1 failed in each mode. The failure,DesktopCompanionWindowTests.MascotScale_UpdatesLayoutAndHitRegionWithoutScalingOrReplacingPopup(chatOpen: True), needs a larger work area than the guest's 1024x720 at 200% scale.ac745c6a, same guest, Windows light then dark:--filter "FullyQualifiedName~GatewayThemeBackdropTests": 5 passed, 0 failed in each mode.Real Behavior Proof
f01a05cdfor the build, unit tests,DesktopCompanionWindowTestson the guest (25 passed, 4 skipped opt-in pointer tests, 1 failed: the work-area case below) and on the developer machine (26 passed, 4 skipped), and the captures;7042b665for the before-the-fix run;016f6e1bfor the guest UI tests in both Windows modes.dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --filter FullyQualifiedName~DesktopCompanionWindowTests, withOPENCLAW_UI_PROOF_DIRset for the captures; the real-app run starts the Companion underOpenClaw.GatewayFixtureHost --scenario chat-interactive --theme Darkwith an isolated profile, turns on the desktop lobster and opens its quick chat, then changes the Gateway theme and Mica setting in Settings through UI Automation and samples the bubble from the screen.GatewayThemeSettingsTests.LobsterBubbleTakesTheOpaqueThemePopoverAndYieldsToHighContrast(6 cases),LobsterBubbleKeepsTheWindowsLookExactlyWithoutATheme,OpaqueLobsterBubbleCompositesATranslucentPopoverOntoTheCanvas,LobsterBubbleKeepsItsTextReadableWhenAThemesPopoverExpectsAnotherForeground(white text and a#AAAAAApopover over a black card fall back to the card; it fails without the fallback).Yes/No/N/A) YesDesktopCompanionWindowTests.MascotScale_…(chatOpen: True)fails on the guest because its work area (1024×720) is smaller than the chat-open bubble at 200% scale (820 DIP), so clamping moves the anchor; it's environmental, unrelated to this change, and failed the same way before it.Security Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoReview Conversations