Skip to content

fix(onboarding): use dark text on yellow warning cards#257

Closed
indierawk2k2 wants to merge 2 commits into
openclaw:masterfrom
indierawk2k2:fix/pr241-warning-text-color
Closed

fix(onboarding): use dark text on yellow warning cards#257
indierawk2k2 wants to merge 2 commits into
openclaw:masterfrom
indierawk2k2:fix/pr241-warning-text-color

Conversation

@indierawk2k2
Copy link
Copy Markdown
Contributor

@indierawk2k2 indierawk2k2 commented May 1, 2026

PR 241 follow-up.

The Welcome page security-notice card and the Ready page node-mode card use a yellow background but inherit the system theme foreground, which renders as white in dark mode — making the text unreadable.

Changes

  • Add a Foreground modifier to OpenClawTray.FunctionalUI (brush prop + extension overloads, applied to TextBlock and Control in ApplyModifiers).
  • WelcomePage: explicit #3D2A0F text on the security-notice card (title, body, ""Your agent can:"" subheading, bullets).
  • ReadyPage: same treatment for the ""🔌 Node Mode Active"" yellow card.

Tests (commit 3975474)

New tests/OpenClaw.Tray.UITests/OnboardingWarningCardTests.cs (3 tests, all passing):

  1. ForegroundModifier_AppliesExplicitBrushToTextBlock — exercises the new Foreground modifier end-to-end through FunctionalHostControl and asserts the produced TextBlock.Foreground is a SolidColorBrush(#3D2A0F).
  2. WelcomePage_WarningCard_HasExplicitDarkForegroundOnAllText — renders the Welcome page, locates the yellow card by background brush, and asserts every non-emoji TextBlock inside has the explicit dark text color.
  3. ReadyPage_NodeModeCard_HasExplicitDarkForegroundOnAllText — same shape for the Ready page node-mode card with EnableNodeMode = true. SettingsManager is constructed with a temp directory per AGENTS.md isolation rule.

Tree-level brush assertions are used in preference to pixel screenshot baselines: the bug is a missing brush, so brush comparison expresses the regression precisely without screenshot maintenance overhead.

Validation

  • ./build.ps1 — all projects built successfully.
  • Visual screenshot verified — dark brown text legible on the yellow card.
  • OpenClaw.Tray.Tests — 406/406 passed.
  • OpenClaw.Shared.Tests — 1100/1100 passed.
  • OpenClaw.Tray.UITests — 65/65 passed (3 new + 62 existing).

Out of scope

indierawk2k2 and others added 2 commits May 1, 2026 13:45
PR 241 follow-up: the welcome page security notice and the ready-page node-mode card use a yellow background but inherit the system theme foreground, which renders as white in dark mode — making the text unreadable.

Add a Foreground modifier to FunctionalUI and explicitly set a dark brown (#3D2A0F) text color on every TextBlock inside the yellow cards so they remain readable regardless of the OS theme.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds OnboardingWarningCardTests under tests/OpenClaw.Tray.UITests covering the bug fixed by 2a3c84d:

1. ForegroundModifier_AppliesExplicitBrushToTextBlock — exercises the new FunctionalUI Foreground modifier end-to-end through FunctionalHostControl, asserting the produced TextBlock.Foreground is a SolidColorBrush(#3D2A0F).
2. WelcomePage_WarningCard_HasExplicitDarkForegroundOnAllText — renders the Welcome page, finds the yellow #FFF4E0 card by background brush, and asserts every non-emoji TextBlock inside it has the explicit dark text color.
3. ReadyPage_NodeModeCard_HasExplicitDarkForegroundOnAllText — same shape for the #FFF3E0 'Node Mode Active' card on the Ready page (with EnableNodeMode=true). SettingsManager is constructed with a temp directory per AGENTS.md isolation rule.

Tree-level brush assertions instead of pixel screenshots: the bug is a missing brush, so brush comparison expresses the regression precisely without screenshot maintenance overhead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shanselman
Copy link
Copy Markdown
Contributor

Thanks @indierawk2k2 for catching this and sending the quick fix. We used this as the signal to fix the broader root cause from #258 instead of adding a hardcoded foreground on one warning card.

The fix is now on master in 871b959: onboarding surfaces use WinUI semantic theme brushes (CardBackgroundFillColorDefaultBrush, SystemFillColorCautionBackgroundBrush, SystemFillColorAttentionBackgroundBrush) and the FunctionalUI/onboarding host backgrounds no longer force white. I also visually checked the onboarding flow in dark mode after the change and reran the required build/test validation.

Closing this PR as superseded by the broader theme-resource fix. Really appreciate the report and the targeted patch.

@shanselman shanselman closed this May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants