Mockup: folder-card drop (quiet.md) #1030
Open
opened 2026-11-09 11:39:37 +00:00 by kayg
·
8 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#1030
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 11-09: "WOW we need this interaction". Folder cards that take dragged notes and files. Branch
feat/folder-drop, preview slotfolder-drop. Evidence in the comment below.Folder-card drop: evidence
Branch
feat/folder-drop(head7b8321cb8), preview slot https://preview.calternal.cloud/folder-drop/Side-by-side with the reference: the reference clip is a third-party app and stays LOCAL (privacy rule), so it is not attached. The local side-by-side is
/tmp/fd-bench/media/LOCAL-side-by-side-notes-vs-reference.mp4(its crop starts early and is not aligned to the drag, so it is rough). Ours only, Chromium recording at 1440x900: Notes, 2x, Files, 3x.Stills:

Frame times, REAL Safari on the Mac VM (macos-01), 1440x900 and 800x900, 7 drags each
Method: safaridriver, real mouse actions; rAF deltas cut by phase (drag = pull to the card, hover = 760 ms rest incl. the 600 ms spring-open, drop = release + 480 ms, toast = the move toast). The idle baseline is the same length with no input. The VM runs at 60 Hz (17 ms frames), so the 8.3 ms gate cannot be read here: the column that matters is "max / frames over 25 ms" and the main-thread work per frame.
800 px: Files all clean (max 40 in drag, 1 frame); Notes drop p95 29 / max 54, toast p95 29 / max 43.
Main-thread work per frame (p95): drag 4 ms, hover 3 ms, drop 4 ms (max 6), Files 2-3 ms.
Latency: pointer past threshold to the lifted page, p50 ~27 ms; release to first slide frame ~10 ms (Files ~6 ms). Spring-open fired at 600 ms in 14/14 runs.
Honest result: NOT fully within the gate. Files, drag, hover and open are clean. The Notes DROP still has ~10 frames over 25 ms per 7 drops, and the move toast opening costs more (45 ms). Main-thread work in those frames is only 4-6 ms, so the long frames are paint/composite (the list closing a gap and the toast glass), not script. Fixed along the way: a page-wide cursor rule (60 ms first frame), container-unit transforms, gliding every row (dozens of layers), toast in the release frame. Open: the Notes list gap closing and the toast's glass layer; next try would be moving the toast later/out of the Notes drop or
content-visibilityon rows. 120 Hz was not measurable on this VM.Specs (Playwright,
tests/folder-drop.spec.ts, 390/800/1440)Update 2 (head
472a998f9, slot redeployed at the same head)Cause found by switching parts off in real Safari (Mac VM, 7-9 drags per variant):
Frame table, real Safari, 60 Hz VM, 1440x900, 7 drags (ms; ">25" = frames over 25 ms):
Notes at 800: drop p95 19 / max 49 (4 long), toast p95 31 / max 41 (9 long). Files at 800: 1 long frame in total (27 ms).
Notes, same session after the first load ("warm"): 7 drops, 5 frames over 25 ms in total, max 40 (sidebar hidden: 4, max 33).
Main-thread script per frame (p95): Files 2 ms; Notes drag 4, drop 4 (max 6), toast 4 (one 22-23 ms frame at the toast).
Result against the gate: still NOT met. Files is clean (0-1 long frames, max 40/27 once during the pull-out). The Notes release frame is fixed, but the Notes move and toast still have 4-9 long frames per 7 drops cold (max 56), 5 warm. Script is 4-6 ms, so the rest is layout/paint of the list closing up and the toast spring; main-thread+paint+composite per frame could not be read directly (safaridriver gives no timeline; Web Inspector was not drivable here), only rAF deltas and script time. Next options, each needs your call: (a) a transform-only spring for ToastCapsule (shared component), (b) for the folder drop, no toast: the card count and Undo-by-Cmd-Z only, (c)
content-visibility: autorows in the Notes list view.Specs and checks (head
472a998f9): Chromium 21 passed / 6 skipped / 0 failed; WebKit (Linux) 19 passed / 8 skipped / 0 failed. svelte-check:apps/mockuphas no svelte-check config (running web's svelte-check over it reports 631 errors repo-wide, mostly unresolved@calternal/uimodules); filtered to the files I added or touched there is no error from my code (the two Snippet-type errors at NoteList.svelte 199 and FilesPhone.svelte 88 sit on lines I did not write).Preview: https://preview.calternal.cloud/folder-drop/ — Notes:
#/note/spiti?list=folders&view=list, Files:#/files/documents/taxes/2026?view=grid.Update 3 (head
161b48fbb, slot redeployed at it)Changes
packages/ui/.../toast/ToastCapsule.svelte: the glass box is always its FINAL size and is only scaled (transform: scale(sx, sy), from the same springs as before); no width/height on a backdrop-blurred box any more. The dot is the capsule scaled to a 12 px height (round corners), the transform is removed at rest (nothing stays promoted), the words' clip follows the same springs as before. Resizes (the count rolling, "moved" -> "Undone") are a scale from the old size to the new one.content-visibility: autoon the Notes list rows: the list VIEW (NotesListView) ALREADY had it (li,auto 68px), so the move cost was not that; I added it to the ordinary list (NoteList,auto 62px, not the gallery cards). New spec: scroll position holds (no jump, no drift scrolling 0 <-> 600) and keyboard focus stays on the row Tab reaches.Port note for apps/web:
apps/webshows toasts with the same shared package (@calternal/ui/primitives/toast: App.svelte, BottomBar, bar/Toast.svelte, lib/actions.ts), so it gets the new ToastCapsule when it takes the package. Anything in apps/web that draws its own capsule glass by width/height needs the same change; the grep shows onlybar/Toast.svelte(the in-bar toast, #145), which should be checked separately.Other toast users, before/after at rest (2x, Chromium, light): the move toast, the "Undone" state after Undo, and the multi-item move ("3 notes moved to Travel") are BYTE-IDENTICAL PNGs before (
472a998f9) and after (161b48fbb). Frame times of the move and the Undo/"Undone" resize are in the table (phasestoastandundo). Share/copy toasts use the same capsule and the same two code paths (open, resize); I did not drive them separately.Frame table, real Safari, 60 Hz VM, 7 drags per row (ms; "> 25" = frames over 25 ms). Cold = first page load of the session (thumbnail snapshots are still being generated, an app-wide cost); warm = a reload in the same session.
Files (cold, then 800 cold): idle p95 20 | drag p95 19 max 49, 1 long | hover p95 19, 0 | drop p95 18 max 29, 1 long | toast p95 18 max 20, 0 | undo p95 19 max 24, 0. At 800: drag 1 long (32), drop 0, toast 0, undo 0 (max 23).
Before this change the toast phase had 5-9 long frames per 7 drops (p95 24-33, max 52); now 0-2 (p95 18-19) apart from one 59 ms frame in the cold 1440 run. The toast spring is fixed.
Not at 0 yet. The Notes DROP still has long frames in cold and some warm runs (0-11 per 7 drops, max 73 at ~180-250 ms into the drop, i.e. when the list closes up and the thumbnails of the moved note are laid out). Also seen: isolated 200-320 ms stalls during idle/hover (VM noise; the idle baseline in the same runs has 1-3 frames of 26-35 ms). The "undo" resize path still shows up to 8 frames of 26-41 ms (the note returning to the list). Not fixed: that needs the list/thumbnail work, not the toast; the next step would be to measure it with the sidebar hidden and thumbnails off (an earlier A/B suggested the cold cost is thumbnail snapshots, which is an app-wide cost, not this feature's).
Specs: Chromium 22 passed / 6 skipped / 0 failed; WebKit (Linux) 20 passed / 8 skipped / 0 failed (390/800/1440, includes the new content-visibility spec).
Design note: a simpler drop path (round 4 stop-and-think)
A/B result (real Safari, 1440, 7 drags, cold = first invocation, warm = second; Notes drop phase):
want()is a no-op)The two frames at ~180 and ~230 ms after the drop and the toast's mount frame at ~510 ms all vanish when EITHER the sidebar is hidden OR thumbnails are off. A move does not change a note's snapshot key (edit time, theme, block count), so it is not a re-capture of the moved note. What is left is the snapshot QUEUE (
lib/thumbs.svelte.ts): it captures one note per idle slice (40-90 ms each: mount the page top, draw it into an SVG picture, rasterise), and it does not know a drag is on. Hiding the sidebar shrinks the queue (about 18 fewer wanted notes), switching thumbnails off empties it: that is the same finding. The slices simply land in the drop's frames (they are idle slices, so they run exactly when the page looks idle: during the slide). It also explains why "cold" is worse (the queue is full) and why every earlier fix moved the long frames around without removing them.Simpler path (one rule, no more timing patches): nothing heavy runs while a drag is on or for ~1.1 s after it.
dnd.typeis set from lift to release, and the release stampsdragWatch.until = now + 1100 ms. The snapshot queue checks both and re-arms itself 400 ms later (the same way it already waits one second after a key press). Captures already running finish; none start. Nothing else about the drop changes: the move is ONE store write at +150 ms, the page slides on the compositor, the cards glide by FLIP (transform only), the toast comes at +480 ms, Undo reverses the same store write.Expected frame cost per phase after (1) (main-thread work + layout/paint, 60 Hz VM): pull-out/drag: script 2-4 ms, nothing else; hover/open: 1-3 ms; release: <= 8 ms (slide start, pocket dip, sheet kept); move + flush (+150 ms): script ~6 ms plus one list/sidebar layout, 12-16 ms in one frame; toast mount (+480 ms): <= 12 ms; no 40-90 ms capture slice between lift and +1100 ms. Target: 0 frames > 25 ms warm, at most 1 cold.
Update 4 (head
6fb0c71b5, slot redeployed at it): the drag-aware thumbnail queueImplemented the note above in one pass, and only that:
lib/thumbs.svelte.tsstarts no snapshot whilednd.typeis set or within 1100 ms of a release (dragWatchinpress/drag.svelte.ts, which the queue reads; same pattern as its existing "one second after a key" wait). Nothing else in the drop path changed.Result (real Safari, 60 Hz VM, 7 drags per row; ms; ">25" = frames over 25 ms)
Files, 1440, fresh session: idle p95 21 | drag p95 18 max 38 (1 long) | hover p95 19 (0) | drop p95 18 max 25 (0) | toast p95 18 max 19 (0) | undo p95 20 max 27 (1).
Why I stop here (three rounds that each found a new cause): the queue guard removed what the A/B named (capture slices landing in the drop's frames; the toast mount frame). The cold pair at +180/+235 ms survives a 15 s settle, so it is not the queue; it repeats on every drop of a fresh session and vanishes on the next page load in the same session, which points at a once-per-page cost the drop triggers (the sidebar and list recompute of every list on the store write, with a cold decode/style cache), not something the drop path adds. The next step is a profile of the move's recompute (a Safari Web Inspector timeline, which safaridriver cannot give me here), or making the Notes store write cheaper (the sidebar derives every collection's and folder's
listNotesandarrangeon anyplacedchange). That is app-wide, not part of this feature, so it needs your decision.Specs (head
6fb0c71b5): Chromium 22 passed / 6 skipped / 0 failed; WebKit (Linux) 20 passed / 8 skipped / 0 failed. Preview: https://preview.calternal.cloud/folder-drop/ (Notes#/note/spiti?list=folders&view=list, Files#/files/documents/taxes/2026?view=grid).Update 5 (head
199db43a1, slot redeployed at it): incremental folder store, measured, and what it showedChange (one focused commit):
lib/folders.svelte.tskeeps an INDEX instead of asking every note where it lives: a member set per folder (direct) and a set of live paths (live), both updated bymoveTo(it touches only the folder a note leaves and the one it enters).listNotes('folder:x')reads only the sets of x's own branch (folderIds), the folder tree rebuilds only when a folder gains its first note or loses its last (or a note is made or deleted), and the save (JSON.stringify(placed)+localStorage, a synchronous disk write in Safari) waits for idle orpagehide. Collections never read this state, so a move already recomputed only the folder-dependent derivations; this makes THOSE O(branch) instead of O(all folders x all notes). Sidebar counts still come from the lists (visibility filters differ from raw set size), so they are not a separate delta.Recompute cost per move,
performance.measure("note-move")around the write and the update it causes (ms per move):8d753bc2d)199db43a1)(Safari's timer is 1 ms resolution, so these are coarse; Chromium on the shared build host is noisy.) No measurable gain: the recompute was never the cost. The Chromium CPU profile of a move (top self time, average of 3 moves, ms):
offsetWidth22,remove()14,getBoundingClientRect8,offsetHeight5,querySelector4; the Svelte reaction code (get,reconcile,update_reaction,destroy_*) is 2-3 ms each, ~15 ms together. The big items are FORCED SYNCHRONOUS LAYOUTS: the toast'sfit()readsinner.offsetWidth/offsetHeightas it mounts (and on every resize),reflow()readsgetBoundingClientRectof the cards before and after the move, and the ghost'sremove()lands after a layout is dirty. That matches the Safari frames at ~+180/+235 ms (the move's flush, then the reflow's measure) and the toast mount.Notes drop table, real Safari, 7 drags (">25" = frames over 25 ms), fresh page then reload in the same session (this run was noisy: the 1440 drag phase itself shows 9-11 long frames, which the earlier runs did not):
Same shape as before the index (the +180/+235 ms frames at 30-40 and 50-74 ms on the fresh runs; warm 800 near the noise floor). The index did not change them.
Where this leaves the drop (no more patches from me, per the three-round rule): the Notes drop's long frames are layout, not store work. The two causes the profile names are in feature code I own and are the next, small, separate change if you want it: (1)
reflow()should not readgetBoundingClientRectafter the DOM change in the same frame it changed in (measure all cards BEFORE, apply, then measure AFTER inside one rAF, or skip the measure and animate by known card geometry); (2) the sharedToastCapsule.fit()readsoffsetWidth/offsetHeighton mount and on every ResizeObserver tick (read them once per frame, from the ResizeObserver entry'sborderBoxSizeinstead of forced layout reads). I did not change either. The index commit can be kept (it makes folder lists O(branch), which matters at 2,000 notes) or dropped without changing the table; say which.apps/web: port item (read only, nothing changed). apps/web has NO folders (
lists.ts: "Tags organise; there are no folders in the UI"), so the folder index has nothing to port, but its store has the same shape of problem for the lists it does have:store.notesis a getter that returns[...map.values()](a NEW array of every note on every read) over aSvelteMap, andapplyEntrydoesnotesState.rev++on every journal entry plus amap.set/map.delete, so a single edit re-runs everylistNotesreader (journal, pinned, each tag) in full, and every reader copies the whole map first. Port: keep the notes array memoized (rebuilt only on add/remove, not on an edit), and keep per-list member sets (tag -> ids, pinned ids, journal ids) updated byapplyEntryso a write wakes only the lists the note is in or was in (the same pattern aslib/folders.svelte.tshere). Also the in-bar toast andToastCapsulein the shared package: the sameoffsetWidthreads apply.Specs (head
199db43a1): Chromium 22 passed / 6 skipped / 0 failed; WebKit (Linux) 20 passed / 8 skipped / 0 failed. Preview: https://preview.calternal.cloud/folder-drop/ (Notes#/note/spiti?list=folders&view=list, Files#/files/documents/taxes/2026?view=grid).Update 6 (head
3be6a6830, slot redeployed at it): the two layout fixes, measuredChanges
folders/reflow.ts: one batched read of every rect BEFORE the change (FIRST), the change, then in the next frame ONE batched read of every rect (LAST), then only writes (animate). The old loop read a rect, started an animation and read the next, so the page could be laid out again after each animation started.ToastCapsule.svelte: the size comes from the ResizeObserver entry (borderBoxSize, rounded asoffsetWidthwas); nooffsetWidth/offsetHeightreads. The first observer report arrives before the first paint, so the dot is there in the first frame.Other toasts stay pixel-identical: 2x crops of the move toast, the "Undone" state after Undo and the multi-item move toast, captured with
prefers-reduced-motion(the glass snaps to its rest size, so the pixels do not depend on machine load) at199db43a1(before) and3be6a6830(after): all three are BYTE-IDENTICAL PNGs. (A first attempt with the spring running showed a 1 % scale difference because the shared build host was at load 25 and the spring had not settled in 1.3 s; that is the harness, not the component.) Share/copy toasts go through the same two paths (first report, resize).Chromium CPU profile of one drop, self time per move (ms), top forced-layout entries. The build host was at load ~25 for the "after" run, so absolute numbers are inflated; read the CALLERS, not the totals.
199db43a1)3be6a6830)offsetWidthoffsetHeightsvelte-sonner(its own effect measures a toast's height when it mounts: third-party, not our code)getBoundingClientRectreflow.ts: the ONE batched read (a layout is needed once in that frame anyway); sonner 1.3removeremove_effect_dom), not a layout readSo our code no longer has a forced layout in the drop except the single batched FLIP read; the remaining forced layout is svelte-sonner's own measure of the toast. Removing that means not mounting the toast in the drop's frames, or replacing sonner's height measure, which is not a small change.
Notes drop, real Safari, 7 drags (">25" = frames over 25 ms); fresh page, then reload in the same session:
(The warm 1440 run also had a 116 ms hitch during the pull-out, i.e. VM noise: its idle baseline is the same run.) No change from before: the fresh runs still show the pair at ~+178 ms and ~+230 ms (30-34 ms and 47-69 ms) on every drop. The profile says the forced layouts were real, the fixes removed ours, and the frames did not move, so the pair is not our forced layouts either. What is left at those two moments is Svelte destroying and re-creating DOM (
remove_effect_dom, the keyed list and the card pages) plus the layout and paint of the list closing up, which only a Safari Web Inspector timeline can split (safaridriver cannot give it). I am stopping here; this is the fifth cause that was not the cause.Web port issue opened: #1034 "web: store.notes full recompute on every journal entry" (apps/web findings and the proposed fix; links #1030). apps/web unchanged.
Specs (head
3be6a6830): Chromium 22 passed / 6 skipped / 0 failed; WebKit (Linux) 20 passed / 8 skipped / 0 failed.Update 7 and PARKED (last time-boxed attempt, reverted)
Tried (
1609a89fa): keep the moved rows' DOM alive through the drop: at the drop the rows are only HIDDEN (visibility), everything below slides up by transform (one batched read, then writes), the card's count ticks from a local pending delta, and 400 ms later, at idle, the real store write lands, the transforms are removed in the same task and the toast follows (folders/close-up.ts,FolderGrid.drop). Chromium specs stayed green (22 passed).Result, real Safari, 7 drags (">25" = frames over 25 ms); fresh page, then reload in the same session. NOT BETTER, reverted (see the head below):
(Before the attempt, at
3be6a6830: drop >25 = 11/10 at 1440, 10/1 at 800; toast 0-1.) The pair of frames at ~+180/+230 ms is gone, but the SAME work now shows up as a 35-47 ms frame at ~+580-650 ms (the deferred write, the destroy/create, the toast mount) and some 100-200 ms ones (the Mac VM was also shared with another lane's runs, so treat the maxima as noisy). The toast phase went from 0-1 long frames to 2-11. Deferring does not make the work cheaper, and the metric counts it wherever it lands, so I reverted. The branch head is the revert (tree identical to3be6a6830).Parked: remaining cost and next ideas
Where it stands (head, tree =
3be6a6830): Files is clean; the Notes drop has 10-13 long frames per 7 drops at 1440 (fresh and warm) and 1-10 at 800; the toast is clean (0-1); the thumbnail queue, store recompute, toast spring, reflow reads and the toast's offsetWidth are all fixed or ruled out.Remaining cost: a pair of frames at about +178 ms (30-34 ms) and +230 ms (47-69 ms) after the release on a fresh page. It is not script (4-6 ms), not the store (2-3 ms), not our forced layouts (removed), not the queue (guarded). What is left is Svelte destroying the moved row and re-creating the card's pages and the sidebar rows, plus one layout and paint of the list closing up, with svelte-sonner's own
offsetHeightmeasure on the toast mount (30 ms self time in a loaded Chromium profile).Next ideas, in order:
~/mcpgui.py, see the Mac VM GUI note) or record withxctrace/ Instruments' Safari template, then read where the two frames go.contain: layout paintand a fixed row height (a measuredcontain-intrinsic-sizeis already there), and move the moved row out withposition: absolutefor one frame instead ofremove.apps/web/.../bar/Toast.sveltestyle) for the move toast, which has no height measure.