feat(engine): Phase F touch action bar — thumb-reach Undo/Draw/Hint + hold-to-repeat undo
Touch layout (USE_TOUCH_UI_LAYOUT) restructures the bottom action bar to five buttons: an enlarged Undo / Draw / Hint trio (96x64px targets, 1.35x labels) between compact Menu and Pause. Draw is new — it fires the same DrawRequestEvent as tapping the stock, so the most frequent action no longer needs a reach to the top of a tall folded screen. Help, Modes, and New Game leave the touch bar (they live in Menu -> System, the Home grid, and Home's hero respectively). Desktop keeps the seven-button bar unchanged (decision 5: touch-only). Holding Undo now steps back repeatedly after a 0.45s delay (5.5/s), each step through the normal request path so the scoring penalty applies. New self-ambiguous DrawRequestWriters set keeps the ambiguity gate at zero with the fourth DrawRequestEvent writer. 6 new hud_plugin tests; workspace suite + clippy green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -554,11 +554,11 @@ pub(super) fn action_bar_font_size(window_width: f32) -> f32 {
|
||||
|
||||
pub(super) fn action_button_metrics() -> (UiRect, Val, Val) {
|
||||
if USE_TOUCH_UI_LAYOUT {
|
||||
// Tight 3 px horizontal padding (down from 4) trims 14 px off the row
|
||||
// total across 7 buttons, and a 44 px min_width (down from 52) lets the
|
||||
// shortest labels ("New", "Help") shrink to their text rather than
|
||||
// padding the row out past the 900 logical-px viewport. min_height
|
||||
// stays at 44 px to preserve the comfortable touch target.
|
||||
// Tight 3 px horizontal padding keeps the compact buttons narrow;
|
||||
// Phase F trimmed the touch bar to 5 buttons (2 compact + 3
|
||||
// primary), so width pressure is lower than the old 7-button row.
|
||||
// min_height stays at 44 px to preserve the comfortable touch
|
||||
// target on the compact buttons.
|
||||
(
|
||||
UiRect::axes(Val::Px(3.0), Val::Px(4.0)),
|
||||
Val::Px(44.0),
|
||||
@@ -573,6 +573,20 @@ pub(super) fn action_button_metrics() -> (UiRect, Val, Val) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Metrics for the touch bar's enlarged Undo / Draw / Hint trio (Phase F).
|
||||
/// 96×64 px targets — comfortably past the 44 px accessibility floor and
|
||||
/// big enough to hit one-handed without looking. Only the touch layout
|
||||
/// spawns primary buttons, so no desktop branch is needed; the desktop
|
||||
/// values exist purely so host-side tests can exercise the touch spawn
|
||||
/// path with sensible numbers.
|
||||
pub(super) fn primary_action_button_metrics() -> (UiRect, Val, Val) {
|
||||
(
|
||||
UiRect::axes(Val::Px(10.0), Val::Px(8.0)),
|
||||
Val::Px(96.0),
|
||||
Val::Px(64.0),
|
||||
)
|
||||
}
|
||||
|
||||
pub(super) fn spawn_action_button_label(
|
||||
parent: &mut ChildSpawnerCommands,
|
||||
label: &str,
|
||||
|
||||
Reference in New Issue
Block a user