Skip to content

feat(themes): model the OpenClaw dashboard themes - #2255

Closed
paulcam206 wants to merge 1 commit into
openclaw:mainfrom
paulcam206:paulcam206-themes-01-model
Closed

paulcam206 wants to merge 1 commit into
openclaw:mainfrom
paulcam206:paulcam206-themes-01-model

Conversation

@paulcam206

@paulcam206 paulcam206 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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's themes.list/themes.get wire shapes and limits, expands plugin palettes, enforces a 3:1 legibility floor, and adds a tolerant persisted Appearance setting. Built-in palettes come from BuiltinGatewayThemes.g.cs, which scripts/Update-GatewayThemeTable.ps1 generates by resolving the Control UI cascade in headless Edge. It's pinned to openclaw/openclaw 4ffdd204, 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 main and 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

  • The Gateway's themes.list returns 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.
  • Derived surfaces are modeled explicitly because the dashboard computes them in CSS (color-mix()). Without them the Companion rendered lighter, greyer surfaces than the dashboard.
  • Every value is validated: wire definitions against upstream's limits, and colors against a 3:1 text legibility floor measured on the surfaces as drawn (the canvas, the chat shell, cards, and the composer's 78% fill over the shell), so an unreadable plugin theme is never applied.

Evidence

  • scripts/Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a regenerates BuiltinGatewayThemes.g.cs byte-identically on this head.
  • 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: Appearance is 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, #211E18 and #2C2920, exactly the dashboard's values. The earlier themes build ee37371f, without these derived surfaces, rendered #26241D, #25221B and #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 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

  • none: this PR adds shared model code and a generated table with no UI or runtime path; it's proven by unit tests and a generator run. The visible behavior is proven in the PRs that apply it.

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 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a then git diff --exit-code: the regenerated table is identical to the committed one.
  • 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.

Real Behavior Proof

  • Environment tested: Windows 11 developer machine with Microsoft Edge and an authenticated gh.
  • PR head or commit tested: 429d16c2
  • Exact steps or command run: .\scripts\Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a, then git diff --exit-code src/OpenClaw.Shared/Themes/BuiltinGatewayThemes.g.cs.
  • Evidence after fix: the regenerated table is identical to the committed one; the theme tests above pass.
  • Observed result: 11 built-in themes, each with a light and dark palette, fonts, radii and branding, resolved from upstream CSS.
  • Screenshot or artifact links verified? (Yes/No/N/A) N/A
  • Not verified or blocked: none for this layer.

Security Impact

  • New permissions or capabilities? (Yes/No) No
  • Secrets or tokens handling changed? (Yes/No) No
  • New or changed network calls? (Yes/No) No
  • 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: N/A. The generator is a developer script; it reads upstream files through gh and runs headless Edge on a temporary local page.

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. Settings files without Appearance keep the Windows look; malformed Appearance values fall back field by field.

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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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 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.

  • Before: Companion loads its existing Windows theme preference.
  • After: The same preference loads unchanged, with no Gateway theme selected; this PR does not change rendering.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The earlier defect is addressed and compatibility evidence is now supplied; model coverage is chiefly unit-level, CI is incomplete, and product direction remains unresolved.
Proof confidence 🦐 gold shrimp (3/6) ✨ media proof bonus Sufficient (linked_artifact): This layer has no rendered application path; its generator evidence and focused tests support construction, while the inspected follow-on upgrade record and restart screenshot cover preservation of the shared Appearance selection.
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: Companion cannot use the dashboard's theme colors and fonts.
Reason: The model supports a concrete application stack, but persistent dashboard-theme customization expands the established appearance surface and needs owner direction.

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
Reviewed head: 429d16c221fe9b554ba60b3f95c372c229b25b85
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Companion adopt this dashboard-theme foundation and its persisted Appearance selection?
  • Recommendation: Approve the staged foundation: Accept the shared model while preserving Windows defaults and reviewing theme application in its consuming PR.
  • Why: This introduces optional appearance customization and a stored configuration surface; the inspected discussion contains no written owner approval of that direction.

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Existing Windows theme preference keeps the original intent (1fb28ee: Added System, Light, and Dark preferences during the Settings and diagnostics reorganization; the new Appearance field leaves that preference and its default intact.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

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.

Review metrics

Metric Value Why it matters
Introduced code C# +2091, including generated palettes +720; generator +214; tests +314 Growth establishes a separate theme representation and pinned upstream data; the simplification pass found no definite redundant production owner.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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: This optional appearance foundation changes no rendered UI and addresses no urgent broken workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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.

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-17T01:44:21.257Z sha 952a061 :: needs real behavior proof before merge. :: [P2] Validate contrast against the composited composer fill

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.
@paulcam206
paulcam206 force-pushed the paulcam206-themes-01-model branch from 952a061 to 429d16c Compare November 17, 2026 06:39
@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: 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