From e107f5e218472fde1e10045aaced21232a1e4874 Mon Sep 17 00:00:00 2001 From: funman300 Date: Sun, 10 May 2026 20:53:40 -0700 Subject: [PATCH] fix(android): 48dp min hit targets on action buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Action buttons sized to text + 8 px padding made "Undo" end up ~46 x 33 px — fine for a mouse but at the threshold of a finger. Adds `min_width: 48 px` and `min_height: 48 px` to the button Node so every button meets Material's 48 dp thumb-target guideline. Applied universally; the floor is a no-op for buttons whose content already exceeds 48 px on either axis (Menu, Modes, New Game, Pause, Help all clear 48 px wide; height was the binding constraint at ~33 px). Closes P1 #2 of docs/android/PLAYABILITY_TODO.md. Engine tests pass; clippy clean. Co-Authored-By: Claude Sonnet 4.6 --- docs/android/PLAYABILITY_TODO.md | 11 ++++++++--- solitaire_engine/src/hud_plugin.rs | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/android/PLAYABILITY_TODO.md b/docs/android/PLAYABILITY_TODO.md index beba034..48cfb14 100644 --- a/docs/android/PLAYABILITY_TODO.md +++ b/docs/android/PLAYABILITY_TODO.md @@ -76,9 +76,14 @@ rewrites required. profile/stats/leaderboard/settings, help screen) survive — they live behind navigation and a touch user reaches them less often. Track as a P3 sweep when more screens are audited on hardware. -- [ ] **Thumb-sized hit targets.** HUD buttons sized for mouse; - Material guideline minimum is 44–48 dp. Increase button paddings - on touch builds. +- [x] **Thumb-sized hit targets.** *Closed 2026-05-10.* Action + button Node carries `min_width: Val::Px(48.0), min_height: + Val::Px(48.0)` — meets Material's 48 dp baseline on touch and is + a no-op for buttons whose content already exceeds 48 px in + either axis. Applied universally rather than cfg-gated since + Material's guideline applies to all input modes. Cards, pile + markers, modal close buttons not yet audited — track as P3 if + they fall below threshold on hardware. - [ ] **Portrait-first card spacing.** Stretch tableau piles vertically to fill height; reduce inter-pile gaps so 7 columns fit in 360 dp. - [ ] **Double-tap auto-move visible feedback.** `handle_double_tap` diff --git a/solitaire_engine/src/hud_plugin.rs b/solitaire_engine/src/hud_plugin.rs index 95cb505..88459e9 100644 --- a/solitaire_engine/src/hud_plugin.rs +++ b/solitaire_engine/src/hud_plugin.rs @@ -764,6 +764,14 @@ fn spawn_action_button( // companion commit). Vertical padding stays at VAL_SPACE_2 // so button height tracks the rest of the chrome band. padding: UiRect::axes(VAL_SPACE_2, VAL_SPACE_2), + // 48 px floors meet Material's recommended thumb-target + // size on touch and are a no-op on desktop for buttons + // whose content already exceeds 48 px in either axis + // (Menu, Modes, New Game, etc.). Without these, "Undo" + // ends up ~46 × 33 px — comfortably tappable with a mouse + // but right at the threshold for a finger. + min_width: Val::Px(48.0), + min_height: Val::Px(48.0), justify_content: JustifyContent::Center, align_items: AlignItems::Center, border_radius: BorderRadius::all(Val::Px(RADIUS_MD)),