Repository navigation
feat(themes): apply the theme's corner radii - #2266
paulcam206 wants to merge 5 commits into
Conversation
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.
|
🦞👀 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. |
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.
|
Codex review: ready, awaiting a maintainer decision. What this changesAdds dashboard theme support, including startup control radii and live corner scaling for chat surfaces. Example: Select CRT in General settings, then restart Companion.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep this PR open: its theme geometry is absent from current main, and no concrete radius-layer defect was found; adopting the optional appearance direction still needs an owner decision. Priority: P3 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherShared theme models supply palette geometry to AppThemeApplicator, which sets startup WinUI resources and updates mounted Reactor chat surfaces through ChatVisuals. flowchart LR
A[Appearance settings] --> B[Theme resolver]
C[Generated theme table] --> B
B --> D[AppThemeApplicator]
D --> E[Startup WinUI resources]
D --> F[ChatVisuals]
F --> G[Mounted chat surfaces]
Technical reviewBest possible solution: Use the existing theme applicator and ChatVisuals owners for the documented geometry behavior if maintainers adopt the appearance direction. Do we have a high-confidence way to reproduce the issue? Current-main source fixes chat radii at Fluent values, establishing the stated mismatch for dashboard themes; no target code was executed during this read-only review. Is this the best way to solve the issue? The radius layer keeps geometry decisions in existing owners, preserves default shapes, and justifies its mounted-element tracking with memoized Markdown that otherwise would not update. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a0a2a24ec1dd. 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 HistoryReviewed November 17, 2026, 6:33 AM ET / 11:33 UTC (Revision 3). |
5afae90 to
725e299
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Superseded by # in native stack #2302. |
Gateway themes now carry the dashboard's corner geometry. WinUI controls take the theme's small and medium radii (
ControlCornerRadiusfrom--radius-sm,OverlayCornerRadiusfrom--radius-md). Ten of the eleven built-ins use 6 and 10 px (Fluent uses 4 and 8); CRT uses 2 and 3. Chat surfaces (composer, bubbles, code blocks, tables, cards) scale their radii by the theme's corner scale, so CRT's 0.25 makes chat nearly square while the other themes keep chat's current geometry. Windows default and High Contrast keep Fluent's geometry.Chat follows every theme switch live, including messages already on screen that don't render again. Controls take the radii of the theme in effect when the Companion starts and keep them for the session. Fluent control styles resolve their radius from XamlControlsResources' own theme dictionaries, and controls that already exist keep the value they resolved, so changing it mid-session would reshape new controls and leave existing ones as they were. A new theme's control radii therefore apply at the next start.
This is part 5 of 10 in the Companion themes stack. Each PR targets
mainand carries the commits below it; review only this PR's own commit,725e299d feat(themes): apply the theme's corner radii. It depends on #2258 (Gateway themes and follow).What Problem This Solves
Fixes: themed Companion surfaces keep Fluent's corner shapes, so they don't match the dashboard's rounder (or, for CRT, square) geometry.
User Impact
User impact: chat corners match the chosen theme immediately, and buttons, inputs and flyouts match it from the next start (in windows whose App theme follows or matches Windows' light/dark mode). Windows default and High Contrast are unchanged.
Why This Change Was Made
--radius-sm,--radius-mdand--openclaw-corner-radius-scaleper theme, reading the circular geometry WinUI draws: the dashboard's 1.25 squircle compensation under@supports (corner-shape)is neutralized, and CRT's own 0.25 still wins.AppThemeApplicator.DecideControlGeometryruns once, from App's startup theme application, before any window exists, and writes the two radii into the XamlControlsResources theme dictionary of the mode the app runs in (Windows decides it). That's where Fluent's control styles look them up; an application-root key doesn't reach them. The other mode's dictionary is never written: writing it before that mode renders binds its aliases (ButtonBackground,ComboBoxBackgroundand so on) to the app mode's brushes, which gave a dark Hub on light Windows light buttons and combo boxes. Windows whose App theme differs from Windows' mode therefore keep Fluent's control radii (ControlsInTheOtherModeKeepFluentRadiiAndTheirOwnColors).Applynever touches the control radii, so a session's controls stay consistent.ChatVisuals.ThemedCorner, which applies the scaled radius and keeps a weak registry of mounted surfaces, soSetCornerScalereshapes memoized views (a Markdown message whose props didn't change) on their own UI thread. Unmount removes an element, so a pooled control reused elsewhere isn't reshaped, and a disposed host can't be kept alive by the registry.Evidence
CRT picked live in Settings, built and run at this PR's head (
725e299d) on a Windows 11 guest (Crabbox Hyper-V, build 29683) in light mode with the App theme Dark,OpenClaw.GatewayFixtureHost --scenario gateway-themes. The chat surfaces square up immediately (composer, bubble, cards); the session's controls keep the radii decided at startup (Windows default here):Probes on the native guest, each on a fresh copy of the production resources, that set the design. The new
Button's radius:ControlCornerRadius= 2 is writtenControls take the radii decided at startup, shown in the running app at this PR's head on the same guest with the App theme Light, the app's own mode, whose windows take a theme's radii. With CRT picked live, the session's controls keep Fluent's radii. After a restart with CRT saved, the same combo box has CRT's tighter corners. The crops are enlarged 6× with nearest-neighbor scaling; the right edge is cut off by the guest's 1024 px screen. The app log records each decision:
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
windows-winui-interactive: corner geometry of WinUI controls and chat surfaces changes; proven with native UI tests and screenshots on an interactive Windows guest.Validation
On
725e299d:./build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 71 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": 2576 passed, 0 failed.dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme"(developer machine, Windows dark mode): 21 passed, 0 failed.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.016f6e1b(Crabbox Hyper-V Windows 11 build 29683, interactive desktop, isolated tray profile, proof captures on), once with Windows in light mode and once in dark:dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --filter "Category!=Accessibility&...&(FullyQualifiedName~GatewayTheme|FullyQualifiedName~DesktopCompanionWindowTests|FullyQualifiedName~ChatThemeProofScope|FullyQualifiedName~SettingsPageInsetTests|FullyQualifiedName~ChatMarkdown)": 53 passed, 4 skipped (opt-in pointer tests), 1 failed in each mode. The failure,DesktopCompanionWindowTests.MascotScale_UpdatesLayoutAndHitRegionWithoutScalingOrReplacingPopup(chatOpen: True), needs a larger work area than the guest's 1024x720 at 200% scale.ac745c6a, same guest, Windows light then dark:--filter "FullyQualifiedName~GatewayThemeBackdropTests": 5 passed, 0 failed in each mode.Real Behavior Proof
OpenClaw.GatewayFixtureHost --scenario gateway-themes.725e299dfor the UI tests, the CRT screenshots, the restart run andGatewayThemeRestoreTestson the guest (9 passed);955d82c1for the probes (the startup control-radius write now targets only the app mode's WinUI dictionary, proven byControlsInTheOtherModeKeepFluentRadiiAndTheirOwnColorswith the app in each mode);016f6e1bfor the guest UI tests in both Windows modes.dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --filter "FullyQualifiedName~GatewayThemeRestoreTests|FullyQualifiedName~GatewayThemeTypographyTests|FullyQualifiedName~GatewayThemeBackdropTests"(14 passed); the screenshot script picks CRT in Settings and captures chat and Settings; for startup geometry, the App theme set to Light, CRT picked in Settings, then the Companion restarted with the same profile (the fixture host is stopped first so its profile stays) and Settings captured again.GatewayThemeRestoreTests.ControlsKeepTheCornerRadiiDecidedAtStartup(startup geometry, High Contrast at startup keeps Fluent, a later theme with other radii changes neither the keys nor a control type created afterward) andGatewayThemeTypographyTests.MountedChatCornersFollowEveryThemeSwitch(an already-mounted code block and table follow CRT, High Contrast and Windows default live); screenshots above.Yes/No/N/A) YesSecurity Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoReview Conversations