Repository navigation
feat(themes): model the OpenClaw dashboard themes - #2255
paulcam206 wants to merge 1 commit into
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: ready, awaiting a maintainer decision. What this changesAdds shared dashboard-theme models, generated built-in palettes, Gateway response parsing, legibility validation, and optional persisted appearance settings. Example: An existing settings.json contains AppTheme="Dark" and no Appearance field.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep open: this coherent theme foundation is absent from main and supports the open application stack; the earlier contrast finding is fixed, while adopting the appearance feature still needs an owner decision. Priority: P3 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared layer converts bundled palettes, Gateway theme JSON, and saved appearance selections into validated colors and fonts for later native UI consumers. flowchart LR
A[Pinned upstream CSS] --> B[Table generator]
B --> C[Bundled palettes]
D[Gateway theme JSON] --> E[Protocol parser]
E --> F[Appearance resolver]
C --> F
G[Saved appearance] --> F
F --> H[Resolved theme]
Technical reviewBest possible solution: Retain the focused shared model, existing Windows defaults, and composited-surface legibility checks if the appearance owner accepts the staged feature. Do we have a high-confidence way to reproduce the issue? This is a feature foundation rather than a current-main bug report; source confirms that main lacks the proposed dashboard-theme model. Is this the best way to solve the issue? The parser, generated table, palette expansion, and tolerant settings converter form a coherent independent stage, with no demonstrated need for another abstraction or validation layer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a0a2a24ec1dd. Provenance checked
TestingProof path: unit tests only. 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 HistoryReview history (1 earlier review cycle)
Reviewed November 17, 2026, 1:44 AM ET / 06:44 UTC (Revision 2). |
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.
952a061 to
429d16c
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Superseded by # in native stack #2302. |
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 10 in the Companion themes stack. Pull requests from a fork can't be stacked natively, so every PR in the stack targets
mainand carries the commits of the PRs below it. This PR has a single commit,429d16c2 feat(themes): model the OpenClaw dashboard themes, and no dependencies.What 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
scripts/Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2aregeneratesBuiltinGatewayThemes.g.csbyte-identically on this head.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).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.#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 (#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
Validation
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.429d16c2.\scripts\Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a, thengit diff --exit-code src/OpenClaw.Shared/Themes/BuiltinGatewayThemes.g.cs.Yes/No/N/A) N/ASecurity 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