Skip to content

feat(themes): follow the dashboard accent with the Gateway theme - #2267

Closed
paulcam206 wants to merge 6 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-06-accent
Closed

paulcam206 wants to merge 6 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-06-accent

Conversation

@paulcam206

@paulcam206 paulcam206 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

With Follow Gateway theme on, the Companion now also follows the person's own dashboard accent. That's the color picked in the dashboard's appearance settings, stored as ui.accent in their Gateway profile. The Companion reads it with users.prefs.get (operator.read) alongside themes.list, re-reads it on users.prefs.changed, and paints it over the theme's accent tokens exactly as the Control UI's applyControlUiAccent does. The user's chat bubble gets the same 16% accent wash the dashboard shows, which was the teal-versus-grey mismatch in the side-by-side comparison.

"theme" or an unset accent uses the theme's own accent. An unknown read (no durable profile, an older Gateway, a failed call) keeps the last followed accent, which is persisted so offline starts look the same. With Follow off, the theme's own accent applies. Nothing is written back to the Gateway.

This is part 6 of 10 in the Companion themes stack. Each PR targets main and carries the commits below it; review only this PR's own commit, 345fd28c feat(themes): follow the dashboard accent with the Gateway theme. It depends on #2266 (corner radii).

What Problem This Solves

Fixes: with Follow Gateway theme on, the Companion's accent and user bubble don't match the dashboard when the person has chosen their own accent there.

User Impact

User impact: someone following the Gateway theme sees their dashboard accent (buttons, focus, selection and the user bubble) in the Companion too, live.

Why This Change Was Made

  • Upstream applyControlUiAccent sets --accent, --ring, --primary and --accent-muted to the color, derives the foregrounds from luminance (black above 0.179, else white), the hover from 82% color mixed with white, and --accent-subtle at 16%. ThemeAccent.Apply mirrors it, so the derived surfaces (including the user bubble) follow.
  • The accent normalizer accepts exactly upstream's forms: #rrggbb or "theme". The whole value must match, so a trailing newline is rejected rather than reaching the color parser.
  • A read that can't tell (no durable identity, failure) must not flip the color back, so the last followed accent is kept and persisted.

Evidence

  • GatewayThemeSettingsTests.FollowingTracksTheDashboardAccentLiveAndKeepsItWhenPreferencesAreUnknown (fixture Gateway proxy): the profile's ui.accent replaces Manuscript's accent and its 16% --accent-subtle while the canvas stays the theme's; a no_durable_identity read keeps the followed accent; "theme" gives the theme's accent back; Follow off shows the manual choice with its own accent.
  • GatewayThemeTests.MalformedFollowedAccentKeepsTheThemeAccent: a persisted accent outside upstream's #rrggbb form is ignored.
  • GatewayThemeAccentTests (UI): accent visuals take the theme's accent ramp and return to the Windows accent.
  • For example, a followed accent of #3a9b9b at 16% over Manuscript's dark canvas #211E18 gives a #25322D user bubble, where Manuscript's own accent gives #2E2E30.
  • GatewayThemeCatalogWireTests.FollowingCompanionTracksTheGatewaySelectionPushedByPrefsEvents (real authenticated fixture socket): the fixture's users.prefs.get accent reaches the followed theme after users.prefs.changed.
  • GatewayThemeSettingsTests.SelectionIsPublishedBeforeSlowProfilePreferencesArrive: a stalled users.prefs.get no longer holds back the Gateway's selected theme; the accent arrives on its own.

Built and run at this PR's head (345fd28c) on a Windows 11 guest (Crabbox Hyper-V, build 29683) in light mode with the App theme Dark, OpenClaw.GatewayFixtureHost --scenario gateway-themes and its new accent console command, Follow Gateway theme on and the fixture's selection Manuscript. After accent #3a9b9b the Companion saved "FollowedAccent":"#3a9b9b" and the user bubble took the teal accent; after accent theme the saved accent was removed and the bubble took Manuscript's own accent again:

Manuscript's accent Dashboard accent #3a9b9b Settings while following the accent accent theme
Theme accent Followed accent Settings Accent back to the theme

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 top 783b9ed7): 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 added Appearance block. Capture after the upgrade and restart; the settings diff and full record are in #2264's description.

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: the followed accent changes visible WinUI and chat surfaces; proven by the tests above and native UI tests on an interactive Windows guest.

Validation

On 345fd28c:

  • ./build.ps1: all builds succeeded.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 75 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": 2578 passed, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme" (developer machine, Windows dark mode): 21 passed, 0 failed.
  • Full suites on the stack top 783b9ed7, which contains this commit: ./build.ps1 succeeded; 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.
  • Guest UI tests on the stack top 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.
  • On the stack top ac745c6a, same guest, Windows light then dark: --filter "FullyQualifiedName~GatewayThemeBackdropTests": 5 passed, 0 failed in each mode.

Real Behavior Proof

  • Environment tested: Windows 11 host (unit and wire tests) and a Crabbox Hyper-V guest (native UI tests), fixture Gateway.
  • PR head or commit tested: 345fd28c for the build, unit tests and the native accent run; 016f6e1b for the guest UI tests in both Windows modes.
  • Exact steps or command run: the Tray test filter above; guest UI tests (filter in Validation); a guest script turns Follow Gateway theme on through UI Automation and types select manuscript, accent #3a9b9b and accent theme into the fixture Gateway's console.
  • Evidence after fix: the accent tests pass; the followed accent reaches ChatUserBrush and the accent ramp live.
  • Observed result: a followed #rrggbb accent replaces the theme's accent tokens; "theme" and Follow off use the theme's own accent.
  • Screenshot or artifact links verified? (Yes/No/N/A) Yes
  • Not verified or blocked: a live Gateway with a real profile accent (proven against the fixture Gateway's users.prefs.get). The lower-precedence ui.seamColor (Control UI bootstrap over HTTP) isn't followed.

Security Impact

  • New permissions or capabilities? (Yes/No) No
  • Secrets or tokens handling changed? (Yes/No) No
  • New or changed network calls? (Yes/No) Yes
  • Command or tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any answer is Yes, explain the risk and mitigation: one read-only users.prefs.get over the existing authenticated operator connection, only while following and only with operator read. Only ui.accent (and, in the next PR, ui.background) is used; other preferences are ignored. Nothing is written.

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes
  • Config or environment changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, list the exact upgrade steps: none. Gateways without users.prefs.get or a profile keep the theme's accent.

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.

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.
@clawsweeper

clawsweeper Bot commented Nov 17, 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 the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Nov 17, 2026
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.
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codex review: ready, awaiting a maintainer decision.

What this changes

Adds optional dashboard palettes, fonts, backdrop controls, and live following of the Gateway theme and personal accent.

Example: Follow Gateway theme is enabled with Manuscript dark and dashboard accent #3a9b9b.

  • Before: The user bubble retains Manuscript’s grey accent wash, approximately #2e2e30.
  • After: The user bubble follows the teal accent wash, approximately #25322d, and returns when the dashboard accent is set to theme.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Native before-and-after proof supports the implementation, but adopting the optional appearance direction remains an unresolved product decision.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The current-head Windows 11 fixture run exercises the real Companion through preference-change events, with inspected captures showing the teal accent applied and removed; authenticated socket tests support transport coverage, while a live profile-accent Gateway run is explicitly unverified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: People using dashboard themes beside Companion cannot give the native app matching palettes, typefaces, and personal accents.
Reason: The opt-in implementation has demonstrated user value, but new persisted appearance controls and an extension of the established Fluent design need an owner decision.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep open: this PR provides distinct appearance functionality absent from main, with no definite introduced correctness bug found; adopting the optional appearance controls still needs a maintainer decision.

Priority: P3
Reviewed head: 345fd28cc3ee45b3070bf02e5f9811835f70401a
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Companion adopt the optional dashboard-theme stack, including persisted theme and Mica controls and personal accent following?
  • Recommendation: Approve the staged appearance feature: Accept the optional controls and accent following while retaining Windows defaults and the existing settings and connection owners.
  • Why: The proposal extends the deliberate Windows Fluent appearance contract, and the inspected discussions contain no written owner decision accepting that extension.

Before merge

None.

Findings

None.

Agent review details

How this fits together

Authenticated Gateway theme and preference reads feed a connection-scoped catalog, persisted appearance settings, and a WinUI resource applicator that updates windows, dialogs, and chat.

flowchart LR
  A[Gateway operator connection] --> B[Theme catalog]
  B --> C[Theme follower]
  C --> D[Appearance settings]
  E[Bundled palettes] --> F[Appearance resolver]
  D --> F
  F --> G[WinUI resource applicator]
  G --> H[Windows dialogs and chat]
Loading

Technical review

Best possible solution:

If the appearance direction is approved, land the staged feature through the existing settings and connection owners while preserving Windows defaults, manual choices, and High Contrast.

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

This is a feature proposal: main lacks dashboard-theme following, while the supplied current-head native captures demonstrate the proposed accent changes.

Is this the best way to solve the issue?

The smallest complete approach uses the existing operator client and settings store, with distinct catalog, following, resolution, and native application responsibilities that preserve manual choices and Windows accessibility behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Persisted window theme preference keeps the original intent (1fb28ee: Added application of the persisted System, Light, and Dark preference while reorganizing Settings.)
  • Fluent native surfaces and typography changes intended behavior with a stated reason (bf61595: Aligned window chrome, Settings, and chat with one Fluent design; this PR explicitly proposes optional dashboard palettes and typefaces.)
  • High Contrast resource ownership keeps the original intent (ff19012: Moved theme resolution into WinUI and Reactor resources after failures in legacy accessibility event observation.)
  • Markdown presentation keeps the original intent (a6ff6a1: Aligned native Markdown spacing, tones, and code colors with web chat; the patch retains the presentation owner and adds theme-driven font refresh.)
  • Desktop companion lifetime keeps the original intent (fbc0287: Established a controller-owned desktop companion; effective-theme refresh continues through that controller.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main lacks the proposed capability: Main retains the System, Light, and Dark preference helper and contains neither proposed theme directory; dashboard palette and profile-accent following remain unique work. (src/OpenClaw.Tray.WinUI/Helpers/ThemeHelper.cs:34, a0a2a24ec1dd)
  • Pinned cumulative scope: The introduced range contains six theme-stack commits, including their foundation and native application layers; the unrelated Store changes are base movement. (345fd28cc3ee)
  • Following preserves manual choices and unknown preferences: The resolver applies the saved accent only while following, preserves it when preferences are unknown, and retains the separate manual theme choice. (src/OpenClaw.Shared/Themes/AppearanceSettings.cs:168, 345fd28cc3ee)
  • Authoritative dependency contract: Dependency policy applies because this patch consumes themes.list, themes.get, and users.prefs.get and generates bundled palettes from this repository. The pinned producer distinguishes unknown profile preferences from successful entries, and applyControlUiAccent uses the same foreground, hover, and 16% wash derivations. (src/gateway/server-methods/users.ts:174, 4ffdd2047d19)
  • Native accent proof inspected: All four prepared screenshots were inspected: Manuscript chat changes from its own accent to teal, Settings shows following enabled, and the final capture restores the original accent. The body identifies the native run as this head on Windows 11 using the fixture Gateway. (src/OpenClaw.Tray.WinUI/Theming/GatewayThemeCatalog.cs:165, 345fd28cc3ee)
  • Released-profile compatibility evidence: The linked runtime-resolution PR reports upgrading a v2026.11.3 profile while preserving notification preferences, AppTheme, Gateway record, device identity, and device token, with only Appearance added. GitHub comparison confirms that build contains this head and leaves SettingsData, SettingsManager, and SettingsStore unchanged; later appearance fields are additive. feat(themes): resolve built-in palettes from the connected Gateway #2264. (src/OpenClaw.Tray.WinUI/Services/SettingsManager.cs:149, 345fd28cc3ee)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: Optional appearance customization retains the default experience and addresses no urgent broken workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-17T07:15:53.935Z sha c9947bb :: ready, awaiting a maintainer decision. :: none

Reviewed November 17, 2026, 3:18 AM ET / 08:18 UTC (Revision 2).

@paulcam206
paulcam206 force-pushed the paulcam206-themes-06-accent branch from c9947bb to 345fd28 Compare November 17, 2026 07:42
@paulcam206

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@paulcam206

Copy link
Copy Markdown
Collaborator Author

Superseded by # in native stack #2302.

@paulcam206 paulcam206 closed this Nov 18, 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant