Skip to content

feat: multi-select mode#24

Merged
gfargo merged 1 commit into
mainfrom
feat/multi-select
May 5, 2026
Merged

feat: multi-select mode#24
gfargo merged 1 commit into
mainfrom
feat/multi-select

Conversation

@gfargo
Copy link
Copy Markdown
Owner

@gfargo gfargo commented May 5, 2026

Summary

  • Adds multiple prop to enable multi-select mode: Space toggles, Enter confirms
  • defaultSelectedKeys pre-populates checked state from a list of item keys
  • onConfirm(items) called on Enter with all currently checked items
  • onToggle(item, checked) called on each individual Space toggle
  • DefaultIndicatorComponent renders [x]/[ ] checkboxes when isChecked is provided
  • isChecked threaded through to custom indicatorComponent and itemComponent
  • Hotkeys and per-item hotkey hints disabled in multi-select mode to avoid Space ambiguity
  • useEnhancedSelectInput hook exposes checkedKeys: Set<string> for headless usage
  • 13 new tests; 68 total passing

Closes #12

Test plan

  • multi-select renders checkbox indicators instead of arrow cursor
  • multi-select space toggles checked state on/off
  • multi-select defaultSelectedKeys pre-checks items
  • multi-select enter calls onConfirm with checked items
  • multi-select enter with nothing checked calls onConfirm with empty array
  • multi-select onToggle fires with item and checked state
  • multi-select space only toggles enabled items
  • multi-select hotkeys do not fire in multi-select mode
  • multi-select hotkey hints not shown in render
  • multi-select isChecked passed to custom indicatorComponent
  • multi-select isChecked passed to custom itemComponent
  • DefaultIndicatorComponent renders checkboxes in multi-select mode

🤖 Generated with Claude Code

Space toggles the highlighted item; Enter confirms the full selection via
onConfirm. defaultSelectedKeys pre-populates checked state. onToggle fires
on each individual toggle. Hotkeys are disabled in multi-select mode to
avoid Space ambiguity. DefaultIndicatorComponent renders [x]/[ ] checkboxes
when isChecked is provided. isChecked is threaded through to both custom
indicatorComponent and itemComponent. 13 new tests cover all paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gfargo gfargo merged commit aca72bb into main May 5, 2026
1 of 3 checks passed
@gfargo gfargo deleted the feat/multi-select branch May 5, 2026 15:00
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.

feat: multi-select mode with Space to toggle and Enter to confirm

1 participant