Repository navigation
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 intoOct 4, 2026
Conversation
…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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Scrolling pickers such as
/modelrender 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.applyDetectedChoiceMenunow 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 packagepasses. Manually verified with/modelin a short terminal window.🤖 Generated with Claude Code