Repository navigation
feat(appearance): apply OpenClaw dashboard themes to the Companion - #2218
paulcam206 wants to merge 3 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 optional dashboard palettes, bundled fonts, Mica controls, and live Gateway theme following to Companion. Example: Select Manuscript in Settings > General > Gateway theme.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep open: this PR contains useful appearance functionality absent from main, with no definite introduced correctness bug found; adopting the new appearance controls remains an owner decision. Priority: P3 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherLocal appearance settings, bundled palettes, and authenticated Gateway theme data feed a native applicator that updates WinUI resources, windows, dialogs, and mounted chat. flowchart LR
A[Appearance settings] --> D[Appearance resolver]
B[Bundled palettes] --> D
C[Gateway theme catalog] --> D
D --> E[WinUI applicator]
E --> F[Windows and dialogs]
E --> G[Mounted chat]
Technical reviewBest possible solution: Keep the optional palette-and-font foundation integrated with existing settings, connection, and window owners while preserving Windows defaults. Do we have a high-confidence way to reproduce the issue? This is a feature proposal; main lacks dashboard-theme selection, and inspected native screenshots demonstrate the proposed behavior. Is this the best way to solve the issue? The catalog, resolver, and applicator have distinct responsibilities and reuse existing persistence, operator transport, and window lifetimes; this is a coherent independently reviewable stage. 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:
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 14, 2026, 6:55 AM ET / 11:55 UTC (Revision 2). |
13691ff to
5fcb5d7
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).
5fcb5d7 to
a97f2fc
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
The Companion can now look like the OpenClaw dashboard. Settings › General › Gateway theme applies any of the dashboard's 11 built-in themes, plus plugin and imported themes read from the connected Gateway, to the Hub, chat, dialogs, flyouts and the desktop companion: colors, UI/chat/code fonts, accent visuals and a tinted Mica backdrop. Windows default keeps today's look, and Windows High Contrast always wins.
Follow Gateway theme (off by default) shows the theme selected in the dashboard instead of the Companion's own choice and switches live when it changes there. The Companion only reads the Gateway's theme catalog (
themes.list,themes.get); it never callsthemes.setor writes preferences. Built-in palettes come from a table generated from upstream source, so no Gateway change is needed, and the fonts the themes name are bundled under the OFL.This is the first of three stacked draft PRs; theme branding and a scheduled theme-table sync build on it and link back here. Product code on this head (
a97f2fcc) is unchanged since13691ff3, where the upgrade, High Contrast and validation runs below were taken;a97f2fccchanges onlyGatewayThemeRestoreTests.cs. The theme gallery is fromfeb7b394, and the fixes since then (listed under Validation) change restore, startup and accessibility paths, not these live-switched renderings. Light and dark still follow the Windows/App theme setting rather than the dashboard's mode preference; that is a deliberate first step, called out under Compatibility.What Problem This Solves
The Companion only offers Windows light and dark, so it looks unrelated to the OpenClaw dashboard people use beside it, which ships many themes.
User Impact
User impact: people can give the Companion the same theme as their OpenClaw dashboard, chosen in Settings or followed automatically from the connected Gateway; nothing changes until they pick one.
Why This Change Was Made
themes.list/themes.get, snapshotted so a chosen theme still renders offline.themes.listreturns, before any per-theme definition read.Implementation notes
OpenClaw.Shared/Themes: wire parsing and validation (GatewayThemeProtocol), palette expansion (ThemePaletteExpander), legibility floor (ThemeLegibility), persistedAppearanceSettings(malformed values fall back field by field),BuiltinGatewayThemes.g.csfromscripts/Update-GatewayThemeTable.ps1.OpenClaw.Tray.WinUI/Theming:GatewayThemeCatalog(connection-scoped, re-read onplugins.changed/users.prefs.changed, at most four definition reads at a time),GatewayThemeFollower,AppThemeApplicator,ThemeResourceProjection,BackdropPolicy(Mica tint and the UI font for standalone dialogs).Themes/TypographyResources.xamlre-declares the Fluent type ramp so every text style takes the theme font. Chat Markdown records whether each element got the body or code font, so a theme that uses one font stack for both cannot turn prose into code after a later switch.gateway-themesfixture scenario serves a synthetic catalog for UI tests and proof;select <id>changes its reported selection and publishesusers.prefs.changed.LayoutCycleException, so a recurrence leaves evidence.Evidence
Native Windows 11 guest, fixture Gateway with synthetic content, Companion built from
feb7b394, App theme Dark, captured by a UI Automation script (Settings › General, then chat with a running reply):Follow Gateway theme, driven by the fixture Gateway's
selectcontrol (it publishesusers.prefs.changedlike the dashboard does):Tide with Mica on and off: Mica on, Mica off. Phosphor: Settings, chat.
Upgrade from the latest stable release, on a Windows guest in light mode with the Companion's App theme set to Dark. The stable v2026.11.1 portable build (
04f413d2) runs first under the fixture Gateway with an isolated profile and changes App theme and notifications in its own Settings; this head then starts on the profile it wrote, a Gateway theme is picked, and the app restarts:Settings file fields at each step (values only; the raw file is not published): stable wrote 69 keys with
AppTheme=Dark,ShowNotifications=Trueand noAppearance; this head's first launch left all 69 unchanged; picking Manuscript added onlyAppearance(Theme=manuscript,FollowGatewayTheme=False, 70 keys); after the restart all values and the theme were intact. The same restart before the startup fix below rendered light controls and unreadable text in the dark window.High Contrast still wins on a real system switch. With Manuscript applied on that upgraded profile, Windows High Contrast was turned on and off again (
SPI_SETHIGHCONTRAST); the before and after shots differ in 0.01% of pixels (a 1 px strip at the window's top edge). Three Windows light/dark switches with the theme applied (AppsUseLightThemeplus theImmersiveColorSetbroadcast) left the window pixel-identical.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: theme application changes visible WinUI surfaces (Settings, chat, flyouts, dialogs, backdrop); proven with native UI tests and screenshots on an interactive Windows guest.Validation
Local build and unit tests on
13691ff3; product code and the Shared and Tray test projects are identical ona97f2fcc:./build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5929 passed, 0 failed, 29 skipped (existing opt-in integration skips)dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6692 passed, 0 faileddotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-x64 --filter "FullyQualifiedName~GatewayTheme|FullyQualifiedName~ChatToolInputSyntaxTests|FullyQualifiedName~ChatThemeProofScope|FullyQualifiedName~ReasoningPicker|FullyQualifiedName~SettingsPageInsetTests|FullyQualifiedName~ChatMarkdown"on the native guest (interactive session, isolated tray profile): 45 passed, 0 failed;GatewayThemeTypographyTestswithGatewayThemeRestoreTests3 of 3 repeated runs passed.a97f2fcctest source (guest):GatewayThemeRestoreTestspassed with Windows in light mode, in dark mode and withOPENCLAW_UI_TEST_APP_THEME=Dark; the CI soak's 8-test selection passed 3 of 3 runs;AThemeAppliedBeforeAnythingRenders…alone as the first test in a process passed 7 of 7 (light, dark, and 3 runs with four CPU burners).a97f2fcc(run 43588162715): 17 jobs passed, including the UI, functional and accessibility tests, both fixture UI shards, the layout shard and the new-test soak (10 of 10 runs). One job failed: Revocation recovery E2E (WSL Latest), whereRealGateway_DeviceRemoval_RecoversThroughSharedTokenReconnecttimed out after 60 s runningnetsh interface ipv4 show dynamicport tcpbefore any Companion code ran. It passed on this PR's earlier heads. A rerun needs repository admin rights, so it is recorded here as an external runner failure.feb7b394, each with a regression test that fails on the earlier code (A/B on the guest):ChatToolInputSyntaxTestsLight and Dark). Each brush is now resolved under its own mode before its color is captured.GatewayThemeRestoreTests.ClearingAThemeRestoresEachModesOwnTextColor.GatewayThemeRestoreTests.AThemeAppliedBeforeAnythingRendersLeavesUnthemedBrushesOnEachModesOwnColor.GatewayThemeRestoreTests.ClearingAThemeAppliedUnderHighContrastRestoresEachModesOwnTextColor.MountedProseAndCodeStayApartAfterAThemeThatUsesOneFontForBothforces a collection to prove it.DefaultMenuFlyoutPresenterStyleagain, with the theme font as a setter (CI:ReasoningPicker_MenuFocusAndDismissalDoNotCommit). That test now compares the base style's setters instead of the instance: withTypographyResourcesmerged ahead ofChatResources, WinUI gives the picker its own instance of the stock style. A guest probe showed identical resolved border, background and item colors in dark and light surfaces with and without that dictionary.AutomationProperties.LabeledBy), as the hosted review asked.SettingsPageInsetTests.AppearanceControlsTakeTheirAccessibleNamesFromTheirLocalizedHeaders.GatewayThemeTests(follow decision, malformed settings, unreadable themes never applied),GatewayThemeCatalogWireTests.FollowingCompanionTracksTheGatewaySelectionPushedByPrefsEvents(authenticated fixture socket), andGatewayThemeSettingsTests(reconnect re-read, save-failure isolation, picker,SelectionIsPublishedBeforeASlowThemeDefinitionArrives).ContainsKeycheck that also reached merged, global and High Contrast resources; the High Contrast capture above; a restore test that could pass on the old code depending on order; the user bubble keeping a font role after unmount; the restore test's setup check, which only held when the test app ran in light mode and now forces the other mode's value onto whichever mode the app is not running in). The final delta reported no significant issues. The reviewer's open question, whether a real High Contrast switch restores the theme, is answered by the High Contrast cycle in Evidence.697f3c6c(feat(appearance): follow dashboard theme branding in the Companion #2219, chore(themes): sync the built-in Gateway theme table with the packaged Gateway release #2220) failed its first run ofAThemeAppliedBeforeAnythingRenders…when it ran first in its process (light text kept the Windows color). It passed every guest variant above and all 20 soak runs on the next heads. The test now reports, on failure, which brush instance each mode renders, which instance an off-tree element of that mode resolves, and the applicator's log. The real app's startup path is covered by the upgrade run.AutomationsResponsiveLayoutTests(steady-resource step; that process runs no theme tests),UsagePageRenderingTests.Resizing_…(failed at test 287 of 1244, before any theme test; feat(appearance): follow dashboard theme branding in the Companion #2219 passed the same order) andReactorChatLayoutProofTests.ProductionRoot_…(chore(themes): sync the built-in Gateway theme table with the packaged Gateway release #2220; feat(appearance): follow dashboard theme branding in the Companion #2219 passed it with identical product code) each failed once and passed on the next head.GatewayFixtureUiTests.MainSearch_MessageHitOpensItsNativeConversationWithoutSending(fixture shard B): search closes when focus moves after the long session's history loads. On the guest, interleaved runs failed onmaind1316cc0too (1 of 18), on this head 6 of 28 and on the branding head 4 of 30, with the same null-element failure at the same step.a97f2fcc: 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 appearance direction needs a maintainer decision (the review's Decision needed); the external Revocation E2E failure above is the other reason it names.Real Behavior Proof
OpenClaw.GatewayFixtureHost --scenario gateway-themes(synthetic read-only Gateway serving the 11 built-ins and fixture plugin themes) launching the Companion Debug build with an isolated profile.13691ff3for the upgrade run and validation, and its product code (identical ona97f2fcc) for the High Contrast and light/dark switch runs;feb7b394for the theme gallery.OpenClaw.GatewayFixtureHost, then this head's Debug build on the copied profile, driven through local MCPapp.navigateand UI Automation). The High Contrast and light/dark runs continue on that profile:SystemParametersInfo(SPI_SETHIGHCONTRAST)on and off, thenAppsUseLightThemeflipped three times with anImmersiveColorSetbroadcast, comparing window captures. For the gallery, a guest script drives the Companion through local MCP (app.navigate) and UI Automation: App theme Dark; Gateway theme Windows default, Tide, Manuscript, CRT (Settings and a running chat reply each); Follow Gateway theme on, then fixtureselect fixture-themes/neon-night; Tide with Mica on and off.Yes/No/N/A) YesSecurity Impact
Yes/No) NoYes/No) NoYes/No) YesYes/No) NoYes/No) NoYes, explain the risk and mitigation: the Companion now sendsthemes.listandthemes.getover its existing authenticated operator connection, only when the Gateway advertises them and granted an operator read scope. Definitions are validated against upstream's limits and a 3:1 legibility floor before use or storage; invalid or unreadable entries are dropped. No writes, no new endpoints, no artwork or URL fetches.Compatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoAppearancevalue and keep the Windows look; the upgrade run in Evidence shows a settings file written by stable 2026.11.1 loading unchanged and gaining onlyAppearancewhen a theme is picked. Gateways without the theme methods (before 2026.9) offer only the built-ins. Light and dark follow the Windows/App theme setting rather than the dashboard's mode preference, and the dashboard's per-user accent and font overrides (users.prefs) are not applied yet; a one-mode theme pins its mode. The built-in table is generated from upstream main220ca12e; the packaged Gateway 2026.11.1 ships4ffdd204, whose built-in palettes differ slightly, which the stacked theme-table sync PR keeps in step.Review Conversations