Skip to content

feat(deck): bulk select and act on multiple cards - #101

Merged
jcserv merged 2 commits into
mainfrom
jarrodservilla/85-bulk-actions
Oct 26, 2026
Merged

jcserv merged 2 commits into
mainfrom
jarrodservilla/85-bulk-actions

Conversation

@jcserv

@jcserv jcserv commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Description

  • Adds a multi-select mode to the deck builder: a Select/Done toggle in the toolbar, plus Cmd/Ctrl-click to start selecting and Shift-click for a range (visual order), in both list and stack views.
  • A floating action bar acts on the selection: move to zone, set primary category, add to / remove from a category, and delete.
  • Deleting a ghost (secondary category) row strips only that membership, matching the single-row trash behaviour.
  • Each bulk action is one applyBulkCardAction server action that re-plans against DB rows and calls applyChanges once, so it is a single revision and revertible from history. The same pure planner (lib/deck/bulk-actions.ts) drives the optimistic client update.
  • Fixes sortable stack tiles ignoring clicks: isInteractiveTargetStack matched the tile itself (dnd-kit gives it role=button), so click-to-open detail never fired.

Fixes: #85

Checklist

  • Tests pass (pnpm test) and lint is clean
  • New behavior is covered by tests
  • No revalidate / dynamic / unstable_cache — used 'use cache' + cacheLife/cacheTag
  • <Link> imported from app/_components/link.tsx, not next/link
  • Suspense fallbacks reserve layout space (explicit heights)

Screenshots / notes

  • Escape closes an open bar menu first; a second Escape exits select mode. Drag-and-drop is disabled while selecting.
  • On mobile the bar sits above the bottom nav; Move/Category/Delete collapse to icons with aria-labels.
  • Shift-click range follows DOM order, so in the multi-column layout it can span columns.
  • Bulk edits within the existing 5-minute revision window merge with neighbouring revisions, same as other edits.
  • Verified end to end in a browser (list, stack, mobile widths) with DB state checked after each action.

Add a multi-select mode to the deck builder. A Select toggle in the
toolbar enters it, as do Cmd/Ctrl-click and Shift-click (range, in
visual order) on any row or stack tile. Selected cards get a floating
action bar with:

- Move to zone
- Category: set primary, add to, remove from
- Delete (ghost/secondary rows only strip that membership, matching
  the single-row trash behaviour)

Every bulk action is a single applyBulkCardAction server action that
re-plans against the DB rows and calls applyChanges once, so it lands
as one revision and can be reverted from history. The pure planner
(lib/deck/bulk-actions.ts) is shared by the optimistic client update
and the server.

Escape exits select mode; drag-and-drop is disabled while selecting.

Also fixes sortable stack tiles ignoring clicks: isInteractiveTargetStack
matched the tile itself (dnd-kit gives it role=button), so click-to-open
detail never fired.

Claude-Session: https://claude.ai/code/session_01A3XUj4hFZwjBu4eum6UiuB
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 74329749-9d9b-4c0e-8038-19db11d290a8
Commits

Reviewing files that changed from the base of the PR and between bd8210c and a7cedb7.

Files selected for processing: 13
  • app/_actions/deck/__tests__/bulk-actions.test.ts
  • app/_actions/deck/bulk-actions.ts
  • app/_components/builder/bulk-action-bar.tsx
  • app/_components/builder/bulk-selection.test.tsx
  • app/_components/builder/bulk-selection.tsx
  • app/_components/builder/card-row-sortable.tsx
  • app/_components/builder/card-row.tsx
  • app/_components/builder/card-stack-sortable.tsx
  • app/_components/builder/card-stack.tsx
  • app/_components/builder/deck-builder-owner.tsx
  • app/_components/builder/decklist-toolbar.tsx
  • lib/deck/__tests__/bulk-actions.test.ts
  • lib/deck/bulk-actions.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jcserv jcserv self-assigned this Oct 26, 2026
Narrow the bulk planner's output to move/remove changes so toZoneAction
no longer has an unreachable fallback, and cover the remaining branches:
deleting primary-row selections removes the DeckCards, and addCategory
names are normalized server-side. Restores 100% line coverage.

Claude-Session: https://claude.ai/code/session_01A3XUj4hFZwjBu4eum6UiuB
@jcserv
jcserv merged commit a1a1756 into main Oct 26, 2026
5 checks passed
@jcserv
jcserv deleted the jarrodservilla/85-bulk-actions branch October 26, 2026 06:12
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.

[Feature]: Bulk actions

1 participant