Block swipe beats iOS text selection on a real iPhone (#397) #523

Closed
kayg wants to merge 1 commit from issue/397-ios-swipe-2 into dev
Owner

Fixes the look of a swiped block on a real iPhone (#397). Not merged; waits for kayg.

Cause. In the iPhone simulator, with real touch events, the swipe already picked the block every time; native text selection never won. But iOS paints no selection with the keyboard down and CodeMirror draws only two handles, so a picked block looked like half-selected text.

Fix (packages/editor/src/blocks/, gesture-claim logic unchanged): the approved look from select.html (left circles). picked.ts: blocks slide right on a critically damped spring, a 24 pt ring or filled check circle in the left gutter, 16% accent tint per picked block, no handles. follow.ts: the block follows the finger inside the page and settles back on the same spring. spring.ts: the one spring. Only picked.ts and follow.ts are the look.

Evidence and gates: comment on #397.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WCcFhwwgMK66k9LMVqogNJ

Fixes the look of a swiped block on a real iPhone (#397). Not merged; waits for kayg. **Cause.** In the iPhone simulator, with real touch events, the swipe already picked the block every time; native text selection never won. But iOS paints no selection with the keyboard down and CodeMirror draws only two handles, so a picked block looked like half-selected text. **Fix** (`packages/editor/src/blocks/`, gesture-claim logic unchanged): the approved look from `select.html` (left circles). `picked.ts`: blocks slide right on a critically damped spring, a 24 pt ring or filled check circle in the left gutter, 16% accent tint per picked block, no handles. `follow.ts`: the block follows the finger inside the page and settles back on the same spring. `spring.ts`: the one spring. Only `picked.ts` and `follow.ts` are the look. Evidence and gates: comment on #397. 🤖 Generated with [Claude Code](https://claude.ai/code) https://claude.ai/code/session_01WCcFhwwgMK66k9LMVqogNJ
Block swipe on iPhone: draw the picked block ourselves, and let the block follow the finger (#397)
Some checks failed
CI / server (pull_request) Successful in 23s
CI / rust (pull_request) Failing after 1m57s
CI / web (pull_request) Failing after 43m26s
4b431c0342
On an iPhone the swipe already picked the block (the block bar showed), but the phone paints
no selection with the keyboard down, and CodeMirror draws only two little handles on iOS. So
a picked block looked like text half selected by a finger, and kayg read it as iOS winning.
Reproduced in the iPhone simulator with real touch events: the swipe selected the block in 10
of 10 tries, with two handles and no highlight.

- picked.ts: a picked block gets a rounded tint (a layer behind the text), a filled dot at its
  right edge and a hollow dot on every other block, and no handles or native selection paint.
  It lasts while the selection is the block.
- follow.ts: while the finger swipes, the block follows it (half the distance, at most 56 px),
  a dot fills once the swipe is far enough, and the block springs back on release.
- touch.ts: calls them. The claim logic and swipe-hold.ts are unchanged.
- e2e: the look, the follow and spring back, and a short swipe that selects nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QGa6qjALuHyi8H1naGp6b
Author
Owner

Landed in train y, #565.

Landed in train y, #565.
kayg closed this pull request 2026-10-17 20:10:19 +00:00
Some checks failed
CI / server (pull_request) Successful in 23s
CI / rust (pull_request) Failing after 1m57s
CI / web (pull_request) Failing after 43m26s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!523
No description provided.