Skip to content

KAN-209/multi-select-cards#168

Merged
fulsomenko merged 24 commits intodevelopfrom
KAN-209/multi-select-cards
Feb 18, 2026
Merged

KAN-209/multi-select-cards#168
fulsomenko merged 24 commits intodevelopfrom
KAN-209/multi-select-cards

Conversation

@fulsomenko
Copy link
Owner

Implements a visual selection mode for multi-card operations in the TUI.

What

Adds a visual selection mode where pressing v enters selection mode, and navigating with j/k automatically selects cards. This enables efficient bulk operations on multiple cards without toggling each card individually.

Why

The previous implementation required pressing v on each card individually to select it for bulk operations. This was tedious for users who wanted to select multiple consecutive cards. The new vim-style selection mode provides a more intuitive and efficient workflow that matches established vim conventions.

How

Core Implementation:

  • Added selection_mode_active: bool field to App struct to track mode state
  • Modified handle_card_selection_toggle() to toggle mode instead of individual cards
  • Added auto-select logic to handle_navigation_down() and handle_navigation_up() that automatically adds cards to selection when navigating in selection mode
  • Updated handle_escape_key() to clear both selection mode and all selections

New Features:

  • v - Toggle selection mode (enters mode and selects current card, or exits mode keeping selections)
  • j/k - Auto-select cards while navigating in selection mode
  • Ctrl+a - Select all cards in current view
  • Escape - Clear all selections and exit selection mode
  • P - Set priority on all selected cards via bulk priority dialog

UI Feedback:

  • Footer shows -- SELECT (N) -- when in selection mode
  • Footer shows (N selected) when cards are selected but not in selection mode

File Changes:

File Changes
app.rs Add selection_mode_active field, SetMultipleCardsPriority dialog mode, keybinding action wiring, Ctrl+a and P shortcuts
card_handlers.rs Implement selection mode toggle, add handle_clear_card_selection(), handle_select_all_cards_in_view(), handle_set_selected_cards_priority(), move_selected_cards()
navigation_handlers.rs Add auto-select in navigation handlers, update escape handler for selection mode
popup_handlers.rs Add handle_set_multiple_cards_priority_popup()
ui.rs Add selection mode indicator to footer, add render_set_multiple_cards_priority_popup()
keybindings/mod.rs Add ClearCardSelection, SelectAllCards, SetSelectedCardsPriority actions
keybindings/card_list.rs Add keybindings for Ctrl+a, Esc, P
keybindings/registry.rs Register bulk priority dialog provider
components/selection_dialog.rs Add BulkPriorityDialog component

Testing

  • cargo build - Compiles successfully
  • cargo test --package kanban-tui - All tests pass
  • cargo clippy --all-targets -- -D warnings - No warnings
  • Manual testing:
    • Enter selection mode with v, verify current card selected
    • Navigate with j/k, verify cards auto-select
    • Exit mode with v, verify selections persist
    • Clear with Escape, verify all cleared
    • Select all with Ctrl+a
    • Bulk priority with P

@fulsomenko fulsomenko self-assigned this Feb 17, 2026
Copy link
Owner Author

@fulsomenko fulsomenko left a comment

Choose a reason for hiding this comment

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

PR Review: KAN-209/multi-select-cards

Summary

This PR implements a vim-style visual selection mode for multi-card operations. The implementation is clean and follows existing patterns in the codebase.

👍 Strengths

  • Clean architecture: New handlers and components follow SOLID principles and existing patterns
  • Good UX: Footer indicator clearly shows selection state (-- SELECT (N) -- vs (N selected))
  • Comprehensive feature set: Selection mode toggle, select all, clear, bulk priority, and bulk move
  • Proper keybinding integration: Actions properly wired through the keybinding system

🔍 Observations & Suggestions

  1. Behavior change in handle_card_selection_toggle() (card_handlers.rs:37-48)

    • Previously toggled individual card selection, now toggles selection mode
    • This changes existing v key behavior - confirm this is intentional
  2. Selection mode not cleared after bulk priority (popup_handlers.rs:118-120)

    • After setting bulk priority, selected_cards.clear() is called but selection_mode_active remains true
    • Should probably also set self.selection_mode_active = false
  3. Escape key behavior change (navigation_handlers.rs:496-502)

    • Escape now clears selection first before navigating back
    • Users might expect escape to go back; hitting escape twice to navigate could feel odd
    • Consider: maybe only intercept escape if selection_mode_active is true, not when there are just passive selections?
  4. Magic number (popup_handlers.rs:84)

    • self.priority_selection.next(4) uses a magic number
    • Could extract to a constant like PRIORITY_COUNT for clarity
  5. Silent failure on bulk move (card_handlers.rs:571-577)

    • On error, logs with tracing::error! and returns
    • Consider adding user feedback (toast/notification) for failed operations
  6. Minor: Changeset format

    • The changeset lists individual commit messages rather than a user-facing summary
    • Consider condensing to a single feature description for the changelog

✅ Overall

The implementation is solid and well-structured. The suggestions above are mostly minor improvements. The core functionality looks correct and the test checklist in the PR description is comprehensive.

@fulsomenko fulsomenko merged commit 915364a into develop Feb 18, 2026
7 checks passed
@fulsomenko fulsomenko deleted the KAN-209/multi-select-cards branch February 18, 2026 00:10
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