Skip to content

Fixed choice menu not appearing when option descriptions span more than 3 terminal lines - #160

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/choice-menu-long-descriptions
Jun 29, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/choice-menu-long-descriptions

Conversation

@oleg68

@oleg68 oleg68 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ScreenContentDetector.detectChoiceMenu() scanned upward collecting options and incremented continuationCount for every non-option, non-blank line. When option 1 had a 4-line description, continuationCount exceeded the limit of 3 and the scan stopped before reaching option 1.
  • Because the cursor glyph (❯) was only on option 1, the cursor guard then rejected the entire menu as a false positive — ChoiceMenuPanel never appeared.
  • Fix: raise the limit from 3 to 8, and skip structural separator lines (────) so they don't consume the budget.

Test plan

  • New test fixture long-option-descriptions.src.txt / .expectedRes.json reproduces the failing case (4-line description on option 1, separator between options 4 and 5) — passes after the fix
  • All 75 ScreenContentDetectorTest cases pass (mvn test -Dtest=ScreenContentDetectorTest)
  • Install NBM and open a Claude Code session; trigger a choice menu where option descriptions wrap to 4+ terminal lines — ChoiceMenuPanel should appear

🤖 Generated with Claude Code

…an 3 terminal lines

ScreenContentDetector.detectChoiceMenu() scanned upward through the screen
and incremented continuationCount for every non-option, non-blank line.
When option 1 had a 4-line description, continuationCount reached 4 (> 3
limit) and the scan stopped before collecting option 1. Since the cursor
glyph (❯) was only on option 1, the cursor guard then rejected the entire
menu as a false positive.

Fix: raise the continuationCount limit from 3 to 8, and skip structural
separator lines (────) so they don't consume the budget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 99c2d9d into nbplugins:main Jun 29, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/choice-menu-long-descriptions branch June 29, 2026 12:30
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