Skip to content

feat: bulk move cards and decks via multi-select closes: #162#186

Open
DevamPatel22 wants to merge 2 commits into
mainfrom
feat/bulk-move-multi-select-162
Open

feat: bulk move cards and decks via multi-select closes: #162#186
DevamPatel22 wants to merge 2 commits into
mainfrom
feat/bulk-move-multi-select-162

Conversation

@DevamPatel22

Copy link
Copy Markdown
Collaborator

Implements multi-select bulk operations in deck detail with long-press selection mode, checkboxes, and a bottom action bar (Move, Delete, Select All). Adds repository bulk APIs for cards/decks and corresponding tests for move/delete behavior.

@DevamPatel22 DevamPatel22 requested a review from Pairadux as a code owner April 16, 2026 19:12
final deckRepo = ref.read(deckRepositoryProvider);
final deck = await deckRepo.getById(childDeckId);
if (deck == null) return;
for (final deckId in childDeckIds) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each deckRepo.delete() runs its own getDescendantIds() query + a separate transaction. With 10 selected decks, that is 10 transactions and 10 descendant lookups. CardRepository already has a bulkDelete that does it in one transaction — DeckRepository needs the same thing.

);

if (_isDeckSelection) {
deckTile = Stack(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overlays a checkbox at a fixed offset on top of the card. On narrow screens or long deck names, it will overlap content. Card items use an inline Checkbox inside the Row — deck items should do the same for consistency.

),
const SizedBox(width: Spacing.sm),
Icon(
_isCardSelection ? Icons.check : Icons.chevron_right,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In selection mode, cards show a Checkbox on the left AND a check icon on the right. That is redundant — one indicator is enough.

@Pairadux

Pairadux commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Good work overall — three things to fix before merge:

  1. Bulk deck delete is slowdeleteChildDecks loops over deckRepo.delete(), which runs a separate transaction + descendant query each time. Add a bulkDelete to DeckRepository (same pattern as CardRepository.bulkDelete) and call that instead.

  2. Deck checkbox overlaps content — the Stack/Positioned checkbox floats on top of the deck card at a fixed offset. On small screens or long names it will cover text. Use an inline Checkbox in the row like the card items do.

  3. Cards have two selection indicators — in selection mode, cards show a Checkbox on the left and a check icon on the right. Pick one.

I added comments to the lines themselves above ^

@DevamPatel22 DevamPatel22 self-assigned this Apr 19, 2026
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.

2 participants