Repository navigation
feat(themes): offer Gateway themes and follow the dashboard's theme - #2294
Conversation
|
🦞👀 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: needs maintainer review before merge. What this changesAdds Gateway plugin and imported themes, optional dashboard-theme following, and saved snapshots for offline appearance. Example: The dashboard changes from Manuscript to Claw with Follow Gateway theme enabled.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR adds useful theme support absent from current main, and review found no actionable defect. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe existing authenticated operator client supplies theme catalogs and change events to a connection-scoped catalog; the follower saves validated appearance selections for the existing WinUI theme applicator. flowchart LR
Gateway[Gateway themes and events] --> Client[Operator client]
Client --> Catalog[Theme catalog]
Catalog --> Settings[Settings picker]
Catalog --> Follower[Theme follower]
Settings --> Appearance[Persisted appearance]
Follower --> Appearance
Appearance --> UI[WinUI theme applicator]
Technical reviewBest possible solution: Land this layer after its stack dependencies while retaining manual choices, validated offline snapshots, and existing Windows mode and High Contrast ownership. Do we have a high-confidence way to reproduce the issue? This is a feature addition; source inspection confirms current main lacks the requested Gateway catalog and following behavior. Is this the best way to solve the issue? The catalog and follower have distinct connection and persistence responsibilities, reuse existing transport and settings owners, and form a coherent implementation without identifiable unnecessary machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c38dbcc53e7d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
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. 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 HistoryReview history (3 earlier review cycles)Reviewed November 18, 2026, 6:45 PM ET / 23:45 UTC (Revision 4). |
6c58520 to
e5988bb
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
e5988bb to
2fe3da1
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
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.
2fe3da1 to
6ebe234
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…teway Co-authored-by: Copilot App <[email protected]>
…sce catalog reads A Gateway theme reply with an escaped unpaired surrogate made JsonElement.GetString throw, which aborted the whole catalog refresh. Such a value now rejects only that theme, and parsing a themes.get reply is guarded per theme. Push events (users.prefs.changed arrives for every preference key) each started a full overlapping catalog read. Reads now run one at a time per connection with a single merged follow-up, and definition reads still queued when the connection changes are not sent. Restore the layer-3 UseMica and Appearance documentation that the merge overwrote. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Merge parent 6414b28; preserve the layer-4 theme changes unchanged. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
While the Companion is connected, the Gateway theme picker also offers the Gateway's plugin and imported themes, read with
themes.listandthemes.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'susers.prefs.changedandplugins.changedevents.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.setor writes preferences. The fixture Gateway gains agateway-themesscenario (synthetic catalog plus aselect <id>control that publishesusers.prefs.changed) for tests and proof.This is part 4 of 11 in the Companion themes stack, opened as a native GitHub stack: each PR is based on the layer below it, so this diff is only this layer's commit,
6ebe234d feat(themes): offer Gateway themes and follow the dashboard's theme. It depends on #2293 (the Mica setting).This commit is
7a2b6cb0rebased onto main1af25869, andgit range-diffshows the same patch, apart from hunk context beside theagent.identity.changedcase that #2277 added toOpenClawGatewayClient, and the corrected High Contrast sentence inDESIGN.mdcarried from the Mica layer. Evidence and validation below name the heads they ran on; in this stack7a2b6cb0is now2fe3da1d,783b9ed7is now3f14cc1fand2e98953ais now3c4cacae.Rebased again onto main
30cfe593, which includes #2307 and #2308: this commit is now6ebe234d(was2fe3da1d), andgit range-diffshows the same patch. Evidence below that names2fe3da1dor an earlier head ran on this same patch.Themes architecture
Layer 4 of 11 in the Companion themes stack. This layer reads the Gateway's theme catalog (themes.list and themes.get) so plugin and imported themes can be picked, and adds the follower that tracks the dashboard's selected theme. The nodes this pull request adds are highlighted below. For the full write-up, with code links, see OpenClaw Windows Companion: theme architecture.
flowchart TD subgraph src["Sources"] GW["Gateway"] UI["Settings page"] WIN["Windows settings"] SYNC["Daily table sync"] TBL["Built-in table"] FNT["Bundled fonts"] ARTA["Artwork images"] end subgraph proc["Processing"] CAT["Theme catalog"] FOL["Follower"] RES["Palette resolver"] PRB["WebView2 probe"] CCH["Palette cache"] MOD["Theme model"] SET["Appearance setting"] SEL["Theme selection"] ACC["Accent overlay"] end subgraph app["Application"] APL["Theme applicator"] PRJ["WinUI brushes"] RAD["Corner radii"] BKP["Mica backdrop"] ART["Chat artwork"] BUB["Lobster bubble"] BRD["Branding"] end GW -->|catalog and prefs| CAT GW -->|Control UI CSS| RES SYNC -->|regenerates| TBL TBL -->|fallback| RES RES --> PRB PRB --> CCH CCH -->|reuse| RES CAT -->|built-in names| RES CAT -->|plugin themes| MOD CAT -->|dashboard choice| FOL FOL -->|followed values| SET UI -->|manual choice| SET MOD --> SEL RES -->|built-in palettes| SEL SET --> SEL SEL --> ACC ACC --> APL WIN --> APL WIN --> BKP FNT --> PRJ APL --> PRJ APL --> RAD APL --> BKP APL --> BRD APL --> ART ARTA --> ART BKP --> BUB classDef layer fill:#ffd866,stroke:#7a5200,stroke-width:3px,color:#000000 class CAT,FOL layerWhat 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
themes.listreturns, before slower definition reads finish.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 typedselectinto the fixture Gateway's console:The saved
Appearanceafter each step (from the run's log):Standalone dialogs at this head, captured by
GatewayThemeBackdropTests(5 passed,OPENCLAW_UI_PROOF_DIRset) 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:Upgrade from the released Companion, run on a Windows 11 guest in light mode for the runtime-palette PR stacked on this one (#2301, at its earlier head
2e98953a, which contained this stack's previous 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 #2301's description.Change Type
Scope
winnodeRequired 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
30cfe593(fix: match inline code chips to the chat theme #2307), on the new stack top601932d6, which contains this commit:./build.ps1succeeded;dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 6016 passed, 0 failed, 29 skipped (existing opt-in integration skips);dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6807 passed, 0 failed;dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme|FullyQualifiedName~GatewayBuiltinThemeProbe|FullyQualifiedName~DesktopCompanionWindowTests.OpenBubble|FullyQualifiedName~ReactorMarkdownWebParity|FullyQualifiedName~ReactorToolActivityProofTests|FullyQualifiedName~WorkAlignment": 63 passed, 0 failed.1af25869, on the new stack top3c4cacae, which contains this commit:./build.ps1succeeded;dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 6012 passed, 0 failed, 29 skipped (existing opt-in integration skips);dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6801 passed, 0 failed;dotnet test ./tests/OpenClaw.Tray.UITests -r win-x64 --filter "FullyQualifiedName~GatewayTheme|FullyQualifiedName~GatewayBuiltinThemeProbe|FullyQualifiedName~DesktopCompanionWindowTests.OpenBubble|FullyQualifiedName~ReactorMarkdownWebParity"(developer machine, Windows dark mode): 33 passed, 0 failed.6c585201, this layer's first native head (this layer's own change matches this head's apart from oneDESIGN.mdsentence):./build.ps1succeeded; Shared tests with--filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 70 passed, 0 failed; Tray tests with--filter "FullyQualifiedName~Theme|FullyQualifiedName~Settings|FullyQualifiedName~Appearance|FullyQualifiedName~DesktopCompanion|FullyQualifiedName~Chat": 2576 passed, 0 failed; UI tests with--filter "FullyQualifiedName~GatewayTheme": 18 passed, 0 failed.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.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
OpenClaw.GatewayFixtureHost --scenario gateway-themes(synthetic read-only Gateway serving the built-ins and fixture plugin themes).7a2b6cb0for the build, unit tests (including the authenticated wire test), the picker listing, the follow run and the dialog captures;016f6e1bfor the guest UI tests in both Windows modes.select manuscriptandselect claw; Follow off and Windows default;dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --filter FullyQualifiedName~GatewayThemeBackdropTestswithOPENCLAW_UI_PROOF_DIRset.GatewayThemeCatalogWireTests.FollowingCompanionTracksTheGatewaySelectionPushedByPrefsEventsruns the same flow over an authenticated fixture socket on this head.Yes/No/N/A) YesSecurity Impact
Yes/No) NoYes/No) NoYes/No) YesYes/No) NoYes/No) NoYes, explain the risk and mitigation: the Companion sendsthemes.listandthemes.getover 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
Yes/No) YesYes/No) NoYes/No) NoReview Conversations