Skip to content

feat: make max options displayed configurable per question (closes #80)#724

Open
SAY-5 wants to merge 1 commit into
magmax:mainfrom
SAY-5:feat/configurable-max-options-displayed
Open

feat: make max options displayed configurable per question (closes #80)#724
SAY-5 wants to merge 1 commit into
magmax:mainfrom
SAY-5:feat/configurable-max-options-displayed

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 21, 2026

Closes #80.

Adds a per-question max_options_displayed_at_once parameter to List and Checkbox questions. When unset (default), the existing 13-row window is preserved; when set to a positive integer it overrides the visible window size, letting users browse longer choice lists without truncation.

Hmm, I think we would accept PR with this proposal.@AuHau, #80 (comment)

The renderers (_list.py, _checkbox.py) read the value through a property on the render class, so the module-level MAX_OPTIONS_DISPLAYED_AT_ONCE constant continues to define the default and other consumers are unaffected.

Tests:

  • test_max_options_displayed_at_once_shows_more_choices (List, Checkbox): renders 40 choices with max_options_displayed_at_once=25 and asserts choices 0-24 are visible while choice 25 is windowed out.
  • test_max_options_displayed_at_once_default_unchanged (List, Checkbox): confirms the default 13-row window still applies.
  • Both render tests fail with TypeError: ... got an unexpected keyword argument 'max_options_displayed_at_once' if the source change is reverted.
  • Full tests/integration/console_render/test_list.py + test_checkbox.py + tests/unit suite: 98 passed, 2 skipped locally on Python 3.11.

Docs: added a max_options_displayed_at_once section to docs/usage.md.

@SAY-5 SAY-5 requested review from Cube707 and magmax as code owners May 21, 2026 06:40
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.

Make MAX_OPTIONS_DISPLAYED_AT_ONCE configurable

1 participant