Skip to content

Fixed the choice dialog (e.g. /model) endlessly flickering and resizing when not all menu items fit on screen - #183

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/choice-menu-flicker-scrolling-list
Oct 4, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/choice-menu-flicker-scrolling-list

Conversation

@oleg68

@oleg68 oleg68 commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

Scrolling pickers such as /model render as many items as fit the terminal. Showing the choice panel shrinks the terminal, Claude then draws fewer items, the panel shrinks, the terminal grows, and the cycle repeats forever (4 options/148px ↔ 3 options/126px).

Fix

ClaudeSessionController.applyDetectedChoiceMenu now treats a detected menu with the same question whose options are a strict prefix of the active menu's options as the same menu (isShrunkViewOf), keeping the larger list and breaking the loop.

Tests

Unit tests for isShrunkViewOf; mvn package passes. Manually verified with /model in a short terminal window.

🤖 Generated with Claude Code

…ng when not all menu items fit on screen

Scrolling pickers draw as many items as fit the terminal; the choice panel
shrinks the terminal, so Claude drew fewer items, which shrank the panel and
grew the terminal again. A newly detected menu with the same question whose
options are a strict prefix of the active menu's options is now treated as
the same menu, so the larger option list is kept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 99e1355 into nbplugins:main Oct 4, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/choice-menu-flicker-scrolling-list branch October 4, 2026 13:52
oleg68 added a commit that referenced this pull request Oct 4, 2026
…nu does not start from the first item (#184)

Follow-up to #183. For a scrolled list the "question" is the scroll
indicator row (e.g. `↑ 8. Fable 5`), which changes with the scroll
position, so the prefix/same-text hysteresis did not match and the menu
was rebuilt endlessly.

`isShrunkViewOf` now treats two menus as the same list when their
questions are equal or both are scroll indicators, and every option of
the smaller menu matches an option of the active one (response +
display).

Tests: added unit tests for scrolled windows. Manually verified with
`/model` in a short window.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Oleg Samarin <osamarin@openintegration.inc>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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