Repository navigation
feat(themes): apply the theme's corner radii - #2295
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: needs maintainer review before merge. What this changesThis PR applies theme corner radii to native controls at startup and updates chat corners live. Example: Select the CRT theme while chat is open, then restart Companion.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open. It adds useful theme geometry absent from main, with convincing visual evidence and no actionable defects found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGenerated dashboard geometry enters the shared theme palette; AppThemeApplicator applies startup control resources and ChatVisuals refreshes mounted chat surfaces. flowchart LR
CSS[Dashboard CSS] --> Generator[Theme table generator]
Generator --> Palette[Shared theme palette]
Palette --> Applicator[AppThemeApplicator]
Applicator --> Controls[Startup control corners]
Applicator --> Chat[Live chat corners]
Technical reviewBest possible solution: Retain the existing theme applicator and chat presentation owners, with startup control geometry and weakly tracked live chat updates. Do we have a high-confidence way to reproduce the issue? This is a visual feature; baseline source retains fixed corners, and the inspected captures show the intended CRT geometry. Is this the best way to solve the issue? The implementation uses existing owners and preserves Fluent defaults while addressing memoized chat surfaces that do not rerender on theme changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c38dbcc53e7d. 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. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 (3 earlier review cycles)Reviewed November 18, 2026, 6:45 PM ET / 23:45 UTC (Revision 4). |
6a8250e to
e228f29
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
e228f29 to
b818797
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
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.
b818797 to
dba53b2
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Preserve the parent table layout, compact status lines, accent bindings, and live-font regression alongside themed corners. Co-authored-by: Copilot App <[email protected]>
Keep corner registrations on the native element and hold only weak references globally. Guard queued updates against unmounted registrations and extend the mounted regression to reacquire code, table and header corners after garbage collection. Co-authored-by: Copilot App <[email protected]>
Preserve the parent refresh-retirement and malformed-theme isolation repairs unchanged. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…dii layer Carries current main 515f1a2 through layers 1-4. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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 11 in the Companion themes stack, opened as a native GitHub stack: each PR is based on the layer below it, so this diff is only this layer's commit,
dba53b29 feat(themes): apply the theme's corner radii. It depends on #2294 (Gateway themes and follow).This commit is
725e299drebased onto main1af25869, andgit range-diffshows the same patch, apart from the corrected High Contrast sentence inDESIGN.mdcarried from the Mica layer. Evidence and validation below name the heads they ran on; in this stack725e299dis nowb818797f,783b9ed7is now3f14cc1fand2e98953ais now3c4cacae.Rebased again onto main
30cfe593, which includes #2307 and #2308: this commit is nowdba53b29(wasb818797f), andgit range-diffshows the same patch. Only its context inToolCallCardRenderer.cschanged: #2308 adds the Worked divider after the card whose corner this layer themes, and both survive. Evidence below that namesb818797for an earlier head ran on this same patch.Themes architecture
Layer 5 of 11 in the Companion themes stack. This layer carries the theme's corner geometry into the Companion: control and overlay radii fixed for the session, and live corner scaling for chat surfaces. The nodes this pull request adds are highlighted below. For the full write-up, with code links, see OpenClaw Windows Companion: theme architecture.
flowchart TD subgraph src["Sources"] GW["Gateway"] UI["Settings page"] WIN["Windows settings"] SYNC["Daily table sync"] TBL["Built-in table"] FNT["Bundled fonts"] ARTA["Artwork images"] end subgraph proc["Processing"] CAT["Theme catalog"] FOL["Follower"] RES["Palette resolver"] PRB["WebView2 probe"] CCH["Palette cache"] MOD["Theme model"] SET["Appearance setting"] SEL["Theme selection"] ACC["Accent overlay"] end subgraph app["Application"] APL["Theme applicator"] PRJ["WinUI brushes"] RAD["Corner radii"] BKP["Mica backdrop"] ART["Chat artwork"] BUB["Lobster bubble"] BRD["Branding"] end GW -->|catalog and prefs| CAT GW -->|Control UI CSS| RES SYNC -->|regenerates| TBL TBL -->|fallback| RES RES --> PRB PRB --> CCH CCH -->|reuse| RES CAT -->|built-in names| RES CAT -->|plugin themes| MOD CAT -->|dashboard choice| FOL FOL -->|followed values| SET UI -->|manual choice| SET MOD --> SEL RES -->|built-in palettes| SEL SET --> SEL SEL --> ACC ACC --> APL WIN --> APL WIN --> BKP FNT --> PRJ APL --> PRJ APL --> RAD APL --> BKP APL --> BRD APL --> ART ARTA --> ART BKP --> BUB classDef layer fill:#ffd866,stroke:#7a5200,stroke-width:3px,color:#000000 class RAD layerWhat 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 (#2301, at its earlier head
2e98953a, which contained this stack's previous 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 #2301'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
30cfe593(fix: match inline code chips to the chat theme #2307), on the new stack top601932d6, which contains this commit:./build.ps1succeeded;dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 6016 passed, 0 failed, 29 skipped (existing opt-in integration skips);dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6807 passed, 0 failed;dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme|FullyQualifiedName~GatewayBuiltinThemeProbe|FullyQualifiedName~DesktopCompanionWindowTests.OpenBubble|FullyQualifiedName~ReactorMarkdownWebParity|FullyQualifiedName~ReactorToolActivityProofTests|FullyQualifiedName~WorkAlignment": 63 passed, 0 failed.dba53b29itself:./build.ps1succeeded; Shared tests with--filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 74 passed, 0 failed; Tray tests with--filter "FullyQualifiedName~Theme|FullyQualifiedName~Settings|FullyQualifiedName~Appearance|FullyQualifiedName~DesktopCompanion|FullyQualifiedName~Chat": 2582 passed, 0 failed; UI tests with--filter "FullyQualifiedName~GatewayTheme": 22 passed, 0 failed.1af25869, on the new stack top3c4cacae, which contains this commit:./build.ps1succeeded;dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 6012 passed, 0 failed, 29 skipped (existing opt-in integration skips);dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6801 passed, 0 failed;dotnet test ./tests/OpenClaw.Tray.UITests -r win-x64 --filter "FullyQualifiedName~GatewayTheme|FullyQualifiedName~GatewayBuiltinThemeProbe|FullyQualifiedName~DesktopCompanionWindowTests.OpenBubble|FullyQualifiedName~ReactorMarkdownWebParity"(developer machine, Windows dark mode): 33 passed, 0 failed.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