fix(onboarding): use dark text on yellow warning cards#257
Closed
indierawk2k2 wants to merge 2 commits into
Closed
fix(onboarding): use dark text on yellow warning cards#257indierawk2k2 wants to merge 2 commits into
indierawk2k2 wants to merge 2 commits into
Conversation
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>
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 Closing this PR as superseded by the broader theme-resource fix. Really appreciate the report and the targeted patch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Foregroundmodifier toOpenClawTray.FunctionalUI(brush prop + extension overloads, applied toTextBlockandControlinApplyModifiers).WelcomePage: explicit#3D2A0Ftext 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):ForegroundModifier_AppliesExplicitBrushToTextBlock— exercises the new Foreground modifier end-to-end throughFunctionalHostControland asserts the producedTextBlock.Foregroundis aSolidColorBrush(#3D2A0F).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.ReadyPage_NodeModeCard_HasExplicitDarkForegroundOnAllText— same shape for the Ready page node-mode card withEnableNodeMode = true.SettingsManageris 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.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
#FFFFFF/#E8F4FDbackgrounds likely have the same dark-mode unreadability problem. Filed as Onboarding: white/light cards render unreadable text in dark mode (PR 241 follow-up) #258 to keep this PR scoped to the originally reported yellow-warning bug.