Skip to content

feat(themes): draw the theme's background artwork in chat - #2268

Closed
paulcam206 wants to merge 7 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-07-backgrounds
Closed

paulcam206 wants to merge 7 commits into
openclaw:mainfrom
paulcam206:paulcam206-themes-07-backgrounds

Conversation

@paulcam206

@paulcam206 paulcam206 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Gateway themes now bring the dashboard's background artwork into chat. Each built-in theme has light and dark line art (contour lines, frames, glyphs) that the dashboard draws faintly behind the new-chat page and conversations. The Companion draws the same artwork, bundled from the pinned release, behind its new-chat surface and conversations, using the dashboard's own background model: Faded or Full bleed, a strength, and the two placement toggles. Plugin and imported themes get the dashboard's neutral artwork pair.

With Follow Gateway theme on, the Companion reads the person's dashboard choice (ui.background from users.prefs.get, the same read as the accent) and follows it live. Otherwise Settings › General offers the Companion's own style (None, Faded, Full bleed) and strength. Windows default, Windows High Contrast and Windows transparency effects off show no artwork, matching the dashboard's forced-colors and reduced-transparency rules. A custom image uploaded in the dashboard isn't fetched yet: it needs an authenticated HTTP read of the person's asset, which is a follow-up. Until then a custom choice shows the plain theme canvas, as the dashboard does when the image is unavailable.

This is part 7 of 10 in the Companion themes stack. Each PR targets main and carries the commits below it; review only this PR's own commit, 964823a5 feat(themes): draw the theme's background artwork in chat. It depends on #2267 (dashboard accent).

What Problem This Solves

Fixes: the Companion's chat lacks the faint theme artwork the dashboard draws behind its chat, so the two still look different under the same theme.

User Impact

User impact: under a Gateway theme, chat shows the theme's artwork like the dashboard, at the strength and placement the person chose. They can turn it off in Settings, and it never appears under Windows default or High Contrast.

Why This Change Was Made

  • The artwork comes from the dashboard's own assets (ui/src/assets/themes/<family>-<mode>.webp at the pinned release, MIT). scripts/Update-ThemeBackgrounds.ps1 re-encodes them losslessly as PNG, because the upstream SVG sources use <mask>, which WinUI's SVG renderer doesn't support.
  • Strength follows upstream session-background.tsx: full bleed is visibility × 0.7; faded is min(1, visibility / 0.5), with the upstream fade mask on the new-chat surface (drawn as a gradient in the shell color, which is equivalent over the opaque themed canvas).
  • The layer sits on the opaque theme shell, so the Mica setting never changes it. It's hit-test invisible and raw in the accessibility tree.
  • The artwork host declares no Reactor child: a declared empty child mounts after the setter that paints the artwork and would clear it until the next update.
  • Windows transparency effects can be turned off while a chat is open; the artwork layer then re-renders without the artwork (and with it again when they're turned back on), matching the dashboard's reduced-transparency rule.
  • ui.background is validated as upstream does; a custom asset id must match in full, so a trailing newline is rejected.

Evidence

Manuscript dark on the earlier stack top (955d82c1), guest, fixture Gateway. The artwork is the faint contour lines at bottom left and the frame at right; the amplified difference against "None" shows exactly where it draws:

Faded Full bleed, strength 100% None Faded minus None, amplified ×12
Faded Full bleed None Amplified difference
Windows High Contrast (no artwork) High Contrast off again
High Contrast After High Contrast

Following the dashboard's background, built and run at this PR's head (964823a5) on a Windows 11 guest (Crabbox Hyper-V, build 29683) in light mode with the App theme Dark, OpenClaw.GatewayFixtureHost --scenario gateway-themes and its new background console command, Follow on with Manuscript. The chat runs dark while the app's own mode is light, the case where the artwork must take the chat's mode rather than the app's. The Companion saved "FollowedBackground":{"source":{"kind":"theme"},"presentation":"full-bleed",…,"visibility":1}, then {"source":{"kind":"none"},…}:

Theme default (faded) Dashboard background full bleed, strength 1 Dashboard background none
Faded Followed full bleed Followed none

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 top 783b9ed7): 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 added Appearance block. Capture after the upgrade and restart; the settings diff and full record are in #2264's description.

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: chat draws new artwork and Settings gains a background card; proven with native UI tests and screenshots on an interactive Windows guest.

Validation

On 964823a5:

  • ./build.ps1: all builds succeeded.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~Theme|FullyQualifiedName~Appearance": 86 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": 2578 passed, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~GatewayTheme" (developer machine, Windows dark mode): 23 passed, 0 failed.
  • Full suites on the stack top 783b9ed7, which contains this commit: ./build.ps1 succeeded; 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.
  • Guest UI tests on the stack top 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.
  • On the stack top ac745c6a, same guest, Windows light then dark: --filter "FullyQualifiedName~GatewayThemeBackdropTests": 5 passed, 0 failed in each mode.

Real Behavior Proof

  • Environment tested: Crabbox Hyper-V guest, Windows 11 Insider Preview build 29683, interactive desktop; OpenClaw.GatewayFixtureHost --scenario gateway-themes.
  • PR head or commit tested: 964823a5 for the build, unit tests, the native background-follow run and GatewayThemeBackgroundTests on the guest (2 passed); 955d82c1 for the style screenshots; 016f6e1b for the guest UI tests in both Windows modes.
  • Exact steps or command run: a guest script picks Manuscript, then sets the background style to Faded, Full bleed (strength 100) and None through Settings' UI Automation, capturing chat after each; then High Contrast on and off.
  • Evidence after fix: GatewayThemeBackgroundTests.ArtworkPaintsOnFirstMountAndYieldsToWindowsDefaultAndHighContrast (with the chat in the mode opposite the app's, first mount paints the theme's artwork for the chat's mode at full bleed's 0.7 and the faded new-chat overlay fades to that mode's shell; it failed before the artwork repainted on Loaded; Windows default and High Contrast draw nothing); GatewayThemeTests background parsing and strength; GatewayThemeSettingsTests live follow of ui.background; GatewayThemeCatalogWireTests follows ui.background through the real fixture socket; GatewayThemeBackgroundTests.TransparencyEffectsChangesReRenderOpenChats (turning Windows transparency effects off or on re-renders open chats without, then with, the artwork); the screenshots above.
  • Observed result: faded and full-bleed artwork appear behind chat at the dashboard's strengths; None, High Contrast and Windows default show none.
  • Screenshot or artifact links verified? (Yes/No/N/A) Yes
  • Not verified or blocked: a custom uploaded image (not fetched; follow-up).

Security Impact

  • New permissions or capabilities? (Yes/No) No
  • Secrets or tokens handling changed? (Yes/No) No
  • New or changed network calls? (Yes/No) No
  • 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: N/A. The artwork is bundled; ui.background comes from the same users.prefs.get read the accent PR adds.

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes
  • Config or environment changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, list the exact upgrade steps: none. With no background choice saved, a theme shows the dashboard's default (theme artwork, faded, 50%).

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.

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.
@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
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.
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. 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

Adds bundled chat background artwork, local style and strength controls, and read-only following of dashboard background preferences.

Example: Follow Gateway theme is enabled for Manuscript dark, with Full bleed and strength 100%.

  • Before: Companion chat has a plain themed canvas.
  • After: Manuscript artwork appears behind chat at 0.7 opacity; choosing None removes it.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The artwork behavior has visible native proof and no established blocking defect; readiness remains capped by the unresolved product direction.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Contributor captures show native Companion chat on a Windows 11 fixture-Gateway setup, including current-head dashboard-followed Full bleed versus None; earlier style captures show Faded and Full bleed, supported by mounted rendering and real-socket coverage.
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: Companion chat lacks the decorative background artwork shown by the same theme in the dashboard.
Reason: The visual benefit is demonstrated, while adding persisted artwork controls remains an owner product choice.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep this PR open: it adds distinct artwork support absent from current main and belongs to an unresolved theme stack; no blocking code defect was established.

Priority: P3
Reviewed head: 964823a5e7aa46e467436633bed54df30f1ec5fe
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Companion add bundled chat artwork with local style and strength controls and dashboard following?
  • Recommendation: Approve the artwork direction: Accept the optional controls and coordinate this layer with the prerequisite theme stack.
  • Why: The feature is demonstrated, but these new persisted appearance choices have no recorded maintainer approval in the inspected discussion.

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway preferences and Companion settings feed the appearance resolver, which selects bundled images and rendering parameters for the native Reactor chat surface.

flowchart TD
  Gateway[Gateway preferences] --> Catalog[Theme catalog]
  Catalog --> Resolver[Appearance resolver]
  Settings[Companion settings] --> Resolver
  Resolver --> Renderer[Artwork renderer]
  Assets[Bundled images] --> Renderer
  Renderer --> Chat[Native chat]
Loading

Technical review

Best possible solution:

Retain one bundled-artwork renderer driven by the existing appearance resolver, with Windows accessibility exclusions and owner-approved controls.

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

This is an appearance feature; source inspection confirms current main lacks the proposed artwork layer, and contributor screenshots demonstrate its addition.

Is this the best way to solve the issue?

The artwork change uses the existing appearance, catalog and settings owners, bundles its assets, and explicitly leaves authenticated custom-image retrieval for separate work.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Native chat typography and geometry changes intended behavior with a stated reason (5164faa: Established native chat presentation using the released web experience as a reference; the theme stack explicitly substitutes selected dashboard fonts and radii.)
  • Saved window theme preference keeps the original intent (1fb28ee: ThemeHelper applies the saved Light, Dark or System preference; the stack retains this owner and its Windows default path.)
  • Theme-resource and High Contrast behavior keeps the original intent (ff19012: Declarative theme resources replaced unstable legacy accessibility subscriptions; artwork yields to High Contrast and keeps existing chat theme-change ownership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

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 visual customization preserves the Windows default experience and addresses no urgent broken workflow.
  • 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 (1 earlier review cycle)
  • reviewed 2026-11-17T07:16:28.318Z sha d2b5deb :: blocked before merge. :: none

Reviewed November 17, 2026, 3:18 AM ET / 08:18 UTC (Revision 2).

@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