Skip to content

feat(picker): support negative default_index, select_all/deselect_all, and prevent marking disabled options - #166

Open
miskatul-anwar wants to merge 2 commits into
aisk:masterfrom
miskatul-anwar:feat/negative-index-select-all-and-disabled-fix
Open

feat(picker): support negative default_index, select_all/deselect_all, and prevent marking disabled options#166
miskatul-anwar wants to merge 2 commits into
aisk:masterfrom
miskatul-anwar:feat/negative-index-select-all-and-disabled-fix

Conversation

@miskatul-anwar

Copy link
Copy Markdown

Summary

This PR introduces negative index support, batch selection methods, and disabled option safety to pick:

  1. Negative default_index Support (src/pick/__init__.py):

    • Added support for negative default indices (e.g. default_index=-1 to select the last option by default), adhering to standard Python indexing behavior.
  2. Disabled Option Guard in mark_index():

    • mark_index() now explicitly verifies that the target option is enabled before modifying selected_indexes. This prevents disabled options from being marked if mark_index() is invoked programmatically or by keypress.
  3. select_all() & deselect_all() Helper Methods:

    • Added select_all() and deselect_all() methods to Picker for multiselect mode. select_all() selects all enabled options while respecting disabled option status.
  4. Standalone cadule Import Fallback:

    • Added a graceful try...except ImportError fallback for cadule import so pick can run in standalone mode without build artifact errors.

Testing & Verification

Ran test suite:

============================== 11 passed in 0.04s ==============================

Gitmaxxing Agent added 2 commits August 11, 2026 23:53
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