diff --git a/src/lib/components/TaskItem.svelte b/src/lib/components/TaskItem.svelte index 54842b1..2f779a0 100644 --- a/src/lib/components/TaskItem.svelte +++ b/src/lib/components/TaskItem.svelte @@ -61,14 +61,10 @@ ui.openDetails(task.id, { x: r.left + 12, y: r.bottom }, item.day); } } - // Checkbox toggle. Holding Shift and clicking a second checkbox sets every - // task between the last-toggled one and this one (in the column's order) to - // this one's new state — the familiar select-all-between gesture. + // Checkbox toggle. function onCheck(e: MouseEvent) { haptics.tap(); - if (e.shiftKey && ui.lastToggled) store.toggleRange(ui.lastToggled, item); - else store.toggleDone(item); - ui.lastToggled = item.id; + store.toggleDone(item); // Move keyboard focus onto the checkbox itself. Buttons don't take focus on // click in Safari/Firefox, so after checking a task the caret is often still // in the add/edit field — and ⌘Z would hit that field's native text-undo diff --git a/src/lib/store/tasks.svelte.ts b/src/lib/store/tasks.svelte.ts index 7046882..bed1ac2 100644 --- a/src/lib/store/tasks.svelte.ts +++ b/src/lib/store/tasks.svelte.ts @@ -421,22 +421,6 @@ class TaskStore { } } - /** Force a cell's done state to an explicit value (handles recurring - occurrences the same way `toggleDone` does). A no-op if already there. */ - async setDone(dt: DayTask, value: boolean) { - const t = dt.task; - if (dt.virtual && dt.day) { - if (dt.done === value) return; - await this.setOcc(t.id, dt.day, { completed: value }); - } else { - if (t.done === value) return; - const patch: Partial = value && t.day === null - ? { done: value, day: todayKey(), order: this.nextOrder(todayKey()) } - : { done: value }; - await this.patch(t.id, patch); - } - } - /** Upsert (or clear) the occurrence override for one day of a series. Merges `changes` over the current state; when the result is the series default (not done, not skipped) the record is dropped entirely, keeping @@ -489,23 +473,6 @@ class TaskStore { }); } - /** Shift-click range toggle: set every cell between the `anchorId` cell and - `dt` — in the day's visual order, inclusive — to the state this click - applies (`dt`'s flipped done). Falls back to a plain toggle when the anchor - isn't among `dt`'s day (e.g. it was clicked in another column, or removed). - Runs as one undoable step. */ - async toggleRange(anchorId: string, dt: DayTask) { - const items = this.forDay(dt.day); - const from = items.findIndex((c) => c.id === anchorId); - const to = items.findIndex((c) => c.id === dt.id); - if (from < 0 || to < 0) return this.toggleDone(dt); - const value = !dt.done; - const [lo, hi] = from < to ? [from, to] : [to, from]; - return this.record(async () => { - for (let i = lo; i <= hi; i++) await this.setDone(items[i], value); - }); - } - async setColor(id: string, color: TaskColor) { await this.patch(id, { color }); } diff --git a/src/lib/store/ui.svelte.ts b/src/lib/store/ui.svelte.ts index 8fcc072..077fa95 100644 --- a/src/lib/store/ui.svelte.ts +++ b/src/lib/store/ui.svelte.ts @@ -10,9 +10,6 @@ class UiStore { anchorKey = $state(todayKey()); /** id of the cell currently in inline-edit mode (drag is disabled meanwhile). */ editingId = $state(null); - /** The last checkbox toggled, used as the anchor for a shift-click range - toggle (select-all-between). Cleared as needed by re-clicking. */ - lastToggled = $state(null); /** record id whose details panel is open, or null. */ detailsId = $state(null); /** viewport point the details card should float near (where the task was clicked). */