iOS Safari: a swipe on a block selects text instead of the block #397
Closed
opened 2026-10-15 03:36:11 +00:00 by kayg
·
13 comments
No Branch/Tag specified
main
port/tasks-float-2
fix/train-1116-2
fix/train-1116-3
fix/train-1116-1
fix/flake-1134
fix/server-1182
dev
port/notes-float-3c
docs/auto-update-ig
feat/dav-transport
port/tasks-float-1
wip/mail1011-sv-order-1116
fix/flake-1179
fix/flake-1178
fix/guards-1153-fsio-split
fix/guards-1153-notes-split-we
fix/guards-1153-notes-lib
fix/guards-1153-notes-home
fix/guards-1153-ui-primitives
fix/guards-1153-primitives-e2e
fix/guards-1153-visibility-doc
feat/paper-grey-1116
fix/flake-1165
fix/flake-1119
docs/imap-766-plan-v2
fix/e2e-unique-ports
t3/paged-search-reconcile-final
wip/mail1011-final-1115
docs/tasks-float-port
perf/editor-first-paint-1c
feat/imap-notes-fetch
feat/imap-notes-projection
feat/imap-notes-readonly
feat/imap-notes-auth
feat/imap-notes-server-foundation
wip/mail1011-txn-ownvocab-1115
wip/mail1011-txn-novocab-1115
perf/p1117-final-harness
perf/single-shot-repeats
port/tasks-matrix
wip/mail1011-txn-1115
fix/static-gates-1155
feat/files-s1-identity-r7
fix/files-r7-idle-loop
fix/daily-train-1152
port/notes-float
fix/editor-tables-test-types
port/notes-float-listscript
feat/tasks-actions
port/notes-float-phone-preload
perf/sound-comparator
port/notes-float-listscroll
port/notes-float-budgets
port/notes-float-suite-fix-b
port/notes-float-sidebar-fix
port/notes-float-trim
port/notes-float-3-lists
fix/attachments-meta-capability
docs/carddav-writes-v2-plan
feat/contacts-companion-pure
issue/carddav-read-perf-fix-r2
issue/carddav-read-r2
port/notes-float-devsync2
review/calendar-2
review/switcher-a-pills
port/notes-float-switcher-a
port/port-tables-2
review/switcher-ends
wip/whiteboard-s1-1114
port/port-tables
wip/mail1011-perfneutral
review/photo-tint
port/notes-float-shell
wip/local/collections-db
wip/local/mail-p1
wip/local/cold-growth-on-tiering
wip/local/tiering-v3-s1
wip/local/wal1051-cap
wip/local/tiering-v3-s1-resume
wip/local/index-position-startup-scan
port/notes-float-flat
port/notes-float-promote
wip/handover/mail1011-candidate
wip/handover/files-s1-candidate
port/notes-float-shell-only
port/notes-float-perf
feat/whiteboard-s1
feat/tiering-v5
fix/app-switch-hitch
wip/local/files-s1-dev-v4-final
feat/files-s1-dev-v4
fix/c2-glass-shared
feat/flat-lists
wip/handover/whiteboard-s1-resume
wip/att-lazy-861
feat/switcher-browse
wip/att-lazy-860
feat/tasks-float
recovered/flat-backup-candidate
perf/stalls-1054-kc
land/ai-toolbar
feat/collections-db
feat/collections-db-fixes
codex/mail-1011-redesign-20261111
fix/ai-toolbar
backup/macos-vm/st3-head
perf/trim-candidate-phonestack
feat/switcher-three
fix/1051-index-idle-checkpoint
perf/stalls-1054-kb
perf/stalls-1054-k
perf/stalls-1054-r3
fix/c2-contrast-tail
perf/stalls-1054-r3-preview
feat/collections-before
feat/tiering-v4
fix/timelog-caret
wip/local/tasks-actions
docs/tasks-writes-v2-plan
st3-r3
feat/pass8
review/calendar-2-before-1111
wip/tiering-v3-cold4
perf/stalls-1054-r2
fix/suite-A4
fix/suite-A5-probe
fix/suite-A6
fix/suite-A3
fix/suite-A2
fix/suite-A5
fix/suite-A1
wip/local/attachments-861-fix
feat/contrast
wip/local/ports-861
storage/wal-checkpoint-off-save-1051
wip/local/mail-1011-reconcile-20261110
feat/style-sheet-fixes
feat/money-round
perf/stalls-1054
wip/tiering-v3-cold5
t3/mail-1011-liveness
feat/iphone-fixes
feat/notes-approve
wip/local/shrow-work
feat/files-s1-identity
feat/quickfix
wip/tiering-v3-cold
wip/local/shared-row-swipes
backup/macos-vm/pfx-B
backup/macos-vm/pfx-C
backup/macos-vm/pfx-D
feat/contrast-r1
feat/tiering-v3-s2-tags
feat/folder-drop
t3/photos-s1
feat/tiering-v3-s1-namespace
wip/local/photos-s1
t3/photos-plan-slice-one
recovered/backup/p1b-61505
t3/paged-search-reconcile
t3/smooth-pane-transitions
t3/index-position-startup-scan
fix/private-staging-759b-r2
backup/macos-vm/hk/hk1009/pr877
backup/macos-vm/hk/hk1009/pr878
docs/undo-block-ids-plan
fix/undo-768
backup/macos-vm/hk/hk1009/pr875
backup/macos-vm/hk/hk1009/pr904
proto/block-identity-v7d
backup/macos-vm/hk/hk1009/pr846
backup/macos-vm/hk/hk1009/pr860
backup/macos-vm/hk/hk1009/pr861
backup/macos-vm/hk/hk1009/pr849
backup/macos-vm/hk/hk1009/pr848
backup/macos-vm/hk/hk1009/pr853
backup/macos-vm/hk/hk1009/pr957
backup/macos-vm/hk/hk1009/pr893
backup/macos-vm/hk/hk1009/pr889
backup/macos-vm/hk/hk1009/pr902
docs/imap-notes-plan
docs/quota-plan-2
fix/parallel-test-flakes
docs/calendar-backend-v2-plan
feat/calendar-ical-converter
backup/macos-vm/hk/hk1009/pr808
docs/contacts-import-v2-plan
issue/610-pm-midnight
feat/calendar-v2-s1-containment
backup/macos-vm/hk/hk1009/pr854
backup/macos-vm/hk/hk1009/pr845
backup/macos-vm/hk/hk1009/pr917
docs/dav-recorder-v2-plan
plan/previews-865
plan/save-log-durable-entry
backup/macos-vm/hk/hk1009/pr934
fix/e2e-data-on-ram
backup/macos-vm/hk/hk1009/pr888
feat/appwindow3
feat/appwindow2
feat/appwindow
feat/money-p1
feat/keys-sheet
review/calendar-2-themes
feat/smooth-cursor
fix/float-style
review/calendar-2-float
release/2026-11-06-hotfix
archive/port/rows-drop-code
archive/port/rows-actions
archive/port/rows
scratch/tasks-894-ui-gates
review/calendar-2-night-wip
recovered/flaky/toast-reduced
release/2026-11-05
archive/flaky/rows-drop-fixed
archive/flaky/rows-actions
archive/flaky/rows
sim/bm15-final
sim/bm15-bis-932
sim/bm15-bis-909
sim/bm15
sim/bm15-bis-887
perf/tiering-option-b
fix/sw-lazy-precache
archive/plan/save-log-durable-entry
mock/money-fix2
archive/fix/e2e-data-on-ram
mock/appearance-all
mock/pill-press
mock/pill-press-mac
backup/macos-vm/appearance-after
mock/auto-swipes
mock/mail-actions
backup/macos-vm/mock/mail-actions
mock/money-static
archive/review/standards-917
perf/tiering-761-fix
mock/type-audit
mock/third-pane
feat/contacts-import-v2-s1
perf/executor-hot-path
archive/port/hidden-blocks
archive/port/devices
scratch/executor-on-894
scratch/executor-spans2
scratch/executor-spans
archive/port/rows-drop
feat/tiering-761-d-scale
feat/tiering-761-c-index
feat/tiering-761-b-reader
archive/review/sharing-pr3-review-9fec3d1f
perf/ports-lazy-budgets
feat/tiering-761-a-migration
archive/review/sharing-pr3-review
archive/review/sharing-pr3-review-code
archive/plan/previews-865
archive/port/port-attachments-3
archive/port/contacts-merge
fix/motion-audit-859
fix/motion-audit-859-mac
archive/port/port-pickers
archive/port/port-tables-2
archive/port/port-tables
recovered/local/sharing-s1-pr2-room-snapshot-candidate
archive/fix/parallel-test-flakes-code-minipc01
docs/imap-766-readonly-slice
feat/dav-recorder-v3
research/788-diagnosis
archive/fix/parallel-test-flakes
archive/perf/pr792-cold-index-edit
docs/sharing-slice-1
recovered/feat/dav-recorder-v2
recovered/feat/dav-recorder-v2-edd7bbb
spike/imap-766-s0-cases
archive/fix/undo-768
recovered/feat/dav-recorder
recovered/feat/dav-recorder-901acd4
feat/contacts-import
perf/cold-growth-on-764
perf/cold-growth-on-tiering
recovered/feat/tasks-set-status
feat/tasks-move-reorder
feat/tasks-delete-promote-duplicate
feat/carddav-writes
perf/quota-on-tiering
perf/quota-simple
perf/cold-growth-on-quota-stack
recovered/perf/cold-growth-on-tiering
feat/calendar-identity
feat/calendar-event-parser
feat/calendar-props-maps
port/glass-when-ring
recovered/feat/tiering-761-s1-wip-8132a84
recovered/feat/tiering-761-s1-wip-9da4094
recovered/feat/tiering-761-s1-wip-724512c
recovered/feat/tiering-761-s1-wip-66e667e
recovered/feat/tiering-761-s1
wip/6by32-01-tier-761-s1-pause-20261030
spike/imap-766-s0
wip/6by32-02-calternal-pause-20261030
wip/8by64-01-review-688-pause-20261030
wip/6by32-01-verify-744-pause-20261030
wip/6by32-01-verify-742-pause-20261030
fix/private-staging-759b
wip/6by32-01-review-748-pause-20261030
wip/6by32-01-review-733c-pause-20261030
wip/6by32-01-review-733b-pause-20261030
review/calendar-month
wip/local/bm15-trash
plan/759b-staging
review/767b-tests
review/preview-2026-10-29
docs/tiering-731-plan
wip/c6b02-review-733d
wip/c6b02-bm1-full-a
docs/deploy-plan
fix/storage-owner-liveness-642
fix/storage-fix-7
feat/tiering-731
wip/tiering-731-first-attempt
perf/idle-honest-2
fix/storage-private-tmp-642-dev
fix/storage-exact-file-quarantine-642
perf/one-flush-save
review/calendar-static
review/indexing-ring
review/when-field-2
proto/block-identity-2-review
proto/block-identity-review
review/when-field
issue/tasks-create-ids
issue/tasks-create
review/combined
review/task-polish
review/top-buttons
review/q1-q5
archive/integ325-293
archive/integ325-ci
issue/calendar-adr
archive/old/train/2026-10-23bk2
archive/old/train/2026-10-23bk
issue/469-mockup-9a
issue/smart-tasks-mockup
issue/469-menus
issue/652-signout-flake
issue/652-history-fix7
issue/652-history-fix6
archive/old/issue/spring-check-perf
issue/spring-check-perf
issue/659-rename-fast
archive/old/train/2026-10-21ar
issue/search-hardening-3
issue/652-history-fix5
issue/660-port-sheets-glass
issue/652-history-fix4
issue/652-history-fix3
issue/652-history-fix2
issue/652-history-flake
train/2026-10-21an
issue/settings-admin-port
issue/search-port
train/2026-10-20am
issue/storage-split-fix2
issue/storage-split
archive/old/issue/folder-ids-fix
train/2026-10-20al
archive/old/issue/folder-ids
train/2026-10-20ak
issue/tables-mockup
train/2026-10-19aj
train/2026-10-19ai
issue/469-merge-fixes
issue/sidebar-band
archive/old/issue/608-settings-spec
train/2026-10-19ah
issue/swipe-offscreen
train/2026-10-19ag
archive/old/issue/590-nlp-adr
archive/old/issue/587-event-after-write-2
train/2026-10-19af
archive/old/issue/587-event-after-write
issue/469-pill-room-c
issue/469-pill-room
train/2026-10-19ae
issue/469-narrow-handle
issue/397-ios-swipe-2
issue/469-desk-fixes
archive/old/issue/auto-update-adr
issue/469-filter-gap
issue/469-port-1b
issue/442-opacity-flake
issue/327-web-fast-3
archive/old/issue/469-port-1
issue/469-port-1
issue/327-web-fast-2
archive/old/issue/327-web-fast
archive/old/issue/425-stt-bench-vq1
archive/old/issue/445-no-bleed
archive/old/issue/400-swipe-mockup-2
issue/426-client-review
issue/426-client-2
issue/426-client
archive/old/issue/476-safe-area-lab
archive/old/issue/445-top-light
issue/471-blocks-mockup
archive/old/issue/448-links-app-2
archive/old/issue/448-links-app
archive/old/issue/398-cold-links
issue/434-442-small-2
issue/434-442-small
archive/old/issue/398-unload
archive/old/issue/445-bottom-band
issue/445-bottom-band
issue/351-rem-3
issue/351-rem-2
issue/351-rem
archive/old/issue/327-first-note
issue/395-width-phone
archive/old/issue/327-typing
issue/396-ios-edges
issue/397-ios-swipe
archive/old/issue/327-notes-index
issue/345-347-contrast-empty-2
archive/old/issue/44-arenas
issue/44-arenas
archive/integ325
archive/old/issue/327-perf-harness
archive/old/issue/44-thp
issue/44-thp
archive/old/issue/285-sticky-pills
archive/old/issue/44-trim-3
issue/44-trim-3
archive/old/issue/165-cards
archive/old/issue/165-picker-2
archive/old/issue/212-multi-select
No results found.
Labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#397
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
kayg on an iPhone (Safari): swiping left or right on a block selects the text, not the block. Block select by swipe (#269/#283, train c) works in the e2e runs (WebKit with touch emulation) but not on a real iPhone.
On a real iPhone, a horizontal drag in a contenteditable starts the native text selection or loupe. Our touch handling (passive listeners?
touch-action?user-select? timing?) evidently loses to it.To do:
touchstart/touchmovewithpreventDefaultbefore the selection starts;touch-action: pan-yon the lines;-webkit-user-select/-webkit-touch-callout; when iOS commits to a selection; gesture-start detection thresholds; what CodeMirror 6 does on iOS (its own touch handling,EditorView.inputHandler, the contenteditable selection sync); and how ProseMirror-based and Notion-like editors do swipe or drag handles. Cite sources.Plan (research first)
What iOS does (findings)
touchstart. In WebKit's iOS UI process, the "touch move" deferring recognizer only holds back pan and pinch gestures. The text-selection loupe, tap-and-a-half (double-tap-drag) and long press are deferred only bytouchstart(andtouchend). SopreventDefault()intouchmovecan stop a scroll but can't veto a text selection that has already started. Source:WKContentViewInteraction.mm,deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:(WebKit main), and the deferral design in r253267.WebPageProxy::handlePreventableTouchEventsends a touch type asynchronously, and tells UIKit "not prevented", when every listener for it is passive. Ourtouchstartis passive. Only the firsttouchmoveis a deferral point (m_touchMovePreventionState). After that, a preventedtouchmoveonly makes WebKit's touch recognizer "begin", which cancels native gestures that haven't fired yet, and only while no scroll has started (scrollViewWillStartPanOrPinchGesturesets_touchEventsCanPreventNativeGestures = NO). Sources: WebPageProxy.cpp, WKTouchEventsGestureRecognizer.mm ("If default was prevented, set the state to cancel other recognizers").textInteractionGesture:shouldBeginAtPoint:, a focused editable lets the loupe begin anywhere inside it. The page's only veto there isuser-select: noneat the point. Since iOS 13, a drag over editable text selects it (Gadget Hacks, Michael Tsai).touch.tsonly callspreventDefault()once the finger has moved 32px. By then iOS has long since handed the touch to its own selection, which usually ends our touch with atouchcancel. We don't listen for that, so the block is never selected and the native selection wins.drawMainRange = !browser.ios), and draws iOS handles instead (codemirror/dev#1538, discuss). Itstouchstart/touchmoveobservers mark DOM selection changes asselect.pointer. So each step of the loupe reaches us as a CM selection change, and ourrefresh()turns it into "words selected".browser.iosis false there. The tests check our handler's logic, never the race with iOS.touchmovebreaks iOS text selection and only does it when nothing is selected (meta). Craft and Notion do their swipes natively. On iOS,touch-action: pan-ydoesn't stop text interaction (Kendo notes pan-x/pan-y were unsupported on iOS for a long time).Approach (plugin-local,
packages/editor/src/blocks/)Claiming the touch at
touchstartisn't an option: it would cost scrolling, tap-to-place-caret and long-press selection. So the fix wins the race where it can and takes the block back where it can't:touchmoveis prevented. That is before iOS commits, so the scroll and any not-yet-fired native gesture are cancelled. The block is still only selected at 32px. Anything slower than 300ms (a hold, which is how long-press selection starts), mostly vertical (a scroll), or a second touch right after a tap (a double-tap-drag) is left to the phone.touchcancelcounts. If iOS takes a claimed swipe from us anyway, the cancel still selects the block.select/select.pointerchange back into the selection we had. A loupe that slipped through can't turn the block into words. The next touch drops the hold at once.-webkit-user-select: none, so the selection can't grow as the finger moves.Tests: extend
e2e/touch-select.spec.tswith a cancelled swipe, a slow (held) drag left to the phone, a vertical drag not prevented, an early claim, and a stray selection during the hold. Then run touch-select, bar-, phone- and editor on webkit-390 and chromium-390. Emulation can't prove the iPhone result, so a device checklist follows.Fix in PR #403 (
issue/397-ios-swipe, not merged)Changes:
packages/editor/src/blocks/touch.tsnow claims a swipe early: its first quick (<300ms), clearly sideways move past 10px. From then on every move is prevented, and atouchcancelstill selects the block. The newpackages/editor/src/blocks/swipe-hold.tsholds the block selection against selection changes from the screen. It lasts while the swipe is down, plus 400ms after the phone's selection goes quiet (3s at most). Text can't be selected while swiping. A hold, a scroll, a double-tap-drag and the left-edge back swipe stay the phone's.Test results (emulated; this can't prove the iPhone result):
touch-select(11 cases, 6 new): pass on webkit-390 and chromium-390. The "phone's own selection during a swipe" case fails with the hold switched off, so it checks the fix.packages/editorvitest: 112/112.svelte-check: 0 errors.Device checklist for kayg (iPhone, Safari)
Emulated WebKit has no iOS gesture recognizers, so these steps are the real test. Use a note with a few paragraphs and a list. Try each one with the keyboard down (just opened, reading) and again with it up (after tapping into the text). The keyboard-up case is the one that broke.
Swipe selects the block
Things that must still be the phone's
5. Vertical scroll: drag up and down starting on text. It scrolls as before, also with a slightly diagonal drag.
6. Tap on words: the caret goes there and the keyboard comes up (text bar).
7. Long-press a word, then drag: native text selection with the loupe and handles, then the Copy/… menu. The bar shows text formatting, not block actions.
8. Double-tap a word: it selects that word (keyboard up).
9. Double-tap and drag (tap, then quickly touch again and drag): native word selection, not a block.
10. Swipe from the very left edge of the screen: Safari's back gesture, not a block.
11. Tap on the left edge/margin or a bullet: selects the block, as before. Tap a task's tick box: toggles it.
After a swipe
12. Right after a swipe-select, tap a word. Expected: the caret goes there. If the first tap is ignored, tell me (the hold is meant to let go on the next touch).
13. A slow sideways drag (taking about half a second to start moving) is not a swipe and does whatever iOS does.
If something's off, please note: iOS version, keyboard up or down, where the finger started (words / margin / bullet), and what you saw (loupe? handles? which bar?). A screen recording is ideal.
Known, out of scope here: on an iPhone, CodeMirror shows any selection with the native highlight and iOS handles (it doesn't draw its own there). So a selected block looks like selected text with handles even when the bar correctly says Block actions. A block-shaped highlight would be a separate design issue.
Reopened: still broken on a real iPhone (iOS 27, Safari, production, 2026-10-17). kayg swiped across a list-item block, and iOS selected the TEXT instead (native selection handles across the whole line, with no visible block selection). The fix from #403 was only verified in emulated WebKit. Next: reproduce with real UIKit gestures in the iPhone simulator (XCUITest), then fix.
Real-UIKit reproduction and fix (PR #523)
Finding. iPhone 18 Pro simulator (iOS 27), Safari tab, raw touch events from XCUITest's event classes (no wait-for-idle). Production needs a passkey, so the "before" is a local build of origin/dev (
74336c9), same code. With the unmodified dev build the swipe picks the block every time (block bar "Block actions"); native text selection never won, in any speed or start point, keyboard down or up. What differs from what we wanted is the look: 2 CodeMirror handles, no highlight. That is kayg's screenshot, reproduced exactly (first image). The earlier fix never touched how a picked block is drawn.The ten swipes: right and left on text, fast (0.15 s), start on a link, on the bullet, on the tag, on the second item, diagonal, on a paragraph. Each "up" swipe came after a tap that raised the keyboard.
Before:


After:
Frames of a swipe (block follows the finger, dot fills, springs back, tint and dots):
Still native (after build, simulator): tap places the caret (keyboard up); long-press selects text with the system menu
; double-tap selects the word
; a vertical drag scrolls (scrollTop 979, 0 prevented moves, no block); a drag from x=6 is the back swipe (touchstart seen, never claimed, page went back); the link chip opens its note. A tag in the text is not a link on dev either.
Not proven: whether kayg's phone ever starts a native selection before our claim; the simulator never did. If the screenshot was a native selection, send a screen recording. The claim logic is unchanged.
The sim run lines are in the PR comment below the gates. Raw per-swipe JSON, before/after, down/up (scratch, not committed): /tmp/claude-1001/-home-kayg-Developer-calternal-cloud/204dcdd3-9d56-4d02-bbcc-2d778e727281/scratchpad/sim/e397/ev/before-down.txt, before-up.txt, after-down.txt, after-up.txt.
Gates
Block-selection mockup: https://preview.calternal.cloud/select.html
Variants: right · left · indent · indent-noring. Knobs:
&size=20|24|28,&tint=1|0. Swipe feel as #523 (32 px arms, block shows half the finger up to 56 px, tint 16%, radius 10), spring critically damped about 250 ms.Sheet from the iPhone simulator (row 1 light, row 2 mid-swipe on the paragraph, row 3 dark; columns right, left, indent, indent-noring; 2 of 6 blocks picked):
Approved by kayg, 2026-10-17:
select.html?v=left&size=24&tint=1. "this looks natural and great with the animation and motion you have picked! approved!"The look:
Next: build it into PR #523, replacing the right-side dot and the overshooting spring-back.
Approved look built into PR #523 (86fb22b, rebased on origin/dev
080c55e)Values copied from
select.css/Select.svelteof the mockup branch: 24 pt circle, 2 pt ring, circle left edge 14 pt from the screen edge, check = the app's icon (16 px, stroke 3), tint 16% accent, 10 px radius, 8 px past the text, 20 pt from the right edge, critically damped spring (omega 37, about 250 ms, no overshoot), swipe follows at half the distance (max 56, now also kept inside the page edge), arms at 32 px. Unlike the mockup: tints are 2 px shorter top and bottom so neighbours show a gap; the slide puts the text at 60 pt from the edge (mockup's absolute position), which is 40 pt on the app's 20 pt margin.Side by side, same device scale (mockup left, app right, 2 blocks picked, light and dark): /tmp/claude-1001/-home-kayg-Developer-calternal-cloud/204dcdd3-9d56-4d02-bbcc-2d778e727281/scratchpad/sim/e397/r2/compare-v3.png. Full-resolution crops: /tmp/claude-1001/-home-kayg-Developer-calternal-cloud/204dcdd3-9d56-4d02-bbcc-2d778e727281/scratchpad/sim/e397/r2/zoom-v3.png. Attached:


Earlier before/after (native handles vs new look):
Computed values, iPhone simulator (402 pt wide, dpr 3), mockup vs app editor
Text and font match; the app is not smaller. The mockup is a standalone page with its own bullet and indent, the app keeps the editor's tree layout, so I left those alone (changing bullets means changing tree lines for every note). Say if you want the editor's bullet moved to the mockup's.
One thing that does not match, as asked: in the mockup the right margin is always 60 pt, so the shift only translates. In the app the right margin is 20 pt, so a pure translate would push long lines 40 pt off the screen. So when picking starts the lines get a 40 px narrower column (once, together with the slide), and long lines rewrap once. Making it translate-only needs a permanent 60 pt right margin on phones for all notes: a layout change, so I did not do it. Tell me if you want it.
Gates (final code)
Multi-toggle (PR #523,
482b162, on origin/devbc7f401)While blocks are selected, a swipe on another block or a tap on its circle adds it, or takes it out if it is already in. Bar says "N blocks"; Done or Esc clears all. Delete, duplicate and type changes work on the list (they need not touch). The 2-block hook is not in the PR.
iPhone simulator, real touch events: swipe the list item, swipe the second item (2 blocks), swipe the second item again (back to 1, "Block actions"):
Found on the simulator: a pulled block's ring was found by the circles' shared class, so it left the first circle filled. Fixed (follow.ts).
Shot: /tmp/claude-1001/-home-kayg-Developer-calternal-cloud/204dcdd3-9d56-4d02-bbcc-2d778e727281/scratchpad/sim/e397/r4/multi.png
Gates (final code):
Bullets as the approved mockup (PR #523,
ec9954f, on origin/devbc7f401)A 6 px dot with the text 21 px in (was 5 px and 26 px), nested items too.
cm.css: marker box 21 px (still grows with the checkbox at larger text), dot 6 px at 4 px, a number starts 4 px in, a to-do box keeps its size with a 3 px gap so its text starts at the same edge as the bullets' text. The tree lines meet the markers where the app's.pagenow says (bullet centre 6.5 px, half height 3 px, left edge 0, number centre 10 px); tree.css defaults stay for the mockup.Before (left) / after (right), nested list with tree lines, same device scale, iPhone simulator: light
dark 

Numbers, nested bullet under a number, to-dos and a nested to-do:
Files: /tmp/claude-1001/-home-kayg-Developer-calternal-cloud/204dcdd3-9d56-4d02-bbcc-2d778e727281/scratchpad/sim/e397/r6/tree-light.png, tree-dark.png, tasks.png
Guides run through the dot centres, elbows stop just short of the child dots, text edges of bullets and to-dos line up (bullet and to-do text at the same x). Numbers keep their number inline as before. The 3 px gap between a to-do box and its text is tight; say if you want the box a little smaller.
Gates (final code)
Root cause and fix (PR: #576)
Cause. Both tints (the phone's picked look,
picked.ts, and the desktop's Esc / VimVlook,selected.ts) were laid out from CodeMirror's height map (lineBlockAt(...).top/bottom). The height map does not know the vertical margin of a block widget. A note with tags has the tag chips row under its title (margin-bottom: 14px), and a daily note has the date heading widget (margin-bottom: 14px) plus the chips row. Everything below those widgets is drawn lower than the map says, so the tint landed that much too high: over the end of the previous block, short of the bottom of the selected one. My earlier checks used notes with no tags and no day heading, so the map and the page agreed.Fix. One function,
blockBox(packages/editor/src/blocks/box.ts), measures the block's own.cm-lineelements as the browser drew them (first line's top, last line's bottom: wrapped rows, chips and tags all live inside the line), then adds the approved 8 px past the text sideways and the 2 px gap above and below. Space a line only has as padding (a heading's gap above it) is not covered. Phone tint, phone circles, the swipe pull tint and the desktop tint all use it. It measures again when the page lays out differently (resize, font load, wrapping, the picked slide), by a resize observer that exists only while a tint shows; no layout reads per frame.Before / after (2x)
Phone, light:





Phone, dark:
Desktop (Vim
V,j), light:Desktop (Vim
V,j), dark:iPhone simulator, real wrapped log lines in a day note, two swipes (before, after):
Round 3 of the selection mockup: card, no reflow, circles after the swipe. Branch
issue/397-select-v2(mockup, nothing merges until you say so). kayg's three asks and the lag report are all in.Why the first mockup looked fine and production did not. The mockup moved blocks with a translate spring on short lines. Production's slide (
picked.ts) writes a translate and a right margin on every line, every frame, and reads a box back for the tint, so the column narrows, long log lines rewrap, and the whole note is laid out 60 times a second. That is also the lag.What changed (kayg's decisions)
sheet-radius.ts, copied unchanged from the chrome branch), on the photo backdrop.card-rightcopies that (swipe left),card-leftmirrors it (swipe right). The padding is sized so a 24 pt circle keeps 8 pt clear of the text (tested at every block).morphstays as the alternative: card-left's padding, but each bullet and checkbox grows in place into its circle, so lists keep their width.slideis dropped (see numbers).What it costs in text width at 390 (today, no card: 354 for a paragraph, 335 for a list line). The card itself takes 20 (its two 10 pt insets), the circle's column 22 more.
Lag numbers. Chromium (software compositing) on the perf VM, 390 wide, 4x CPU throttle, a note of 300 log lines, 8 runs per look (about 200 frames each). The entering animation touches only opacity, scale and translate: no width, padding, margin or left per frame, no layout read per frame (one read, once, to place the stagger). The one slow frame in the card looks is the first, where the class flip restyles the card.
nowis production's mechanism replicated in the same page (not the app itself): every frame is a layout of the note, p50 83 ms. Drawing all 300 rows naively was slow (an earlier version toggled a class on every row: a frame of about 300 ms), so entering is now one attribute on the root and rows off the screen are skipped withcontent-visibility(the editor only draws the lines in view anyway).Tests (Chromium and WebKit, 390 wide, 72 passing): no line changes its breaks between rest and selection, text does not move sideways, frames at 0/40/80/120/200/320 ms of entering and leaving on a frozen clock (no circle over a bullet or a word at any frame, same breaks, same widths, only calm properties animated), no circle or tint while the finger moves, short and wrong-way swipes show nothing, stagger at most 15 ms, text widths as in the table, circles on the first line's centre and on the bullet's (morph: the same centre at rest and selected), and a finger on a circle reaches its button.
nowpasses its checks by failing the rules, which shows the detector works.The same on the iPhone simulator (iOS 27 Safari, real WebKit, 402 wide): every look's lines are identical between rest and selection except
now.Merge into chrome.html. Self-contained modules (all keyed by
?select=,?v=still works):apps/mockup/src/select/looks.ts(the looks,lookFromQuery, swipe direction),selection.svelte.ts(state, springs, gesture, stagger),Ring.svelte,looks.css(geometry, circles, tint, motion), pluspackages/ui/src/lib/sheet-radius.ts(identical to the chrome branch). The note's DOM contract is in the header ofselection.svelte.ts: a root withdata-look,data-mode,data-entering, rows.row[data-id]>.unit> (.hit><Ring/>,.blk).Select.svelte,select.css,main.ts,select.htmlare the demo page only. Tests:tests/select.spec.tsandtests/select-helpers.ts(the frozen-clock helpers) move along; pointopen()at the chrome note.Fix in PR (branch
issue/397-no-text-sel)Root cause. On an iPhone with the keyboard up, iOS (UIKit) paints the page's text selection itself: darker, ragged rectangles behind each line. It ignores
::selection(checked on the simulator: red and near-transparent styles change nothing), and CodeMirror'sdrawSelectiondoes not draw the main range on iOS, so the existing CSS (.cm-selectionBackground,::selectiontransparent) never touched it. A swiped block is still, underneath, a text selection across the block.Fix. While blocks are picked and the editor has the keyboard, the editor's selection is parked as a caret (
quietinpackages/editor/src/blocks/picked.ts). The pick lives on in thepickedstate and the app's block list, which every block action reads. The keyboard stays up. A tap, a key or an edit ends the pick as before. Desktop (Esc, VimV) already painted nothing; unchanged.Before (left) and after (right), real iOS 27 simulator, keyboard up, 3x crops (dark, light), plus desktop Esc (identical, as it was already right):
Simulator checks on the fix: swipe a second block (both tinted, DOM selection a caret), Done button (text bar, caret kept, focus kept), keyboard stays up throughout.
Closing during the 26 Oct handover cleanup: Block swipe on iPhone and tint-only selection landed in dev (PRs #403, #576, #585, #586).