Repository navigation
fix(io): auto-scale the default pinch distance to the screen - #481
Merged
gmegidish merged 1 commit intoNov 13, 2026
Merged
Conversation
|
Warning Review limit reached
This review includes 5 billable files and costs up to $1.25. Or wait 57 minutes for your next included review. View limit details
|
The default --distance was a fixed 200px. Combined with the 30px start gap, a pinch centered on a narrow screen (iOS ~402pt wide, center x≈201) put the inner finger at x=-29 and failed every time with "past the left edge", so `io pinch --direction out` never worked on a phone-sized screen with defaults. When no distance is given, derive it from the center so the inner finger stays on-screen (far = startGap + distance must not exceed x). This needs only the center, not the screen size, so it keeps working on a rotated screen. An explicit distance is still honored and still edge-checked. --distance now defaults to 0 (auto).
gmegidish
force-pushed
the
fix-pinch-default-distance
branch
from
November 13, 2026 10:50
0577d91 to
b6d1809
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
io pinchdefaulted--distanceto a fixed 200px. With the 30px start gap, a pinch centered on a narrow screen (iOS ~402pt wide → center x≈201) placed the inner finger at x=-29 and failed every time:So
io pinch --direction out(andin) never worked on a phone-sized screen with defaults.Fix
When no distance is given, derive it from the center: the binding constraint is the left edge (
far = startGap + distancemust not exceedx), soautoPinchDistance(x) = (x - startGap) * 4/5, floored at a small minimum. This needs only the center — not the screen size, which mobilecli only knows in the natural orientation — so it keeps working on a rotated screen and leaves the far edges to the device like the rest of pinch. An explicit--distanceis still honored and still edge-checked.--distancenow defaults to 0 (auto).Tests
autoPinchDistancekeeps the inner finger on-screen across centers;pinchActionsat a narrow center (x=201) now builds valid actions for both directions; existing default-distance test updated.io pinch --direction out/inwith defaults succeeds.--distance 5000still errors clearly.