Skip to content

Add sidebar project multi-select with group drag and context menu - #226

Merged
MaplumeX merged 1 commit into
mainfrom
feat/sidebar-project-multi-select
Oct 13, 2026
Merged

MaplumeX merged 1 commit into
mainfrom
feat/sidebar-project-multi-select

Conversation

@MaplumeX

Copy link
Copy Markdown
Owner

Summary

Aligns the sidebar with Things 3 Mac: project rows can now be multi-selected, dragged as a group, and acted on as a group via the context menu. Area rows are not part of the selection.

Changes

New selection store (@taskora/api)

  • sidebarSelection.store.ts: ids (in selection order), anchorId, and order (display order of sidebar project rows, registered by the sidebar).
    • toggle(id, currentId) — ⌘/Ctrl+click; on the first multi-select, the currently open project is included.
    • extendTo(id, currentId) — ⇧+click; selects the contiguous range from the anchor (defaults to the current project).
    • sidebarSelectionGroup() — returns the group in display order, or null when fewer than 2 rows are selected.
    • sidebarContextMenuTargets(id) — right-clicking inside the selection targets the whole group; otherwise the selection is cleared and only that row is targeted.
  • Window-local only; independent from keyboard Selection and touch Multi-Select Mode.

Sidebar behavior (SidebarProjectSection, ProjectItem)

  • Modifier-clicks only change the selection, never navigate; ⇧+click also suppresses native text selection. Plain clicks clear the selection and navigate.
  • Highlight follows the selection while it is active, otherwise it follows the current route. The selection is cleared on route change.
  • Dragging a selected project drags the whole group: the other members collapse after the drag-start commit (via useCollapseAfterDragStart), the drag overlay shows a DragCountBadge, and on drop the group replaces the dragged project in display order (expandProjectGroup).
  • Ownership changes are written per project; the order is written once all of them succeed. Any failure rolls back and reports a single toast. Cancelling restores the members. The selection is preserved.
  • Dragging a project outside the selection drags only that project.

Group context menu (ProjectContextMenu)

  • Right-clicking a selected project opens a group menu that shows the item count and takes a snapshot of the targets when opened.
  • Group actions: complete / uncomplete (uncomplete when all are completed, otherwise complete only the not-yet-completed ones; projects with remaining tasks are asked about in a single merged dialog), scheduled date, due date, tags (tri-state, applied per project on top of existing tags), move (without marking the current location), and delete (clears the selection afterwards).
  • Repeat, skip, duplicate, and open-in-new-window remain single-project only.

Other

  • sidebarProjectLayout: removeProjects and expandProjectGroup helpers for group drag.
  • useProjectCompletion: new toggleGroup plus a group-aware remaining-tasks dialog.
  • ProjectMovePicker accepts a partial current so group moves don't highlight a location.
  • New i18n strings for the group completion dialog (en/zh) and the new store exported from the API package.
  • CONTEXT.md documents the new Sidebar Selection domain concept; spec at .scratch/sidebar-multi-select/spec.md.

Tests

  • sidebarSelection.store.test.ts: toggle/extend/group/context-menu targeting.
  • SidebarProjectSection.test.tsx: group drag (collapse, ordered drop, per-project ownership writes, reorder after all writes), cancel restore, and dragging a non-selected project.
  • sidebarProjectLayout.test.ts: removeProjects / expandProjectGroup.
  • ProjectContextMenu.test.tsx: group menu item count, hidden single-project actions, group delete, grouped completion dialog, and group move.

Out of scope

  • Multi-select for area rows.
  • Keyboard (⌫ / Delete) deletion of the group.
  • Dropping the group on other sidebar targets (Today, Trash, etc.).

@MaplumeX
MaplumeX merged commit 2c77091 into main Oct 13, 2026
4 checks passed
@MaplumeX
MaplumeX deleted the feat/sidebar-project-multi-select branch October 13, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant