feat(engine): Phase F touch action bar — thumb-reach Undo/Draw/Hint + hold-to-repeat undo #177

Merged
funman300 merged 2 commits from feat/bottom-action-bar into master 2026-07-13 23:22:15 +00:00
Owner

Implements Phase F of docs/ui-redesign-2026-07.md (decision 5 recorded in the first commit: touch-only; desktop bar unchanged).

What changed

  • Touch bar restructured to five buttons (USE_TOUCH_UI_LAYOUT): an enlarged Undo · Draw · Hint trio (96×64 px targets, 1.35× labels, TEXT_PRIMARY) between compact Menu and Pause. Survey note: the bar itself has lived at the bottom since the May A1 work — Phase F's real gap was target size, a Draw affordance, and bar clutter.
  • Draw is new: fires the same DrawRequestEvent as tapping the stock (guarded while paused, mirroring handle_stock_click), so the most frequent action stops requiring a reach to the top of a tall folded screen. Consumer rules unchanged — no core-logic bypass.
  • Dropped from the touch bar (still §3.3-reachable elsewhere): Help → Menu · System; Modes → Home grid (Phase B); New Game → Home hero.
  • Hold-to-repeat Undo (both platforms, additive): after 0.45 s the hold repeats at ~5.5 undos/s, every step through the normal request path so the scoring penalty and No-Undo gating apply. Timing contract is a pure function with unit tests — no wall-clock in tests.
  • Ambiguity gate stays at zero: new self-ambiguous DrawRequestWriters set covers the four DrawRequestEvent writers (keyboard, stock click, touch stock tap, HUD button).

Tests & verification

  • 6 new hud_plugin tests (bar contents per platform, draw fires/paused-noop, hold boundary math, hold-state reset); full workspace suite + clippy -D warnings green.
  • Emulator smoke (x86_64 debug APK, folded 900-logical posture): bar renders Menu · Undo · Draw · Hint · Pause above the gesture pill via SafeAreaAnchoredBottom; no panics in logcat.

Fold 7 checks after merge: trio hit-targets one-handed in both postures, hold-to-repeat feel (0.45 s / 0.18 s tunables), and that dropping New/Help/Modes from the bar doesn't sting in practice.

🤖 Generated with Claude Code

Implements Phase F of docs/ui-redesign-2026-07.md (decision 5 recorded in the first commit: **touch-only**; desktop bar unchanged). ## What changed - **Touch bar restructured to five buttons** (`USE_TOUCH_UI_LAYOUT`): an enlarged **Undo · Draw · Hint** trio (96×64 px targets, 1.35× labels, `TEXT_PRIMARY`) between compact Menu and Pause. Survey note: the bar itself has lived at the bottom since the May A1 work — Phase F's real gap was target size, a Draw affordance, and bar clutter. - **Draw is new**: fires the same `DrawRequestEvent` as tapping the stock (guarded while paused, mirroring `handle_stock_click`), so the most frequent action stops requiring a reach to the top of a tall folded screen. Consumer rules unchanged — no core-logic bypass. - **Dropped from the touch bar** (still §3.3-reachable elsewhere): Help → Menu · System; Modes → Home grid (Phase B); New Game → Home hero. - **Hold-to-repeat Undo** (both platforms, additive): after 0.45 s the hold repeats at ~5.5 undos/s, every step through the normal request path so the scoring penalty and No-Undo gating apply. Timing contract is a pure function with unit tests — no wall-clock in tests. - **Ambiguity gate stays at zero**: new self-ambiguous `DrawRequestWriters` set covers the four `DrawRequestEvent` writers (keyboard, stock click, touch stock tap, HUD button). ## Tests & verification - 6 new hud_plugin tests (bar contents per platform, draw fires/paused-noop, hold boundary math, hold-state reset); full workspace suite + `clippy -D warnings` green. - Emulator smoke (x86_64 debug APK, folded 900-logical posture): bar renders Menu · **Undo · Draw · Hint** · Pause above the gesture pill via `SafeAreaAnchoredBottom`; no panics in logcat. Fold 7 checks after merge: trio hit-targets one-handed in both postures, hold-to-repeat feel (0.45 s / 0.18 s tunables), and that dropping New/Help/Modes from the bar doesn't sting in practice. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 2 commits 2026-07-13 23:14:14 +00:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat(engine): Phase F touch action bar — thumb-reach Undo/Draw/Hint + hold-to-repeat undo
Test / fmt (pull_request) Successful in 5s
Test / test (pull_request) Successful in 4m25s
fa54c58bc4
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>
funman300 merged commit d989d07fe7 into master 2026-07-13 23:22:15 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#177