Skip to content

feat(themes): resolve built-in palettes from the connected Gateway - #2264

Closed
paulcam206 wants to merge 11 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-11-runtime
Closed

paulcam206 wants to merge 11 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-11-runtime

Conversation

@paulcam206

@paulcam206 paulcam206 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Related: the Companion themes stack, layers 1 to 10: #2255, #2256, #2257, #2258, #2266, #2267, #2268, #2270, #2271, #2272 (it supersedes the closed #2218, #2219 and #2220).

This is the runtime-resolution layer on top of the 10-part Companion themes stack. Like the stack's other drafts it targets main and carries the commits below it; review only this PR's own commit, 2e98953a feat(themes): resolve built-in palettes from the connected Gateway. It depends on the paulcam206-themes-10-sync layer, #2272 (783b9ed7, the built-in table sync).

What Problem This Solves

Fixes: built-in Gateway themes show the Companion's bundled palettes instead of the connected Gateway's when that Gateway is older or newer than the release the bundled table was generated from.

User Impact

User impact: with a built-in theme selected (or followed), the Companion now paints the same colors, fonts and radii as the connected Gateway's own dashboard, including Gateways released after this Companion build. When the Gateway's palettes cannot be read, it keeps the bundled table exactly as before. Existing settings, pairing and device identity carry over from the released Companion unchanged.

Why This Change Was Made

Built-in palettes are a color-mix() cascade in the Control UI's CSS, so only a CSS engine can resolve them. The table generator already resolves them with a probe in headless Edge; that probe is now one shared file (ThemeProbe.js) that both the generator and the Companion run.

On each operator connection the Companion reads the Control UI's index.html, the stylesheets it links and themes/<id>.css over the existing Gateway HTTP base (no credentials, no redirects, mount-confined, size and time bounded), runs the probe in an offscreen in-private WebView2 that answers every other request with 404, validates the result, and caches it per Gateway build id. Names and branding come from the Gateway's themes.list built-in descriptors when it sends them, and the Settings picker lists the Gateway's built-ins by those names.

Fallback order: Gateway palettes, then the bundled table, then the Windows default for an id neither styles. A disabled Control UI, missing WebView2, timeout or invalid result keeps the table; a theme whose own stylesheet did not load keeps the table and is retried on the next connection; only the newest connection publishes; reconnecting to the same build or starting offline reuses the cache without a probe, and the startup theme (which fixes control geometry for the session) already comes from it. The cache is optional: malformed or stale content only costs a fresh probe. The table and the daily sync workflow stay as the fallback; the fonts stay bundled.

Evidence

Before/after on a Crabbox Hyper-V guest against a real npm Gateway [email protected] (whose built-in surfaces were retuned after the table's pinned release), Manuscript, light mode, chat home:

Manuscript light: before, the bundled table (left); after, the Gateway's palettes (right)

Left: 783b9ed7 (the layer below), bundled table. Right: 2e98953a (this PR), the Gateway's palettes.

Window canvas pixel: before #f6f1e5 (table), after #edece7 (the beta.4 dashboard paints #edece6). App log after: [Themes] Built-in palettes from the Gateway (11 themes, resolved, build 2026.11.5-beta.4-release-2c173a37a48f-…).

Upgrade from the latest stable release: a profile created and paired by the released Companion v2026.11.3 (portable zip, SHA-256 verified against the release digest, the same artifact CI's released-profile check uses) was opened by this PR's build. Settings, gateway record, device id and device token were preserved with no new pairing request. A Gateway theme was then chosen in Settings and kept across a restart. The App theme was Dark on a light-mode Windows guest:

After upgrade and restart: Settings shows App theme Dark and Gateway theme Manuscript, painted in Manuscript's dark palette

settings.json written by v2026.11.3, compared with the same file after the upgrade, theme choice and restart. The only change is the added appearance block:

   "AppTheme": "Dark",
+  "Appearance": {
+    "Theme": {
+      "Id": "manuscript",
+      "Name": "Manuscript",
+      "Source": "builtin"
+    },
+    "UseMica": true,
+    "FollowGatewayTheme": false
+  },
   "OpenTelemetryProtocol": "grpc",

Recorded-dashboard tests: scripts/Record-ControlUiThemeFixture.ps1 recorded what real 2026.9.7, 2026.11.4 and 2026.11.5-beta.4 Gateways served and what their own dashboards computed (headless Edge, each theme selected through the dashboard's saved settings, probed in place). The real WebView2 probe reproduces every token of 2026.11.4 and 2026.9.7 exactly (11 themes × 2 modes × 33 tokens, plus painted canvas). For beta.4 one token differs by one step (dash light inline code): the dashboard's page-load link order lets an equal-specificity core rule beat dash.css, while a live theme switch lets dash.css win; the probe, like the generator, follows the theme file. The test names that single known difference.

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: built-in theme colors applied to WinUI windows now come from the connected Gateway.

Validation

All on 2e98953a:

  • ./build.ps1: all builds succeeded (Shared, Cli, WinNodeCli, SetupEngine, WinUI); documentation validation passed.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 6004 passed, 29 skipped, 0 failed
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6801 passed, 0 failed
  • dotnet test ./tests/OpenClaw.Tray.UITests -c Debug -r win-x64 --filter FullyQualifiedName~GatewayBuiltinThemeProbeTests: 4 passed (real WebView2 probe vs the three recorded dashboards, plus a newly added built-in and an unstyled id).
  • scripts/Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a with the shared probe: output byte-identical to the committed BuiltinGatewayThemes.g.cs.

New focused coverage:

  • ServedGatewayThemeTests: index parsing of real served shapes; stylesheet reading; build-id and content-hash keys; probe validation that rejects path/URL font stacks, translucent window surfaces and out-of-range radii; descriptor branding; cache LRU, invalidation, corruption, malformed entries and repeated ids; and the Control UI HTTP read with no credentials, no redirects, type and size limits, and mount-confined paths.
  • GatewayBuiltinThemeResolverTests:
    • Gateway palettes replace the table and are reused for the same build, offline and at startup.
    • A probe failure or an unavailable Control UI keeps the table.
    • A theme the Gateway does not style keeps the table across a restart.
    • A theme stylesheet that failed to load keeps the table even when the probe reads it as styled, and is retried on the next connection.
    • A superseded connection never publishes and cannot make an older build the last cached one.
    • Catalog descriptors rebrand without a probe.
    • A built-in listed while a probe runs is probed once afterwards.
  • GatewayFixtureProtocolTests.ControlUiReads_AreRefusedLikeADisabledControlUi_WithoutCountingAsUnexpected: the fixture Gateway answers the client's real Control UI reads with 404, like a Gateway with its Control UI disabled, while any other plain HTTP stays a rejected upgrade.
  • GatewayThemeSettingsTests: the picker lists the Gateway's built-ins by its names and reselects a saved Gateway-only built-in once its palettes arrive.

Real Behavior Proof

  • Environment tested: Crabbox Hyper-V guest cbx_7bab69bddc8d, Windows 11 Insider 29683 primed template with the VC++ x64 14.52 redistributable (DiskIdentifier 5D83D17D), Windows in light mode. Isolated Companion profiles connected to real npm Gateways on loopback with token auth ([email protected], [email protected], and beta.4 with gateway.controlUi.enabled=false); each Companion device was approved with the Gateway's own openclaw devices approve. Earlier rounds on leases cbx_29742a00d1cf, cbx_9b585c653bdb, cbx_76a02555eb44 and cbx_bf1de6ac7b38 (same template) and cbx_4dc657ba6dc6 (clean template) showed the same results on previous heads.
  • PR head or commit tested: 2e98953a (after, this PR's head), 783b9ed7 (before, the layer below) and released Companion v2026.11.3 (upgrade source).
  • Exact steps or command run: seeded settings with Appearance.Theme = {Id: manuscript|tide, Source: builtin} and UseMica: false; launched each build; navigated with local MCP app.navigate to Settings and chat; captured the window and sampled pixels. For the upgrade, v2026.11.3 paired and changed settings through MCP app.settings.set, then this build opened the same profile, Manuscript was chosen through the Settings picker (UI Automation), and the app was restarted.
  • Evidence after fix:
    • beta.4, Manuscript light: before canvas #f6f1e5, after #edece7; log Built-in palettes from the Gateway (11 themes, resolved, build 2026.11.5-beta.4-…); cache written.
    • Offline restart of that profile with the Gateway unreachable: the first window opens with the cached beta.4 canvas (Backdrop WorkspaceWindow: Opaque ... root #FFEDECE7), so the startup theme and its control geometry come from the cache.
    • 2026.11.4, Manuscript light: palettes resolved from the Gateway; pixels identical to the table (#f6f1e5), so nothing changes where the Gateway matches the table.
    • beta.4, Tide dark: canvas #14191f and content #10151b (beta.4) instead of the table's #10161c.
    • beta.4 with the Control UI disabled (404): log Built-in palettes from the bundled table: the Gateway does not serve its Control UI here.; table pixels.
    • Upgrade from v2026.11.3: NotifyInfo, NotifyHealth, AppTheme, gateway id and url, device id and device token preserved; 0 pending device requests after the upgrade and after the restart; picker shows Manuscript after the restart; canvas #211e18.
  • Observed result: the Companion follows the connected Gateway's palettes, falls back to the table when the Control UI is not served, and keeps released profiles intact.
  • Screenshot or artifact links verified? (Yes/No/N/A): Yes. Both images are attached to this description and were read back after upload.
  • Not verified or blocked: remote Gateways behind an authenticating proxy on the Control UI path (inferred: the read fails closed to the table); WebView2 runtime absent (covered by the probe-failure test, not live); packaged (MSIX) build.

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 now GETs the connected Gateway's own unauthenticated Control UI files (index.html, linked assets/*.css, themes/<id>.css) over the HTTP base it already uses for media. Requests carry no credentials, never follow redirects, stay under the Gateway's mount (no .., //, scheme, query or off-origin paths), require the expected media type and are size and time bounded. The CSS is only evaluated in an offscreen in-private WebView2 whose every other request returns 404, so it cannot reach the network or run Gateway script. Resolved values are validated: colors must be hex and window surfaces opaque, font stacks must be plain family names (paths and URLs are rejected so a Gateway cannot make WinUI load a UNC font), radii are bounded.

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes
  • Config or environment changes? (Yes/No): Yes
  • Migration needed? (Yes/No): No
  • If yes, list the exact upgrade steps: none. Settings written by v2026.11.3 load unchanged; the only addition after a theme is chosen is the Appearance block shown above. The palette cache is a new, versioned, disposable file under the local data directory. Optional OPENCLAW_CONTROL_UI_ASSET_TIMEOUT_MS (per file, default 15000) and OPENCLAW_THEME_RESOLVE_TIMEOUT_MS (whole resolution, default 30000). Gateways with the Control UI disabled or serving an unexpected layout keep the bundled table.

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
@paulcam206
paulcam206 force-pushed the paulcam206-themes-11-runtime branch from c4f7cf6 to 6cdd173 Compare November 17, 2026 04:14
@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

This PR adds Gateway themes to Companion and resolves built-in palettes from the connected Gateway, retaining bundled palettes as fallback.

Example: Manuscript light against Gateway 2026.11.5-beta.4.

  • Before: The bundled palette paints the canvas #f6f1e5.
  • After: The runtime palette paints #edece7, closely matching the dashboard's #edece6.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong supplied runtime and upgrade evidence supports the implementation; overall readiness remains capped by the unresolved product direction.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Current-head native screenshots and supplied runtime logs exercise real npm Gateways on an isolated Windows guest, showing changed Manuscript colors, offline cache reuse, disabled-Control-UI fallback, and retained theme selection after upgrade and restart.
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: A bundled built-in palette can differ from the dashboard of an older or newer connected Gateway.
Reason: Visible parity has demonstrated value, but the runtime CSS dependency and cumulative appearance options have no recorded owner approval.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep this PR open: it adds distinct functionality absent from main, but adopting internal Gateway CSS as a runtime dependency still needs an owner decision.

Priority: P3
Reviewed head: 2e98953a7a47f406a88209a641c86cf2c6dd8505
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Companion resolve built-in palettes from internal Gateway CSS at runtime, or retain generated palettes while pursuing a supported Gateway palette contract?
  • Recommendation: Pursue a supported palette contract: Retain bundled palettes while proposing versioned built-in palette data from Gateway, then consume that supported surface.
  • Why: The implementation demonstrates useful results, but its producer artifacts are explicitly unsupported as a contract and no recorded owner decision settles that dependency.

Before merge

None.

Findings

None.

Agent review details

How this fits together

The operator client reads Gateway stylesheets, an isolated WebView2 resolves their tokens, and the existing appearance path applies validated palettes to native windows with a persistent cache and bundled fallback.

flowchart LR
Gateway[Connected Gateway] --> Reader[Bounded stylesheet reader]
Reader --> Probe[Isolated WebView2 probe]
Probe --> Resolver[Validated theme resolver]
Cache[Palette cache] --> Resolver
Bundle[Bundled palettes] --> Resolver
Resolver --> UI[Native Companion appearance]
Loading

Technical review

Best possible solution:

Use an owner-approved palette source through the existing appearance resolver while preserving bundled fallback and saved preferences.

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

This is new functionality; supplied current-head screenshots and logs demonstrate the bundled-versus-connected palette difference without a reviewer-run reproduction.

Is this the best way to solve the issue?

The shared probe, validated source seam, cache, and retained fallback form a coherent implementation; the remaining question is whether internal CSS is an acceptable product dependency.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Windows light and dark preference keeps the original intent (1fb28ee: The Settings reorganization established explicit App theme preference application; this change retains that preference while adding palette application.)
  • Reactor theme resources and High Contrast keeps the original intent (refactor(chat): use Reactor theme resources #1084: The earlier change moved theme resolution into WinUI/Reactor resources to preserve accessibility and avoid the legacy contrast-event lifecycle.)
  • Native Markdown presentation keeps the original intent (improve(chat): assistant Markdown follows the web chat's spacing, tones and code colors #2101: Native assistant Markdown was aligned with the dashboard's spacing, tones, and code colors; the changed font and radius paths retain those presentation roles.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Runtime implementation and fallback: The resolver reads the connected Gateway, validates probe results, excludes failed theme stylesheets, and falls back without publishing superseded connection results. (src/OpenClaw.Tray.WinUI/Theming/GatewayBuiltinThemeResolver.cs:144, 2e98953a7a47)
  • Explicit producer-contract boundary: The stylesheet reader explicitly identifies its inputs as internal build artifacts rather than a Gateway contract; the architecture ledger anticipates replacing this path when themes.get supplies built-in definitions. (src/OpenClaw.Shared/Themes/ServedThemeStylesheets.cs:37, 2e98953a7a47)
  • Verified dependency contract: The patch consumes this repository's theme descriptors and Control UI CSS as its palette oracle. At the generator's pinned producer revision, themes.get returns definitions only for entries carrying a definition, while the dashboard loads built-in themes from themes/<id>.css. (src/gateway/server-methods/themes.ts, 4ffdd2047d19)
  • Current-head behavior and upgrade evidence: Both downloaded screenshots were inspected: the before/after capture shows the palette change, and the upgrade capture shows Dark plus Manuscript selected. The complete PR body supplies matching current-head logs for resolution, offline restart, disabled-Control-UI fallback, and preservation of the v2026.11.3 profile and pairing. (2e98953a7a47)
  • Main and related work: The fetched main tree has neither the new theme model directory nor the runtime theming directory. The dependency chore(themes): sync the built-in Gateway theme table with the packaged Gateway release #2272 remains open; related theme searches found the separate stack layers rather than a merged replacement. (a0a2a24ec1dd)
  • Discussion and workflow state: The complete body, contributor comments, reviews, and relevant predecessor discussions provided no maintainer approval of runtime CSS resolution. This PR remains draft and GitHub reports it mergeable; current-head checks remain in progress, with no completed failing check establishing a patch defect. (2e98953a7a47)

Likely related people:

  • Karen: Raw commit ff19012 adds src/OpenClaw.Tray.WinUI/App.xaml:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ff1901275a41; files: src/OpenClaw.Tray.WinUI/App.xaml)
  • Scott Hanselman: Raw commit eae6626 adds src/Moltbot.Tray.WinUI/Helpers/ThemeHelper.cs:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: eae6626635ba; files: src/Moltbot.Tray.WinUI/Helpers/ThemeHelper.cs)

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:

No label changes.

Label justifications:

  • P3: Optional appearance parity improves polish without blocking connection, chat, or recovery.
  • 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 (3 earlier review cycles)
  • reviewed 2026-11-17T04:43:08.097Z sha 6cdd173 :: needs real behavior proof before merge. :: [P3] Reject nonfinite fixture background strengths
  • reviewed 2026-11-17T07:56:18.825Z sha 89e67bf :: ready, awaiting a maintainer decision. :: none
  • reviewed 2026-11-17T10:23:59.443Z sha a870f2a :: ready, awaiting a maintainer decision. :: none

Reviewed November 17, 2026, 6:25 AM ET / 11:25 UTC (Revision 4).

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.
The generator now resolves each built-in's radius-sm, radius-md and
corner scale, reading the circular geometry WinUI draws (Edge's 1.25
squircle compensation is neutralized; CRT's own 0.25 still wins).

Controls take the small and medium radii (ControlCornerRadius,
OverlayCornerRadius) from the theme in effect at startup and keep them
for the session. WinUI resolves a control style's radius when the first
control of that type is created, so a later change would reshape some
control types and not others. Chat surfaces scale their radii by the
theme's corner scale and follow every switch, including mounted
messages that do not render again. Windows default and High Contrast
keep Fluent's geometry.
While following the Gateway theme, the Companion reads the person's
saved dashboard accent (users.prefs.get ui.accent, operator.read) with
themes.list and re-reads it on users.prefs.changed. A hex accent is
drawn over the theme's accent tokens exactly as the Control UI's
applyControlUiAccent does, so the user bubble takes the same 16% wash.
"theme" or unset uses the theme's own accent; an unknown read (no
durable profile, older Gateway, failure) keeps the last followed accent,
which is persisted for offline starts. Nothing is written back.
Bundle the Control UI's light and dark artwork for each built-in theme
(and its neutral pair for plugin and imported themes), re-encoded as PNG
from the pinned release's lossless WebP by
scripts/Update-ThemeBackgrounds.ps1. Chat draws it behind the new-chat
surface and conversations with the dashboard's ui.background model:
faded or full-bleed, visibility and the two placement toggles. While
following, the person's dashboard choice is read with users.prefs.get
and followed live; otherwise Settings offers the Companion's own style
and strength. Windows default, High Contrast and transparency effects
off show no artwork. A custom dashboard image is not fetched yet.
@paulcam206
paulcam206 force-pushed the paulcam206-themes-11-runtime branch from 35129ec to 89e67bf Compare November 17, 2026 07:48
@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 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
@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. labels Nov 17, 2026
@paulcam206
paulcam206 force-pushed the paulcam206-themes-11-runtime branch from 89e67bf to a870f2a Compare November 17, 2026 10:17
@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:

The desktop lobster's notification and quick-chat bubble lives in a
windowed popup that neither AppThemeApplicator nor BackdropPolicy
reached. Its translucent Fluent fill, which the theme projection skips,
stayed grey under every theme.

PopoverSurfacePolicy chooses the bubble's backdrop, fill and stroke
through ThemeBackdropPolicy, like Mica windows: a Gateway theme paints
the dashboard toast's opaque --popover and --border with the acrylic
removed, Windows default keeps Fluent's acrylic with the Mica setting on
and its opaque flyout fill with it off, and High Contrast keeps Fluent's
resources. DesktopCompanionWindow re-applies it on
BackdropPolicy.Configured and when the bubble's light/dark mode changes,
without replaying the entrance.

The stock DesktopAcrylicBackdrop on a popup follows the application
theme (the Windows app mode), so a dark Companion on light Windows drew
white text on white acrylic. PopoverAcrylicBackdrop drives a
DesktopAcrylicController with the bubble's own theme.

A source-text test that grepped for the stock backdrop is replaced by
behavioral UI tests.
The Hub follows the applied theme's working indicator and brand icon,
resolved like upstream resolveThemeBranding: the snappy claw, a dots
indicator in the theme accent, a pulsing brand mark, or no glyph (the
run status words stay visible). In-app brand spots (dialog headers, the
tray menu header) show the claw or the theme's mark; plugin artwork
brand icons fall back to the mark. The generator carries the built-in
branding fields, failing on unknown values. Windows default keeps the
claw everywhere; window, taskbar, tray and package icons stay the
OpenClaw identity. High Contrast only changes colors.
…ateway release

A daily workflow reads the openclaw commit that the latest stable openclaw-windows-packaging release ships from its verified payload, regenerates BuiltinGatewayThemes.g.cs when it moved, runs the theme tests (including the bundled-font check) and opens or updates one pull request from automation/gateway-theme-sync with a GitHub App token. Resolution lives in scripts/GatewayThemeUpstream.psm1 with offline tests in CI; the built-in table test now checks invariants instead of a pinned theme list so new upstream themes can sync.
The Companion's built-in Gateway themes came only from the bundled table, so
a Gateway older or newer than the pinned release showed palettes its own
dashboard does not. The Companion now reads the stylesheets the connected
Gateway's Control UI serves, resolves them with the same probe the table
generator uses (ThemeProbe.js) in an offscreen WebView2, and applies them,
with names and branding from the Gateway's themes.list descriptors.

The bundled table stays the fallback: a disabled Control UI, a missing
WebView2 runtime, a timeout or an invalid result keeps it, and ids neither
source styles keep the Windows default look. Results are cached per Gateway
build, so reconnecting and starting offline need no probe.

Tests compare the probe with what real 2026.9.7, 2026.11.4 and
2026.11.5-beta.4 dashboards computed, recorded by
scripts/Record-ControlUiThemeFixture.ps1.
@paulcam206
paulcam206 force-pushed the paulcam206-themes-11-runtime branch from a870f2a to 2e98953 Compare November 17, 2026 11:18
@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

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