diff --git a/solitaire_engine/src/help_plugin.rs b/solitaire_engine/src/help_plugin.rs index cbf47fa..04d77e2 100644 --- a/solitaire_engine/src/help_plugin.rs +++ b/solitaire_engine/src/help_plugin.rs @@ -9,6 +9,8 @@ use bevy::prelude::*; use crate::events::HelpRequestEvent; use crate::font_plugin::FontResource; +#[cfg(target_os = "android")] +use crate::hud_plugin::ANDROID_HINT_LABEL; use crate::ui_modal::{ spawn_modal, spawn_modal_actions, spawn_modal_button, spawn_modal_header, ButtonVariant, ScrimDismissible, @@ -158,7 +160,7 @@ const CONTROL_SECTIONS: &[ControlSection] = &[ ControlRow { keys: "←", description: "Undo last move" }, ControlRow { keys: "||", description: "Pause / resume" }, ControlRow { keys: "?", description: "This help screen" }, - ControlRow { keys: "→", description: "Show a hint" }, + ControlRow { keys: ANDROID_HINT_LABEL, description: "Show a hint" }, ControlRow { keys: "≡", description: "Open menu (Stats, Settings, Profile...)" }, ], }, @@ -346,6 +348,29 @@ fn spawn_help_screen(commands: &mut Commands, font_res: Option<&FontResource>) { mod tests { use super::*; + /// Regression test for M-17: Android help screen showed "→" (right-arrow) + /// for the Hint button when the actual HUD button label is "!". + /// Verifies that the HUD Buttons section contains exactly one row whose + /// `keys` matches `ANDROID_HINT_LABEL`. + #[cfg(target_os = "android")] + #[test] + fn android_hint_row_matches_hud_label() { + use crate::hud_plugin::ANDROID_HINT_LABEL; + let hud_section = CONTROL_SECTIONS + .iter() + .find(|s| s.title == "HUD buttons") + .expect("HUD buttons section must exist"); + let hint_row = hud_section + .rows + .iter() + .find(|r| r.description == "Show a hint") + .expect("hint row must exist"); + assert_eq!( + hint_row.keys, ANDROID_HINT_LABEL, + "help hint row must match the HUD button label" + ); + } + fn headless_app() -> App { let mut app = App::new(); app.add_plugins(MinimalPlugins).add_plugins(HelpPlugin); diff --git a/solitaire_engine/src/hud_plugin.rs b/solitaire_engine/src/hud_plugin.rs index e255c23..6629033 100644 --- a/solitaire_engine/src/hud_plugin.rs +++ b/solitaire_engine/src/hud_plugin.rs @@ -298,6 +298,11 @@ pub struct HelpButton; #[derive(Component, Debug)] pub struct HintButton; +/// Android HUD label for the Hint button — shared with the help screen's +/// controls reference so both always agree. +#[cfg(target_os = "android")] +pub(crate) const ANDROID_HINT_LABEL: &str = "!"; + /// Marker on the "Modes" action button. Click toggles the [`ModesPopover`] /// (a small dropdown panel) below the action bar. Each popover row starts /// the corresponding game mode. @@ -856,7 +861,7 @@ fn spawn_action_buttons( /* undo */ "\u{2190}", // ← leftwards arrow (Arrows block, confirmed FiraMono) /* pause */ "||", // || ASCII double-pipe — ‖ (U+2016) absent from FiraMono /* help */ "?", - /* hint */ "!", // ! attention/alert — semantically: "look here" + /* hint */ ANDROID_HINT_LABEL, /* modes */ "M", // plain ASCII — U+21BB and U+21C4 both render as tofu on FiraMono /* new */ "+", );