From 0c86cac2d5cf9fabc5559a6c81e371f8daa89b0f Mon Sep 17 00:00:00 2001 From: funman300 Date: Thu, 30 Apr 2026 22:45:19 +0000 Subject: [PATCH] =?UTF-8?q?feat(engine):=20unify=20destructive-confirm=20v?= =?UTF-8?q?erbs=20=E2=80=94=20drop=20"Yes,"=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both confirm modals previously used a "Yes, " pattern that read like a question-and-answer dialog ("Are you sure? Yes, forfeit"); the canonical UX pattern for a destructive confirm is just the bare verb. The Confirm New Game modal's primary button is now "New game" instead of "Yes, abandon" — matching the verb the user originally clicked and framing the action positively rather than as a loss. The Forfeit Confirm modal's primary button is now "Forfeit" instead of "Yes, forfeit" — same pattern, less ceremony. The Pause menu's own Resume / Forfeit buttons are unchanged: it's an action menu, not a destructive confirm, and bare verbs are already correct there. Two doc comments and the ui_modal.rs spawn_modal_button example docstring are updated to reflect the new copy. Marker symbol names (ConfirmYesButton, ForfeitConfirmButton) are kept to avoid unnecessary churn — the rename would ripple into mouse-input handlers without a matching user-visible benefit. Co-Authored-By: Claude Opus 4.7 (1M context) --- solitaire_engine/src/game_plugin.rs | 4 ++-- solitaire_engine/src/pause_plugin.rs | 6 +++--- solitaire_engine/src/ui_modal.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/solitaire_engine/src/game_plugin.rs b/solitaire_engine/src/game_plugin.rs index f6b91bf..076496b 100644 --- a/solitaire_engine/src/game_plugin.rs +++ b/solitaire_engine/src/game_plugin.rs @@ -214,7 +214,7 @@ fn handle_new_game( } } -/// Marker on the primary "Yes, abandon" button inside the confirm modal. +/// Marker on the primary "New game" button inside the confirm modal. #[derive(Component, Debug)] pub struct ConfirmYesButton; @@ -265,7 +265,7 @@ fn spawn_confirm_dialog( spawn_modal_button( actions, ConfirmYesButton, - "Yes, abandon", + "New game", Some("Y"), ButtonVariant::Primary, font_res, diff --git a/solitaire_engine/src/pause_plugin.rs b/solitaire_engine/src/pause_plugin.rs index 84c983c..594940b 100644 --- a/solitaire_engine/src/pause_plugin.rs +++ b/solitaire_engine/src/pause_plugin.rs @@ -72,7 +72,7 @@ pub struct ForfeitConfirmScreen; #[derive(Component, Debug)] struct ForfeitCancelButton; -/// Marker on the "Yes, forfeit" primary button inside the forfeit-confirm modal. +/// Marker on the "Forfeit" primary button inside the forfeit-confirm modal. #[derive(Component, Debug)] struct ForfeitConfirmButton; @@ -468,7 +468,7 @@ fn spawn_draw_mode_row( )); } -/// Spawns `ForfeitConfirmScreen` — a Cancel / "Yes, forfeit" modal +/// Spawns `ForfeitConfirmScreen` — a Cancel / "Forfeit" modal /// stacked above the pause modal at `Z_PAUSE_DIALOG`. fn spawn_forfeit_confirm_screen(commands: &mut Commands, font_res: Option<&FontResource>) { spawn_modal( @@ -495,7 +495,7 @@ fn spawn_forfeit_confirm_screen(commands: &mut Commands, font_res: Option<&FontR spawn_modal_button( actions, ForfeitConfirmButton, - "Yes, forfeit", + "Forfeit", Some("Y"), ButtonVariant::Primary, font_res, diff --git a/solitaire_engine/src/ui_modal.rs b/solitaire_engine/src/ui_modal.rs index 143f6a0..ff01f28 100644 --- a/solitaire_engine/src/ui_modal.rs +++ b/solitaire_engine/src/ui_modal.rs @@ -38,7 +38,7 @@ //! spawn_modal_button( //! actions, //! ConfirmButton, -//! "Yes, abandon", +//! "New game", //! Some("Y"), //! ButtonVariant::Primary, //! font_res,