From d87761d4517a1c9f36b361eddedabe3ec3c9eaa0 Mon Sep 17 00:00:00 2001 From: funman300 Date: Fri, 8 May 2026 13:43:04 -0700 Subject: [PATCH] feat(accessibility): roll HighContrastBorder out to tooltip + 3 panel borders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Continues the HC chrome rollout started by `c9af1ea` (which wired just the modal scaffold). Tags four more static-border surfaces so they boost to `BORDER_SUBTLE_HC` (#a0a0a0) when high-contrast mode is on: - **Tooltip** (`ui_tooltip.rs:191`). The hover-revealed caption popup. Border legibility matters because tooltips are usually brief — if the player has to squint to find the panel edge, the tooltip dismisses before they've parsed it. - **Onboarding banner key chips** (`onboarding_plugin.rs:388`). The first-run UI's "press H or ?" key chips. First-run onboarding has the highest stakes for accessibility — a low-vision player who can't see the chips can't discover the help system. - **Help panel key chips** (`help_plugin.rs:265`). Same treatment as the onboarding chips: keyboard-shortcut chips inside the F1 cheat sheet. - **Stats panel cells** (`stats_plugin.rs:1019`). The S-key overlay's individual stat cells. A dense grid of bordered numbers is exactly the kind of surface where HC's `#505050 → #a0a0a0` boost makes the layout legible. Each tagging is one line on the spawn tuple plus an import. The existing `update_high_contrast_borders` system in `settings_plugin` (added in `c9af1ea`) handles all tagged entities uniformly — no system changes needed. ### Skipped on this pass Sites with dynamic hover/focus paint systems (HUD action buttons, modal buttons, radial menu rim) intentionally not tagged because their existing paint cycles would race the HC system. Wiring HC into those needs a different shape — either fold HC into the dynamic-paint logic, or have HC consult the hover/focus state. Future scope. Other HC-tagging candidates (`home_plugin.rs:842/945/1158` home menu element borders, `settings_plugin.rs:1952/2093/2214/2274` settings panel rows) are likely fine to tag but I'm capping this commit at four to keep it reviewable. Pattern is established; future commits can extend. 1194 passing / 0 failing across the workspace (unchanged — no new tests; the system-level test in `c9af1ea`'s scaffolding covers all tagged entities uniformly). Workspace clippy clean. Co-Authored-By: Claude Opus 4.7 --- solitaire_engine/src/help_plugin.rs | 5 +++-- solitaire_engine/src/onboarding_plugin.rs | 5 +++-- solitaire_engine/src/stats_plugin.rs | 7 ++++--- solitaire_engine/src/ui_tooltip.rs | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/solitaire_engine/src/help_plugin.rs b/solitaire_engine/src/help_plugin.rs index db54ab9..11e8c45 100644 --- a/solitaire_engine/src/help_plugin.rs +++ b/solitaire_engine/src/help_plugin.rs @@ -14,8 +14,8 @@ use crate::ui_modal::{ ScrimDismissible, }; use crate::ui_theme::{ - Z_MODAL_PANEL, BORDER_SUBTLE, RADIUS_SM, SPACE_2, TEXT_PRIMARY, TEXT_SECONDARY, TYPE_BODY, - TYPE_CAPTION, VAL_SPACE_1, VAL_SPACE_2, VAL_SPACE_3, + BORDER_SUBTLE, HighContrastBorder, RADIUS_SM, SPACE_2, TEXT_PRIMARY, TEXT_SECONDARY, TYPE_BODY, + TYPE_CAPTION, VAL_SPACE_1, VAL_SPACE_2, VAL_SPACE_3, Z_MODAL_PANEL, }; /// Marker on the help overlay root node. @@ -263,6 +263,7 @@ fn spawn_help_screen(commands: &mut Commands, font_res: Option<&FontResource>) { ..default() }, BorderColor::all(BORDER_SUBTLE), + HighContrastBorder::with_default(BORDER_SUBTLE), )) .with_children(|chip| { chip.spawn(( diff --git a/solitaire_engine/src/onboarding_plugin.rs b/solitaire_engine/src/onboarding_plugin.rs index e8eda8a..e1ba188 100644 --- a/solitaire_engine/src/onboarding_plugin.rs +++ b/solitaire_engine/src/onboarding_plugin.rs @@ -32,8 +32,8 @@ use crate::ui_modal::{ spawn_modal_header, ButtonVariant, }; use crate::ui_theme::{ - BORDER_SUBTLE, RADIUS_SM, TEXT_PRIMARY, TEXT_SECONDARY, TYPE_CAPTION, TYPE_BODY, VAL_SPACE_1, - VAL_SPACE_2, VAL_SPACE_3, Z_ONBOARDING, + BORDER_SUBTLE, HighContrastBorder, RADIUS_SM, TEXT_PRIMARY, TEXT_SECONDARY, TYPE_BODY, + TYPE_CAPTION, VAL_SPACE_1, VAL_SPACE_2, VAL_SPACE_3, Z_ONBOARDING, }; // --------------------------------------------------------------------------- @@ -386,6 +386,7 @@ fn spawn_slide_hotkeys(commands: &mut Commands, font_res: Option<&FontResource>) ..default() }, BorderColor::all(BORDER_SUBTLE), + HighContrastBorder::with_default(BORDER_SUBTLE), )) .with_children(|chip| { chip.spawn(( diff --git a/solitaire_engine/src/stats_plugin.rs b/solitaire_engine/src/stats_plugin.rs index 258c1b3..cfb66fc 100644 --- a/solitaire_engine/src/stats_plugin.rs +++ b/solitaire_engine/src/stats_plugin.rs @@ -32,9 +32,9 @@ use crate::ui_modal::{ ScrimDismissible, }; use crate::ui_theme::{ - ACCENT_PRIMARY, BORDER_SUBTLE, RADIUS_SM, STATE_INFO, STATE_WARNING, STREAK_MILESTONES, - TEXT_PRIMARY, TEXT_SECONDARY, TYPE_BODY, TYPE_BODY_LG, TYPE_CAPTION, TYPE_HEADLINE, VAL_SPACE_2, - VAL_SPACE_3, VAL_SPACE_4, Z_MODAL_PANEL, + ACCENT_PRIMARY, BORDER_SUBTLE, HighContrastBorder, RADIUS_SM, STATE_INFO, STATE_WARNING, + STREAK_MILESTONES, TEXT_PRIMARY, TEXT_SECONDARY, TYPE_BODY, TYPE_BODY_LG, TYPE_CAPTION, + TYPE_HEADLINE, VAL_SPACE_2, VAL_SPACE_3, VAL_SPACE_4, Z_MODAL_PANEL, }; /// Bevy resource wrapping the current stats. @@ -1017,6 +1017,7 @@ fn spawn_stat_cell(parent: &mut ChildSpawnerCommands, value: &str, label: &str) ..default() }, BorderColor::all(BORDER_SUBTLE), + HighContrastBorder::with_default(BORDER_SUBTLE), )) .with_children(|cell| { // Large value label — accent yellow makes the number sing diff --git a/solitaire_engine/src/ui_tooltip.rs b/solitaire_engine/src/ui_tooltip.rs index c833e67..23120d8 100644 --- a/solitaire_engine/src/ui_tooltip.rs +++ b/solitaire_engine/src/ui_tooltip.rs @@ -36,8 +36,8 @@ use bevy::ui::{ComputedNode, UiGlobalTransform}; use crate::font_plugin::FontResource; use crate::settings_plugin::SettingsResource; use crate::ui_theme::{ - BG_ELEVATED_HI, BORDER_SUBTLE, MOTION_TOOLTIP_DELAY_SECS, RADIUS_SM, TEXT_PRIMARY, - TYPE_CAPTION, VAL_SPACE_2, Z_TOOLTIP, + BG_ELEVATED_HI, BORDER_SUBTLE, HighContrastBorder, MOTION_TOOLTIP_DELAY_SECS, RADIUS_SM, + TEXT_PRIMARY, TYPE_CAPTION, VAL_SPACE_2, Z_TOOLTIP, }; // --------------------------------------------------------------------------- @@ -189,6 +189,7 @@ fn spawn_tooltip_overlay( }, BackgroundColor(BG_ELEVATED_HI), BorderColor::all(BORDER_SUBTLE), + HighContrastBorder::with_default(BORDER_SUBTLE), Visibility::Hidden, // Pin above the focus ring so a tooltip on a focused element // is never occluded by the focus outline.