Skip to content

[Repo Assist] fix(a2ui): apply CardBackground theme override to Card renderer - #380

Closed
github-actions[bot] wants to merge 1 commit into
masterfrom
repo-assist/fix-a2ui-card-background-343-b030fe61e9b1804e
Closed

github-actions[bot] wants to merge 1 commit into
masterfrom
repo-assist/fix-a2ui-card-background-343-b030fe61e9b1804e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Problem

A2UITheme parses colors.card into CardBackground but CardRenderer never consulted it — the Fluent CardBackgroundFillColorDefaultBrush was used unconditionally. Any agent that pushed a beginRendering.styles theme with a colors.card value saw no visual effect, a silent contract violation.

Root Cause

CardRenderer.Render only checked Application.Current.Resources["CardBackgroundFillColorDefaultBrush"] and applied it to border.Background. There was no code path that read ctx.Theme.CardBackground.

Fix

Check ctx.Theme.CardBackground first; when present, create a SolidColorBrush from it. Fall back to the Fluent resource brush when not set. The pattern matches existing CornerRadius and Spacing theme handling in the same renderer.

-if (Application.Current.Resources.TryGetValue("CardBackgroundFillColorDefaultBrush", out var bg) && bg is Brush bgBrush)
-    border.Background = bgBrush;
+if (ctx.Theme.CardBackground is { } cardBg)
+    border.Background = new SolidColorBrush(cardBg);
+else if (Application.Current.Resources.TryGetValue("CardBackgroundFillColorDefaultBrush", out var bg) && bg is Brush bgBrush)
+    border.Background = bgBrush;

Test

Added Theme_CardBackground_AppliesToCardBorderBackground in A2UIThemeTests — pushes a surface with colors.card: "#2233FF" and asserts the rendered Border.Background is a SolidColorBrush with R=0x22, G=0x33, B=0xFF.

Test Status

  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj — 1541 passed, 7 pre-existing failures (unchanged baseline)
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj — 1124 passed, 7 pre-existing failures (unchanged baseline)
  • UI tests (OpenClaw.Tray.UITests) require a Windows WinUI host — cannot run on Linux runner; new test exercises the same code path covered by existing Theme_RadiusOverride_AppliesToCardBorderCornerRadius
  • build.ps1 requires Windows

Closes #343.


Generated by 🌈 Repo Assist, see workflow run. Learn more.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

CardRenderer read the Fluent default brush but never consulted
ctx.Theme.CardBackground. Any agent that pushed a theme with a
colors.card value saw no effect — a silent contract violation.

Fix: check ctx.Theme.CardBackground first and create a
SolidColorBrush from it; fall back to the Fluent resource brush
when not set. Pattern matches existing CornerRadius/Spacing
theme handling in the same renderer.

Add Theme_CardBackground_AppliesToCardBorderBackground UI test
to lock in the fix.

Fixes #343.

Co-authored-by: Copilot <[email protected]>
@shanselman

Copy link
Copy Markdown
Collaborator

Closing this automation implementation as stale/superseded after the post-refactor triage. The underlying signal is preserved in #343 and the tracker update in #372: CardBackground is retained in #372, but this old draft implementation is stale.

@shanselman shanselman closed this May 18, 2026
@shanselman
shanselman deleted the repo-assist/fix-a2ui-card-background-343-b030fe61e9b1804e branch September 7, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-review] C3: A2UI CardBackground theme override is parsed but never applied

1 participant