Add a touchscreen right click and a seam for the release-bypass tests - #41
Merged
thirteen37 merged 1 commit intoAug 21, 2026
Merged
Conversation
Restricting the secondary tap recognizer to indirect pointer input left no way to right-click without a trackpad or mouse attached. A two-finger tap fills that gap, routed through the same click path so it gets the same hold. It is restricted to direct touches because a trackpad's two-finger tap already arrives as an indirect secondary click, and both firing would double up. A stationary two-finger tap starts neither the pan nor the pinch, so wheel scrolling and zoom are unaffected. Long-press was the alternative but collides with the one-finger drag, which is already a held left button: pausing before a drag would fire a spurious right click first. ViewerViewModel's session is now injectable, so sendInputRelease's deliberate bypass of the capture guard is covered by tests rather than by reading it. The parameter is defaulted, so every existing call site is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XU7Ck7AbZ9KpRhdPbRzNj8
thirteen37
deleted the
feature/touchscreen-right-click-and-viewmodel-seam
branch
August 21, 2026 15:12
6 tasks
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.
Closes the two loose ends left after #40.
Two-finger tap → right click
Restricting the secondary tap recognizer to
.indirectPointerin #40 fixed taps arriving as right clicks, but left no way to right-click at all without a trackpad or mouse attached. A two-finger tap now fills that gap, routed through the existingemitClick(buttonNumber: 1, …)so it inherits the same 50 ms hold.It's restricted to
.directtouches deliberately: a trackpad's two-finger tap already arrives as an indirect secondary click, so without the restriction both recognizers would fire for one gesture.Checked for conflicts — a stationary two-finger tap starts neither the pan (needs movement past slop) nor the pinch (needs a scale change), so wheel scrolling and zoom are unaffected.
Long-press was the alternative convention. It collides with the one-finger drag, which
handlePanalready treats as a held left button, so pausing before a drag would fire a spurious right click first.ViewerViewModeltest seamsendInputReleasebypasses the capture guard on purpose — a button or key held when capture is switched off would otherwise stay pressed on the host forever. That was only verified by reading it, because the session was built internally with no way to substitute one.initnow takes a defaultedsession:parameter, so every existing call site is unchanged, andMockKVMSessionrecords what reaches the session.Verification
Both new behaviours were checked against a deliberately broken version, not just a green run. Adding
guard isMouseCaptureEnabledback onto the bypass fails the test with:Test plan
🤖 Generated with Claude Code