Skip to content

fix(prompts): harden separator support in group-multiselect and multi-select#547

Open
aqeelat wants to merge 2 commits into
bombshell-dev:mainfrom
aqeelat:feat/group-multiselect-separator
Open

fix(prompts): harden separator support in group-multiselect and multi-select#547
aqeelat wants to merge 2 commits into
bombshell-dev:mainfrom
aqeelat:feat/group-multiselect-separator

Conversation

@aqeelat
Copy link
Copy Markdown

@aqeelat aqeelat commented May 30, 2026

Summary

Follow-up to #543 (separator option support). Hardens separator handling across group-multiselect and multi-select prompts.

Changes

  • Guard toggleValue against separators in GroupMultiSelectPrompt and MultiSelectPrompt
  • Fix initial cursor placement to skip separators via #findNextSelectable
  • Prevent separators from receiving group metadata during option flattening
  • Add hasSelectable guard to prevent cursor landing on unselectable items
  • Widen options type to SeparatorOption union, removing as any cast
  • Deduplicate isSeparatorOption by using shared isSeparator from @clack/core
  • Adjust limitOptions to account for separators in computedMaxItems
  • Add tests for GroupMultiSelectPrompt separator behavior

aqeelat added 2 commits May 29, 2026 22:06
…ultiselect

Support { type: 'separator', label?: string } entries in option arrays
for select, multiselect, and groupMultiselect prompts. Separators are
rendered as dim text but skipped by the cursor and excluded from values.

Core changes:
- Add isSeparator() utility and SeparatorOption type to cursor.ts
- Update findCursor() to skip separators alongside disabled options
- Update SelectPrompt and MultiSelectPrompt to skip separators
  during cursor initialization and navigation, and exclude them
  from toggleAll/toggleInvert
- Refactor GroupMultiSelectPrompt cursor navigation into #moveCursor
  that skips separators and non-selectable groups

Prompts changes:
- Update Option type to be a union with SeparatorOption
- Add separator rendering in select, multiselect, and groupMultiselect
- Separators render as dim text without selection UI

Resolves bombshell-dev#2, bombshell-dev#8 from clack-fixes.md.
…-select

- Guard toggleValue against separators in GroupMultiSelectPrompt and MultiSelectPrompt
- Fix initial cursor placement to skip separators via #findNextSelectable
- Prevent separators from receiving group metadata during option flattening
- Add hasSelectable guard to prevent cursor landing on unselectable items
- Widen options type to include SeparatorOption union, removing as any cast
- Deduplicate isSeparatorOption by using shared isSeparator from @clack/core
- Adjust limitOptions to account for separators in computedMaxItems
- Add tests for GroupMultiSelectPrompt separator behavior
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 30, 2026

⚠️ No Changeset found

Latest commit: b804872

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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