From 46b5f9d30f149c3e80f483c91f563c0a6fc75b25 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Mon, 7 Sep 2026 17:40:29 +0900 Subject: feat(workspaces): bound the drag append area — 3 columns past the content edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dragging a tile far right grew the wide canvas endlessly (the target cell resolved from the pointer with no upper bound), making precise placement impossible. Add a pure `dragAppendLimit(placements, geometry, extra = 3)`: the drag target may aim at most 3 columns (wide) / rows (tall) past the current span-aware content edge. The bound is measured on the COMMITTED layout — never the live preview — so it can't ratchet mid-drag; it steps forward only when a drop commits new content. cellAt applies it on the growth axis (wide: col, tall: row); the fixed cross-axis clamps are unchanged. Exported via the unit index. Verification: svelte-check 0 errors/0 warnings; vitest 1693/1693 (4 new dragAppendLimit tests); biome clean on touched files; build ok. --- src/features/workspaces/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/features/workspaces/index.ts') diff --git a/src/features/workspaces/index.ts b/src/features/workspaces/index.ts index 243357e..a921617 100644 --- a/src/features/workspaces/index.ts +++ b/src/features/workspaces/index.ts @@ -24,6 +24,7 @@ export type { export { clampSpan, displacePlace, + dragAppendLimit, fillOrderKey, firstEmptySlot, geometryFor, -- cgit v1.2.3