diff options
| author | Adam Malczewski <[email protected]> | 2026-09-07 17:45:57 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-09-07 17:45:57 +0900 |
| commit | 9ede1f079a545cbc215d91ba09b4d1bc2a0b99ee (patch) | |
| tree | 5df22c5e273ddebba325b959792eb64aec1daa32 /backend-handoff.md | |
| parent | 46b5f9d30f149c3e80f483c91f563c0a6fc75b25 (diff) | |
| download | dispatch-web-9ede1f079a545cbc215d91ba09b4d1bc2a0b99ee.tar.gz dispatch-web-9ede1f079a545cbc215d91ba09b4d1bc2a0b99ee.zip | |
feat(workspaces): reserve the append canvas for the whole drag — no scrollbar change mid-drag
Previously the grid kept `width: max-content` during a drag, so the canvas
grew/shrunk as the preview placed the tile at each hovered cell — the
scrollbar resized mid-drag, making placement harder. Now the moment a drag
starts the grid's growth axis becomes a FIXED reservation: the append limit
(committed content edge + 3, span-aware) computed at drag start, so the 3
spaces "pop in" immediately, the scroller size is constant for the entire
gesture, and the unused reservation disappears when the drag ends (the
canvas returns to max-content / auto). The dragged tile's span room is
included so its body always stays inside the reserved canvas.
Also: the scroll-measure effect now tracks `dragging`, so canPan and the
scroll indicator re-measure when the reservation appears and disappears.
Test: the drag test now asserts the grid's style is a fixed px width while
dragging (never max-content) and back to max-content after the drop. (This
caught a missing `px` unit that would have silently voided the reservation.)
Update the handoff bullet to describe the reservation.
Verification: svelte-check 0 errors/0 warnings; vitest 1693/1693; biome
clean on touched files; build ok.
Diffstat (limited to 'backend-handoff.md')
| -rw-r--r-- | backend-handoff.md | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/backend-handoff.md b/backend-handoff.md index a90a351..e37c7d0 100644 --- a/backend-handoff.md +++ b/backend-handoff.md @@ -286,10 +286,13 @@ changes, NO contract changes — the wire types and every endpoint consumed are elements to the GRID CONTAINER, which `setPointerCapture`s the pointer and never gets re-parented/`pointer-events: none`/unmounted — so move/up stream to it over empty cells and off the canvas, and capture can never be lost to a DOM move again. -- **Drag append bound** (`dragAppendLimit` in `logic/tile-layout.ts` + `cellAt` in - `HomeTileGrid.svelte`): the drag target is clamped to at most 3 columns (wide) / rows (tall) - past the current content edge (span-aware, measured on the COMMITTED layout so it can't ratchet - mid-drag) — the canvas no longer grows endlessly when dragging far right / down. +- **Drag append bound + reserved canvas** (`dragAppendLimit` in `logic/tile-layout.ts`; + `cellAt` + `gridStyle` in `HomeTileGrid.svelte`): the drag target is clamped to at most 3 + columns (wide) / rows (tall) past the current content edge (span-aware, measured on the + COMMITTED layout so it can't ratchet mid-drag). While dragging, the grid's box is a FIXED + reservation — the 3 spaces (plus the dragged tile's span room) pop in at drag start and stay + constant, so the scroller never changes size mid-drag; the unused spaces vanish when the drag + ends. - Verification: `typecheck` 0 errors/0 warnings, vitest 1689/1689 (incl. updated `tile-layout.test.ts` order assertions — coordinates unchanged), biome clean on touched files, `build` succeeds. Browser-only (pointer capture) — needs a human at the page to confirm the |
