Repository navigation
feat(themes): model the OpenClaw dashboard themes - #2291
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 shared Gateway theme models, color conversion, generated palettes, legibility checks, and optional persisted appearance settings. Example: A user upgrades from Companion v2026.11.3 with App theme set to Dark.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored foundation is absent from current main, supports an active theme stack, and has no actionable correctness or security findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared library converts Gateway theme JSON, bundled palette data, and saved appearance choices into validated theme values for later Companion rendering layers. flowchart TD
A[Gateway theme JSON] --> B[Protocol parser]
C[Generated built-in palettes] --> D[Appearance resolver]
E[Saved appearance settings] --> D
B --> F[Palette expansion]
F --> G[Legibility validation]
G --> D
D --> H[Future theme applicator]
Technical reviewBest possible solution: Land this coherent shared-model layer while retaining the existing Windows appearance default and leaving rendering to the dependent layer. Do we have a high-confidence way to reproduce the issue? This is a feature addition; source confirms current main lacks the shared Gateway theme model. Is this the best way to solve the issue? The smallest coherent foundation needs protocol parsing, palette conversion, and tolerant persistence; the additions serve that boundary without introducing a competing runtime theme owner. 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: No label 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 18, 2026, 6:44 PM ET / 23:44 UTC (Revision 3). |
26fda94 to
06874d8
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
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.
06874d8 to
bbdefc6
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
The OpenClaw dashboard ships eleven built-in themes, plus plugin and imported themes served by the Gateway, but the Windows Companion only knows Fluent light and dark. This PR adds the shared model the Companion's theme support builds on. Nothing applies a theme yet, so there's no user-visible change.
It parses CSS colors (CSS Color 4, including
color-mix()results), resolves the dashboard's palette tokens for light and dark, and derives the surfaces the Control UI computes in CSS rather than declaring as tokens: the sidebar mix, the opaque shell, the 78% composer fill and the accent-subtle user bubble. It also models the Gateway'sthemes.list/themes.getwire shapes and limits, expands plugin palettes, enforces a 3:1 legibility floor, and adds a tolerant persistedAppearancesetting. Built-in palettes come fromBuiltinGatewayThemes.g.cs, whichscripts/Update-GatewayThemeTable.ps1generates by resolving the Control UI cascade in headless Edge. It's pinned to openclaw/openclaw4ffdd204, the commit the packaged Gateway 2026.11.1 ships. The generator fails closed: a theme id the stylesheets don't style can't silently inherit the default palette.This is part 1 of 11 in the Companion themes stack, opened as a native GitHub stack: each PR is based on the layer below it, so its diff is only that layer. This PR is based on
main, has a single commit,bbdefc6a feat(themes): model the OpenClaw dashboard themes, and no dependencies.This commit is
429d16c2rebased onto main1af25869, andgit range-diffshows the same patch plus one fix from this PR's first hosted review: the font-family grammar also accepts identifiers that start with--, as the Gateway'sFONT_IDENTIFIERdoes (DefinitionAcceptsEveryFontIdentifierTheGatewayAccepts). Evidence and validation below name the heads they ran on; in this stack429d16c2is now06874d8c,783b9ed7is nowce53645band2e98953ais now539aa55e.Rebased again onto main
30cfe593, which includes #2307 and #2308: this commit is nowbbdefc6a(was06874d8c), andgit range-diffshows the same patch. Evidence below that names06874d8cor an earlier head ran on this same patch.Themes architecture
Layer 1 of 11 in the Companion themes stack. This layer adds the shared theme model the rest of the stack builds on: CSS color parsing, palette tokens and derived surfaces, the 3:1 legibility floor, plugin palette expansion, the Gateway theme wire shapes, the generated built-in table, the persisted Appearance setting, and the resolver that selects a theme from that setting. 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 MOD,TBL,SET,SEL layerWhat Problem This Solves
The Companion has no model of the dashboard's themes, so it can't offer or render them.
User Impact
User impact: there's no user-visible change in this PR. It adds the data model and generated built-in palettes that the following PRs apply.
Why This Change Was Made
themes.listreturns built-ins as descriptors only. Their colors live in the Control UI's CSS cascade, so the Companion needs a resolved table, generated from a pinned upstream ref rather than hand-copied.color-mix()). Without them the Companion rendered lighter, greyer surfaces than the dashboard.Evidence
A real Gateway's theme payload through this head's model: npm
[email protected]ran on loopback with token auth, an isolated state directory and a local theme-only plugin,brandfonts, whose dark palette sets"font-sans": "--brand, sans-serif"and"font-mono": "--brand-mono, monospace". The Gateway's plugin loader validated the definition with its ownnormalizeThemeDefinitionand served it.openclaw gateway call themes.listandopenclaw gateway call themes.get --params '{"id":"brandfonts/brand-fonts"}'captured its results, and a small console program built against each head'sOpenClaw.Sharedpassed them toGatewayThemeProtocol.ParseList,GatewayThemeProtocol.TryParseDefinitionandThemePaletteExpander.Expand. The previous head rejects the definition the Gateway serves, so a Companion would fall back to the Windows look; this head accepts it:scripts/Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2aregeneratesBuiltinGatewayThemes.g.csbyte-identically on this head (06874d8c, rerun after the rebase).The derived shell, sidebar and composer fill match pixels sampled from the Control UI in Edge for Manuscript dark on Gateway 2026.11.1 (
GatewayThemeTests.DerivedSurfacesMatchControlUiPixels); every built-in in both modes passes the legibility floor, and a theme readable only on an opaque composer is rejected (GatewayThemeTests.GatewayThemeWithUnreadableTextIsNeverApplied).Settings compatibility:
Appearanceis an optional, additive field. Settings without it, or with a malformed one, keep every other setting and load as Windows default (MalformedAppearanceNeitherDiscardsSettingsNorAppliesATheme); a selected Gateway theme survives a save and reload (SelectedGatewayThemeSurvivesSettingsRoundTrip). CI's "Run latest stable profile compatibility" step opens a profile written by the latest stable portable release with this head and checks that gateways, identities and preferences are preserved.Applied in the next PR, the Manuscript dark canvas, sidebar and composer render
#211E18,#211E18and#2C2920, exactly the dashboard's values. The earlier themes buildee37371f, without these derived surfaces, rendered#26241D,#25221Band#3B372F.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
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 top539aa55e, 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"(developer machine, Windows dark mode): 29 passed, 0 failed.06874d8citself:./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": 2550 passed, 0 failed. The newDefinitionAcceptsEveryFontIdentifierTheGatewayAcceptsfails both--cases without the fix.On
429d16c2:./build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 67 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": 2550 passed, 0 failed../scripts/Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2athengit diff --exit-code: the regenerated table is identical to the committed one.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.Real Behavior Proof
gh; a real Gateway, npm[email protected], on127.0.0.1with token auth, an isolated state directory and the theme-only pluginbrandfontsloaded throughplugins.load.paths.06874d8c(this head) and26fda940(this PR's previous head, before the font grammar fix).openclaw gateway call themes.list --jsonandopenclaw gateway call themes.get --json --params '{"id":"brandfonts/brand-fonts"}'against that Gateway, then a console program built against each head'ssrc/OpenClaw.Sharedparsing both results;.\scripts\Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a, thengit diff --exit-code src/OpenClaw.Shared/Themes/BuiltinGatewayThemes.g.cs.--brandfont stacks, which the previous head rejected (theme.dark fonts must contain only font family names). The generator resolves 11 built-in themes, each with a light and dark palette, fonts, radii and branding, from upstream CSS.Yes/No/N/A) N/A: text output is inline.themes.importneeds an authenticated profile, so the plugin route was used; both reach the Companion through the same definition parser).Security Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation: N/A. The generator is a developer script; it reads upstream files throughghand runs headless Edge on a temporary local page.Compatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoAppearancekeep the Windows look; malformedAppearancevalues fall back field by field.Review Conversations