Skip to main content

useTaskSelection

Source: hooks/commits/useTaskSelection.ts The useTaskSelection hook manages multi-select state for bulk task operations on the Dashboard commits screen.

Selection State

The hook maintains a Set of selected task IDs internally, exposing it as a stable array for React rendering:

Available Actions


Multi-Select Mode

The Dashboard enters multi-select mode when the user long-presses a task card. Visual indicators (checkmarks, highlighted backgrounds) appear on selected items. The mode exits automatically when the selection is cleared or all selected tasks are deleted.

Bulk Delete Strategy

Bulk deletion iterates through the selected IDs sequentially (not in parallel) to avoid overwhelming the SyncLock. Each deletion goes through the full Triple-Write pipeline:
Sequential execution ensures each deletion’s rollback can complete before the next starts.