Pocket tutorial cleanup: copy, mobile selection UI, and gesture compass polish#105
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The options phase laid out option chips with squareDirectionVector, whose diagonal magnitude is √2, flinging diagonal sub-options to square corners while cardinals sat on the circle. Use the normalized direction vectors so every option lands on the circle at the given radius. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When a drag crossed the select radius into a submenu, the reference origin stayed pinned at RADIUS_SELECT from the start. Continuing to drag in the opening direction (the natural overshoot) meant the user had to drag all the way back through it before a move in any other direction could register. Add advanceOptionOrigin, a ratchet that slides the option origin outward to meet the finger while the drag continues in the selection direction, so a reversal immediately counts toward the intended option. Applied to both the options and quit submenu phases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The compass circle now tracks the gesture: it spawns expanded, collapses to the selection point when the first item is chosen, stays collapsed while the drag keeps overshooting in the opening direction, then latches back to full size as soon as the drag stops or turns toward an option — staying expanded until the final selection collapses it to the chosen item. Add an `expanded` latch to the options/quit states (set where overshoot is already detected) and drive the circle's scale/opacity/origin from phase in the component. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The expand latch only released when the drag fully stopped pushing outward or reversed, so settling jitter kept the compass collapsed until a deliberate move back — adding a second pause before it expanded. Treat an outward push smaller than OPTION_EXPAND_RELEASE as a settle (still ratcheting the origin), so the compass expands the moment the placards settle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a TouchUiContext that MobileTerminalUi provides, so the shared selection components can tell they are rendered in the touch UI: - SelectionPopup drops the Cmd+C / Cmd+Shift+C shortcut hints (no keyboard on touch) and always anchors above the selection so the thumb can't cover it. - SelectionOverlay anchors its hint above the selection and labels block selection as "Start drag with double-tap" instead of "Hold Opt". Desktop behavior is unchanged (context defaults to false). Add Storybook stories covering both desktop and mobile for each component. Note: the double-tap block-selection gesture the mobile hint describes is not yet wired up — touch drags still produce linewise selections. Implementation follows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The mobile selection hint promises block selection via double-tap, but touch events have no Alt key (the only thing that set block shape). Detect a double-tap in the terminal mouse router — a press landing soon after and near the previous touch that ended as a tap — and latch block mode for the drag it begins, carrying it through beginDrag/updateDrag. Recording the tap only on a no-drag release keeps two quick consecutive drags from being mistaken for a double-tap. Desktop Alt behavior is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the missing "to" in the gn-enter/gn-esc hints, and match the on-screen mode button label by writing `Gestures` mode in the Pocket Copy paste prose (`Select` and `Mouse` in the same sentence already match their button labels). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The exploded-option layout switched from a square to a circle in ee1293b, but the mobile-ui spec still described `RADIUS_LAYOUT` as a square half-side. Rewrite that paragraph to match the code and add a unit test asserting `hypot(vec.x * R, vec.y * R) ≈ R` for every direction vector so the invariant can't quietly regress. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
b30e21b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://092f0b0d.mouseterm.pages.dev |
| Branch Preview URL: | https://mobile-tut-cleanup.mouseterm.pages.dev |
This single-snapshot test caught no real bugs and broke on every SiteHeader tweak (most recently the mobile Playground link). Delete the test and its snapshot rather than re-baselining it again. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dormouse-bot
approved these changes
May 28, 2026
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.
Summary
docs/specs/tutorial.mdto point at the canonical copy intut-items.ts/tut-runner.ts, clarify the Gesture/Select hints, and surface the Playground nav link on mobile.Alt).RADIUS_LAYOUTinvariant in place.Test plan
pnpm -C lib test(mobile-gesture-menu + terminal-mouse-router unit suites)Components/SelectionPopupDesktop vs Mobile;Components/SelectionOverlayMobile{Linewise,Block}Drag;MobileTerminalUiGestureSoutheastOvershootchangelog, nocp-overridestep🤖 Generated with Claude Code