Repository navigation
chore(themes): sync the built-in Gateway theme table with the packaged Gateway release - #2220
paulcam206 wants to merge 4 commits 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 daily synchronization of built-in themes with the stable packaged Gateway, alongside the stacked Companion theme and branding features. Example: The packaged Gateway v2026.11.1-msix.0 contains upstream commit 4ffdd2047d192dd65554de3c8c46c0e0197c6e2a.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep open: this PR contains distinct work absent from main and depends on two open theme PRs; no actionable correctness finding remains, but adopting the feature and automation needs maintainer direction. Priority: P3 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherRelease-resolution scripts read verified Gateway package metadata, the generator converts upstream theme definitions and CSS into bundled palettes, and Companion applies those palettes through its appearance settings and WinUI resources. flowchart LR
A[Stable packaged Gateway] --> B[Verified payload metadata]
B --> C[Upstream theme generator]
C --> D[Generated palette table]
D --> E[Theme validation]
E --> F[Optional bot pull request]
D --> G[Companion appearance]
Technical reviewBest possible solution: After approving the theme stack, retain the existing verified release resolver and table-only synchronization workflow with publishing disabled until maintainers enable it. Do we have a high-confidence way to reproduce the issue? This proposes new functionality; the supplied real-release dry run demonstrates a mismatch between the packaged Gateway commit and the generated table's pin. Is this the best way to solve the issue? The maintenance problem is palette drift, and the invariant is that generated palettes match verified packaged sources without changing user choices; reusing the existing package resolver and publishing only the generated table is a focused solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7648d0b42a7e. 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 (1 earlier review cycle)
Reviewed November 14, 2026, 6:50 AM ET / 11:50 UTC (Revision 2). |
0464e61 to
6b17ba1
Compare
General settings can apply one of the Gateway's dashboard themes: the
built-in themes, plus plugin and imported themes read from the connected
Gateway through themes.list and themes.get. A separate "Mica backdrop"
setting chooses tinted Mica or the theme's opaque canvas, and "Follow
Gateway theme" (off by default) shows the theme selected in the
dashboard instead of the Companion's own choice.
- OpenClaw.Shared models themes, expands palettes and persists the
appearance choice; BuiltinGatewayThemes is generated from the upstream
dashboard table, and the OFL fonts the themes name are bundled.
- AppThemeApplicator recolors the bound Fluent, App and chat brushes in
the Default and Light dictionaries and swaps the UI, chat and code
fonts. App brushes and gradients bound to a Windows accent shade (the
Hub navigation indicator, usage, systems, automations and voice
visuals) take the theme's matching accent shade and return to the
Windows accent with the Windows look. High Contrast dictionaries are
never changed.
- GatewayThemeFollower records the Gateway's selected theme from
themes.list (re-read on users.prefs.changed) while following. A theme
the Companion can't render keeps the last followed theme, then the
manual choice. The Companion never calls themes.set or writes prefs.
- Theme fonts reach all text: TypographyResources.xaml re-declares the
Fluent type ramp (WinUI's styles hard-code XamlAutoFontFamily) and
anchors pages, flyouts, menus and dialogs, ThemeHelper anchors window
roots, and the chat user bubble follows the chat font.
- BackdropPolicy tints Mica or paints the opaque canvas in Mica windows
and dialogs. A window keeps its themed backdrop once adopted and resets
the tint for the Windows look, because swapping backdrops across the
theme refresh made WinUI raise ArgumentException("target").
- The gateway-themes fixture scenario serves a synthetic catalog for
proof and UI tests, and its select command changes the reported
selection.
A LayoutCycleException reaches the unhandled-exception handler with no managed stack, which left a model-picker hang on a themed install with nothing to trace. Log the active theme, the focused element and the open popups alongside the crash entry, and have Dev builds keep WinUI's layout-cycle trace (native debugger output and stowed exceptions).
Themes that drop the claw mascot (Phosphor and CRT among the built-ins) now look that way in the Companion too: the chat working indicator and the Companion's own brand spots follow the applied theme's branding. - ThemeBranding resolves the mascot, brand icon and working indicator with upstream resolveThemeBranding's defaults; unknown values count as missing. Built-in branding comes from the generated table (the generator now reads BUILTIN_THEMES' branding and fails on unknown values); plugin and imported themes take it from their descriptor, and snapshots keep it for offline restarts. - The working indicator shows the claw (Windows default), three pulsing dots in the theme accent, the brand mark, or no glyph with the run status words visible instead. - BrandMark shows the OpenClaw claw image or the dashboard's neutral mark in the theme's primary colors, in dialogs and the tray menu header, switching live. Plugin artwork brand icons fall back to the mark. Window, taskbar, tray and package icons stay the OpenClaw identity.
…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.
6b17ba1 to
78aabbe
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
This adds a daily workflow that keeps the Companion's built-in Gateway theme table current with the Gateway people actually run. It finds the latest stable openclaw-windows-packaging release (for example
v2026.11.1-msix.0), downloads and verifies its x64 MSIX, reads the openclaw commit the bundled Gateway was built from (app/dist/build-info.json) and compares it withBuiltinGatewayThemes.UpstreamRef. When they differ it regenerates the table withscripts/Update-GatewayThemeTable.ps1, runs the theme tests and opens or updates one pull request from the fixed branchautomation/gateway-theme-sync. When they match it exits without changes.A theme that names a font the Companion does not bundle fails the run before any pull request is opened (
EveryBuiltinThemeTypefaceIsBundledWithTheCompanion), with a job summary pointing atscripts/Update-ThemeFonts.ps1. Adding a font and its license stays a human step. An unknown or non-literal branding value fails the generator the same way. New upstream themes with bundled fonts sync normally: the built-in table test checks invariants rather than a pinned theme list.This PR is stacked on #2219 (theme branding), which is stacked on #2218 (Gateway themes). It contains their three commits plus one of its own; review scope is only
ci(themes): sync the built-in Gateway theme table with the packaged Gateway release(78aabbe9, patch-identical to13c328b3, where the evidence below was taken). A maintainer must provision the App before it opens pull requests: a GitHub App with Contents and Pull requests read/write on this repository, its id in the repository variableGATEWAY_THEME_SYNC_APP_ID, its private key in the secretGATEWAY_THEME_SYNC_APP_PRIVATE_KEY, and the variableGATEWAY_THEME_SYNC_ENABLED=true. Until then each run still regenerates and tests a stale table but publishes nothing. An App token is needed because pull requests opened withGITHUB_TOKENdo not start CI.What Problem This Solves
The built-in theme palettes are generated from a pinned upstream commit. Without automation the table drifts as new Gateway releases change or add themes, and nobody notices until a user picks a theme that renders differently from the dashboard.
User Impact
User impact: none directly; maintainers get a reviewed pull request whenever a new stable packaged Gateway changes the built-in themes, instead of drift.
Why This Change Was Made
Resolve-PackagedGatewayRelease,Save-PackagedGatewayArchiveandGet-PackagedGatewayMetadata(stable release, canonical tag and asset, SHA-256 and payload identity checks).docs/RELEASING.md;test-gateway-packaged-release.ps1pairsv2026.9.9-msix.0with Gateway 2026.8.20). It must also be a public openclaw/openclaw commit, since the generator reads upstream sources there. Every unresolvable step fails with a clear message instead of guessing.BuiltinTableHasEveryUpstreamThemeInBothModeschecks invariants of any regenerated table (claw present, unique ids, both modes, fonts named, dark darker than light) instead of the 11 pinned ids;Update-GatewayThemeTable.ps1already checks the table against upstreamBUILTIN_THEME_IDS.scripts/GatewayThemeUpstream.psm1so CI can test it offline; publishing lives inscripts/Publish-GatewayThemeSync.ps1rather than inline YAML.Implementation notes
.github/workflows/gateway-theme-sync.yml:schedule(daily) andworkflow_dispatch,windows-latest(has Edge andgh, which the generator needs),permissions: {}withcontents: readfor the job, a repository guard and a full-ref default-branch guard (refs/heads/<default>, so a same-named tag is refused), per-repository concurrency,persist-credentials: false.scripts/Resolve-GatewayThemeUpstream.ps1writespackaging_release,gateway_version,upstream_refandup_to_datetoGITHUB_OUTPUT; the 257 MB MSIX download takes about 18 s.fetch-depth: 0because GitVersion.MsBuild needs full history to build the test projects.scripts/Publish-GatewayThemeSync.ps1commits only the table as the App's bot user, passes the token to git as a per-command header and uses--force-with-leaseagainst the branch head it observed.ci.ymlrunsscripts/test-gateway-theme-upstream.ps1andscripts/test-gateway-theme-sync-publish.ps1beside the packaged-release provenance test.Evidence
Local dry run at
13c328b3against the real packaging release (./scripts/Resolve-GatewayThemeUpstream.ps1 -CacheDirectory <temp> -GitHubOutput <file>, 18 s including the verified 257 MB download):The workflow's next steps, run locally on that result:
./scripts/Update-GatewayThemeTable.ps1 -UpstreamRef 4ffdd204…wrote all 11 built-in themes (223 changed table lines against the main-based pin). This first failed because the release predates root definitions of--chat-composer-surfaceand a dark--bg-content; the generator now uses the same fallbacks that release's own CSS reads (var(--bg-content, var(--bg)),--chat-composer-surface: var(--popover)), and regenerating at220ca12eis still byte-identical to the committed table.dotnet test tests/OpenClaw.Shared.Tests -c Debug --filter FullyQualifiedName~GatewayTheme: 61 passed;dotnet test tests/OpenClaw.Tray.Tests -c Debug -r win-x64 --filter FullyQualifiedName~GatewayTheme: 23 passed, includingEveryBuiltinThemeTypefaceIsBundledWithTheCompanion. The table was then restored; this PR does not change it.gateway-theme-sync.ymlandci.yml.Change Type
Scope
winnodeRequired proof pools
none: repository automation only; no shipped runtime behavior changes. Proven with the offline resolution tests, a dry run against the real packaging release and actionlint.Validation
Local runs on
13c328b3unless stated. This layer's commit is patch-identical on78aabbe9; the layers beneath took #2218's and #2219's fixes, and the local build and unit tests were rerun on0464e61b(same tree as78aabbe9apart from #2218'sGatewayThemeRestoreTests.cs):./build.ps1: all builds succeeded (0464e61b).dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5937 passed, 0 failed, 29 skipped (existing opt-in integration skips) (0464e61b)dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6692 passed, 0 failed (0464e61b)./scripts/test-gateway-theme-upstream.ps1: 8 assertions passed (latest stable release maps to the commit in its payload, not its tag; annotated and matching cases; prerelease, unknown commit, unreadable payload and missingUpstreamReffail clearly)../scripts/test-gateway-theme-sync-publish.ps1: 11 assertions passed (gitandghfaked as PowerShell functions: first publish, an unchanged open pull request left untouched, a changed table pushed with a lease and the pull request updated, a declined commit and a fork pull request ignored, a current branch without an open pull request)../scripts/test-gateway-packaged-release.ps1: 62 passed (the reused release and payload checks).78aabbe9(run 43588172542): 16 jobs passed, including the new-test soak (10 of 10 runs), the UI and accessibility tests and fixture shard B. Two UI jobs failed in tests this layer does not touch, and feat(appearance): follow dashboard theme branding in the Companion #2219 passed both jobs on the same product code (its run 43588169328, all 19 jobs green):ReactorChatLayoutProofTests.ProductionRoot_AlignsColumnAndKeepsEveryComposerActionReachable(the send button's inner disc was not yet in the tree) andGatewayFixtureUiTests.SharedRootDialog_DefersNavigationAndRejectsNativeBinding(ElementNotAvailableExceptionreading an element's name, in the mock Gateway application job). Rerunning failed jobs needs repository admin rights, so they are recorded here.13c328b3, feat(appearance): follow dashboard theme branding in the Companion #2219's branding test compared a single-precision opacity exactly (fixed in feat(appearance): follow dashboard theme branding in the Companion #2219); at0464e61b, feat(appearance): apply OpenClaw dashboard themes to the Companion #2218's startup restore test failed its first run (see feat(appearance): apply OpenClaw dashboard themes to the Companion #2218's Validation; all 10 runs passed on78aabbe9).Appearancewhen a theme is picked (stable, first launch, after a restart). A regenerated table changes built-in palettes and branding, not saved fields: a built-in selection stores only its id and display name, and resolves from the table at load.78aabbe9: proof 4/6 and patch quality 4/6, no findings, nothing listed before merge ("Ready, awaiting maintainer decision"). Overall readiness stays at 3/6 because adopting the stack and the App-backed synchronization needs a maintainer decision (the review's Decision needed); the two external UI failures above are the other reason it names.Real Behavior Proof
13c328b3../scripts/Resolve-GatewayThemeUpstream.ps1,./scripts/Update-GatewayThemeTable.ps1 -UpstreamRef <resolved commit>, then the workflow's twodotnet testcommands against the regenerated table, as listed in Evidence.4ffdd204, which differs from the current table, so an enabled run would regenerate, pass the theme tests and open a sync pull request.Yes/No/N/A) N/APublish-GatewayThemeSync.ps1has not executed against GitHub.Security Impact
Yes/No) YesYes/No) YesYes/No) YesYes/No) NoYes/No) NoYes, explain the risk and mitigation: the workflow reads public release metadata and downloads the public packaged Gateway MSIX (SHA-256 verified against the release digest, never installed or executed) withGITHUB_TOKEN(contents: read). The App token (Contents and Pull requests write) is minted only after the table regenerates and its tests pass, only on this repository's default branch (compared as a fullrefs/heads/ref) and only whenGATEWAY_THEME_SYNC_ENABLEDistrue. It is never written to git config or logged, and it can write only to the bot branch and its pull request; the change still needs normal review and CI to merge.Compatibility and Migration
Yes/No) YesYes/No) YesYes/No) NoGATEWAY_THEME_SYNC_APP_ID,GATEWAY_THEME_SYNC_APP_PRIVATE_KEYandGATEWAY_THEME_SYNC_ENABLED=true. Without them the workflow publishes nothing.Review Conversations