Skip to content

feat(themes): offer Gateway themes and follow the dashboard's theme - #2258

Closed
paulcam206 wants to merge 4 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-04-gateway
Closed

paulcam206 wants to merge 4 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-04-gateway

Conversation

@paulcam206

@paulcam206 paulcam206 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

While the Companion is connected, the Gateway theme picker also offers the Gateway's plugin and imported themes, read with themes.list and themes.get (operator.read, Gateway 2026.9+). A new Follow Gateway theme setting (off by default) shows whatever theme is selected in the dashboard and switches live when it changes there, driven by the Gateway's users.prefs.changed and plugins.changed events.

A chosen Gateway theme is saved as a validated definition snapshot, so it still renders when the Gateway is offline or gone. Themes whose text falls below 3:1 contrast are neither offered nor applied. If the dashboard selects a theme the Companion can't render, the last followed theme stays, then the manual choice. The Companion only reads: it never calls themes.set or writes preferences. The fixture Gateway gains a gateway-themes scenario (synthetic catalog plus a select <id> control that publishes users.prefs.changed) for tests and proof.

This is part 4 of 10 in the Companion themes stack. Each PR targets main and carries the commits below it; review only this PR's own commit, 7a2b6cb0 feat(themes): offer Gateway themes and follow the dashboard's theme. It depends on #2257 (the Mica setting).

What Problem This Solves

The Companion can't use plugin or imported dashboard themes, and it can't stay in step with the theme someone picks in the dashboard.

User Impact

User impact: people can apply any theme their Gateway offers, or turn on Follow Gateway theme to keep the Companion matching the dashboard automatically. Nothing changes until they opt in.

Why This Change Was Made

  • The catalog is connection-scoped: it re-reads on reconnect and on the Gateway's change events, runs at most four definition reads at once, and publishes the selection as soon as themes.list returns, before slower definition reads finish.
  • Snapshots keep a chosen theme usable offline, and every definition is validated against upstream's limits and the legibility floor before use or storage.
  • Following never writes back, so the Companion can't change someone's dashboard.

Evidence

The picker at this PR's head, connected to the fixture Gateway, lists the eleven built-ins and the fixture's plugin themes: Windows default | Claw | Knot | Dash | Absolutely | Tide | Beacon | Phosphor | CRT | Manuscript | Rosé | Miami | Fixture Neon Night | Fixture Paper Mint | Fixture Sunset.

Follow Gateway theme, built and run at this PR's head (7a2b6cb0) on a Windows 11 guest (Crabbox Hyper-V, build 29683) in light mode with the App theme Dark, OpenClaw.GatewayFixtureHost --scenario gateway-themes. A script used UI Automation in Settings and typed select into the fixture Gateway's console:

Manual Tide Follow on, dashboard selects Manuscript Manuscript in chat Dashboard switches to Claw Claw in chat Follow off, then Windows default
Manual Tide Following Manuscript Manuscript chat Following Claw Claw chat Windows default

The saved Appearance after each step (from the run's log):

Tide:               {"Theme":{"Id":"tide",…},"UseMica":true,"FollowGatewayTheme":false}
select manuscript:  {"Theme":{"Id":"tide",…},"FollowGatewayTheme":true,"FollowedTheme":{"Id":"manuscript",…}}
select claw:        {"Theme":{"Id":"tide",…},"FollowGatewayTheme":true,"FollowedTheme":{"Id":"claw",…}}
Follow off:         {"Theme":{"Id":"tide",…},"FollowGatewayTheme":false,…}
Windows default:    {"UseMica":true,"FollowGatewayTheme":false,…}

Standalone dialogs at this head, captured by GatewayThemeBackdropTests (5 passed, OPENCLAW_UI_PROOF_DIR set) on the same guest: the pairing dialog with Tide applied, the same dialog after the theme is cleared to Windows default with Mica on and off, and a dark-only plugin theme that pins the dialog to its mode:

Tide applied Cleared, Mica on Cleared, Mica off Dark-only theme
Tide dialog Cleared, Mica on Cleared, Mica off Dark-only 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 picker and follow behavior change visible Settings and chat surfaces; proven with native UI tests and screenshots on an interactive Windows guest against the fixture Gateway.

Validation

On 7a2b6cb0:

  • ./build.ps1: all builds succeeded.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 70 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": 2576 passed, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme" (developer machine, Windows dark mode): 18 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: Crabbox Hyper-V guest, Windows 11 Insider Preview build 29683, interactive desktop; OpenClaw.GatewayFixtureHost --scenario gateway-themes (synthetic read-only Gateway serving the built-ins and fixture plugin themes).
  • PR head or commit tested: 7a2b6cb0 for the build, unit tests (including the authenticated wire test), the picker listing, the follow run and the dialog captures; 016f6e1b for the guest UI tests in both Windows modes.
  • Exact steps or command run: UI Automation reads the picker's items while connected and picks Tide; Follow Gateway theme on, then fixture select manuscript and select claw; Follow off and Windows default; dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --filter FullyQualifiedName~GatewayThemeBackdropTests with OPENCLAW_UI_PROOF_DIR set.
  • Evidence after fix: the listing and screenshots above; GatewayThemeCatalogWireTests.FollowingCompanionTracksTheGatewaySelectionPushedByPrefsEvents runs the same flow over an authenticated fixture socket on this head.
  • Observed result: plugin themes appear while connected; following switches Settings and chat live from Manuscript to Claw when the Gateway's selection changes, with the manual picker disabled and showing the followed theme; Follow off and Windows default restore the Windows look; dialogs take the applied theme and drop it when it's cleared.
  • Screenshot or artifact links verified? (Yes/No/N/A) Yes
  • Not verified or blocked: following a real dashboard selection through a live Gateway on this head (proven against the fixture Gateway and the wire test instead).

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: the Companion sends themes.list and themes.get over its existing authenticated operator connection, only when the Gateway advertises them and granted operator read. Definitions are validated against upstream's limits and a 3:1 legibility floor before use or storage. No writes, no new endpoints, no artwork or URL fetches.

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 the theme methods (before 2026.9) offer only the built-ins.

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 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
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. 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 Gateway theme selection, offline theme snapshots, and optional live following of the dashboard’s selected theme.

Example: The manual Companion theme is Tide, following is enabled, and the dashboard selects Manuscript.

  • Before: Companion cannot follow the dashboard’s selection.
  • After: Settings and chat switch to Manuscript while retaining Tide as the manual choice.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Current-head visual evidence and successful CI support the implementation; readiness remains limited by the unresolved product direction and draft stack.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Windows 11 captures attributed to 7a2b6cb show the shipped Companion following fixture selections through Settings and chat; supplementary captures exercise standalone dialogs, and authenticated wire tests support catalog/event coverage. Live dashboard selection on a production Gateway remains 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 Companion beside the dashboard cannot select its plugin or imported themes or automatically follow its selected theme.
Reason: The opt-in behavior has demonstrated user value, but adding appearance controls and overriding native presentation when selected remains an owner decision.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep open: this PR provides distinct opt-in appearance features absent from main, and no introduced correctness blocker was verified.

Priority: P3
Reviewed head: 7a2b6cb02ab43998e8c48a31db5c8ad7abafc43b
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Companion add optional Gateway palettes and live dashboard-theme following with persisted Appearance settings?
  • Recommendation: Accept the opt-in direction: Approve Gateway theme selection and following while retaining the current Windows appearance by default.
  • Why: This expands the existing native appearance contract and adds settings; neither this PR nor its reviewed predecessor discussion records maintainer approval of that direction.

Before merge

None.

Findings

None.

Agent review details

How this fits together

The existing authenticated operator connection supplies theme definitions and change events; Companion validates them, saves appearance choices through its settings store, and applies native resource colors and fonts.

flowchart LR
G[Gateway themes and events] --> C[Operator client]
C --> K[Theme catalog]
K --> F[Appearance resolver and follower]
F --> S[Settings store]
S --> A[Theme applicator]
A --> U[Settings chat and dialogs]
Loading

Technical review

Best possible solution:

If accepted, land the opt-in theme stack through the existing settings and connection owners while preserving Windows defaults and the separate manual choice.

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

This is a feature request rather than a reported failure; current-main source confirms that Companion currently offers Windows theme preferences without Gateway theme following.

Is this the best way to solve the issue?

The catalog, resolver, existing settings store, and native applicator form a coherent implementation; the simplification pass found no verified redundant production path or test group requiring removal.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Windows appearance preferences and Settings persistence keeps the original intent (1fb28ee: The existing App theme setting intentionally supports System, Light, and Dark; the later Settings extraction preserves persistence ownership in the settings store.)
  • Native chat typography and accent presentation changes intended behavior with a stated reason (bf61595: Existing presentation follows the native Fluent design system; this PR explicitly proposes dashboard colors and fonts only after a user opts in.)
  • High Contrast resource handling keeps the original intent (ff19012: The earlier repair moved theme resolution into native resources to avoid an unstable accessibility subscription; this PR retains separate High Contrast resources and does not restore that subscription.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced scope: The pinned introduction comparison contains the four stacked commits, including the shared theme model, native application, Mica setting, and Gateway following; the review did not attribute unrelated base-branch Store changes to this PR. (7a2b6cb02ab4)
  • Current-main boundary: Main retains the System/Light/Dark AppTheme setting and Windows theme application; it does not contain this PR’s persisted Appearance field or Gateway theme catalog. (src/OpenClaw.Shared/SettingsData.cs:198, a0a2a24ec1dd)
  • Read-only discovery and following: The catalog uses the existing operator client, checks advertised methods and granted scopes, refreshes on pushed events, and rejects superseded results; the follower saves a renderable selection without writing Gateway preferences. (src/OpenClaw.Tray.WinUI/Theming/GatewayThemeCatalog.cs:132, 7a2b6cb02ab4)
  • Inspected current-head visual evidence: Prepared screenshots show manual Tide, followed Manuscript in Settings and chat, and followed Claw. Additional GitHub images show the dark-only plugin dialog and restored Windows dialog. The body attributes these runs to the reviewed head, resolving the earlier proof concern. (7a2b6cb02ab4)
  • Stored-state compatibility: Appearance is optional and tolerantly parsed, and existing AppTheme values remain independent. The detailed upgrade record in feat(themes): resolve built-in palettes from the connected Gateway #2264 reports v2026.11.3 settings, gateway identity, and device credentials preserved through upgrade and restart; the descendant comparison retains the relevant existing-field loading and writing behavior. (src/OpenClaw.Shared/Themes/AppearanceSettings.cs:69, 7a2b6cb02ab4)
  • Exact-head validation: GitHub reports the exact-head CI Gate, core tests, tray tests, native UI tests, fixture compatibility tests, and changed-test soak successful. A separate dispatch was cancelled; successful dispatches and completed test lanes are also recorded. No builds or tests were run during this read-only review. (7a2b6cb02ab4)

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:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on maintainer.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: Optional visual customization preserves existing defaults and does not repair an 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 (2 earlier review cycles)
  • reviewed 2026-11-17T01:49:01.555Z sha 17ddb57 :: needs real behavior proof before merge. :: [P2] [P2] Apply the effective theme mode to standalone dialogs
  • reviewed 2026-11-17T06:54:17.919Z sha 7a2b6cb :: needs real behavior proof before merge. :: none

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

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.
@paulcam206
paulcam206 force-pushed the paulcam206-themes-04-gateway branch from 17ddb57 to 7a2b6cb Compare November 17, 2026 06:40
@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

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Nov 17, 2026
@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