fix(client): make the debug triple-tap gesture actually recognize three taps#5189
Open
jeffrey701 wants to merge 1 commit into
Open
fix(client): make the debug triple-tap gesture actually recognize three taps#5189jeffrey701 wants to merge 1 commit into
jeffrey701 wants to merge 1 commit into
Conversation
Contributor
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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