fix(client): make the debug triple-tap gesture actually recognize three taps - #5189
fix(client): make the debug triple-tap gesture actually recognize three taps#5189jeffrey701 wants to merge 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…ee taps The touch gesture documented as 'Triple-tap: Toggle debug panel' fired at tapCount >= 2 (a double-tap), and — worse — reset tapCount to 0 on every touchstart whose e.touches.length !== 3. Because a 3-finger tap always arrives as separate 1-, 2-, then 3-finger touchstarts (fingers never land on the same millisecond), those intermediate events zeroed the counter, so it never climbed past 1 and the panel never opened on real hardware. Extract a pure, unit-tested recognizer that ignores (does not reset on) non-3-finger touchstarts and requires three 3-finger taps within the window.
c497a7c to
8e1803e
Compare
|
Deferred by maintainer intake policy — not ignored. This current head ( A maintainer must explicitly take this PR or add a local frontend-review exception before it can receive substantive review. The defer label is a routing marker only, not a verdict on the change. |
2 similar comments
|
Deferred by maintainer intake policy — not ignored. This current head ( A maintainer must explicitly take this PR or add a local frontend-review exception before it can receive substantive review. The defer label is a routing marker only, not a verdict on the change. |
|
Deferred by maintainer intake policy — not ignored. This current head ( A maintainer must explicitly take this PR or add a local frontend-review exception before it can receive substantive review. The defer label is a routing marker only, not a verdict on the change. |
Problem
useKeyboardShortcuts(client/src/hooks/useKeyboardShortcuts.ts) registers a touch gesture documented as "Triple-tap (touch): Toggle debug panel (iPad/mobile)". The implementation is broken two ways:tapCountto 0 on each of those leading 1- and 2-finger events, so after a full 3-finger taptapCountis only ever 1. On real hardware the panel never opens.tapCount >= 2— a double-tap, not the documented triple-tap.Fix
Extract a pure
advanceTripleTaprecognizer (client/src/hooks/tripleTap.ts): a touchstart that isn't exactly 3 fingers is ignored (not reset), only exact-3-finger touchstarts count, and the gesture completes on the third such tap within the 500ms window. The hook threads its state through the recognizer.Tests
Adds
tripleTap.test.ts: triggers only on the third 3-finger tap; the leading 1-/2-finger events of each tap don't reset progress (the real-hardware case); two taps don't trigger; an out-of-window tap restarts; state resets after a trigger. All five fail against the old logic (verified by swapping it back in) and pass with the recognizer.Self-contained: only
useKeyboardShortcuts.ts, a new pure recognizer, and its test; no engine/Rust/protocol changes.Model: claude-opus-4-8