Skip to content

Fixed model dropdown parsing and panel-resize regression - #179

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/issue-176-model-menu-parsing-and-combo-min-width
Sep 30, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/issue-176-model-menu-parsing-and-combo-min-width

Conversation

@oleg68

@oleg68 oleg68 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed ModelMenuParser misparsing newer Claude Code CLI /model output that adds an extra space after the option ordinal ("1. Default (recommended)"), which caused the entire line (checkmark + description) to be captured as the "model name" instead of just the short name.
  • Fixed the model dropdown's minimum width being driven by its (potentially huge, misparsed) content — it's now capped at 100px via a dynamic getMinimumSize() override, so the status bar (and therefore the panel) can always be shrunk, while the combo still grows with its content when the window is widened.

Resolves #176

Test plan

  • mvn test — new fixture format3-double-space-ordinal reproduces the reported bug (confirmed failing before the fix, passing after); full suite green (1031 tests)
  • mvn package — full build succeeds
  • Manual: installed the built NBM in NetBeans, confirmed the panel can now be shrunk well past the old ~half-screen limit, and confirmed the model combo still grows to show its content when the window is widened

🤖 Generated with Claude Code

…esize (nbplugins#176)

Resolves: nbplugins#176

- ModelMenuParser: some Claude Code CLI versions add an extra space after
  the option ordinal ("1.  Default (recommended)" instead of "1. Default
  (recommended)"), which broke the regex used to locate the name/description
  column boundary and caused the entire line (including the checkmark and
  description) to be captured as the "model name". The same newer format
  also sometimes omits the separate "· version" column entirely, putting
  the version directly in the name slot. Fixed by stripping the ordinal
  prefix before locating the boundary, and by choosing the model id based
  on whether a "·" separator is present and whether the name itself looks
  like a bare version string.
- ClaudeSessionTab: modelCombo's minimum width is now computed dynamically
  via a getMinimumSize() override (capped at 100px, never exceeding its own
  live preferred width) instead of relying on JComboBox's default minimum
  (which equals preferred size). This means the status bar can always be
  shrunk regardless of what ends up in the parsed model list — including
  any future parser regression — while the combo still grows with its
  content, up to its existing maximum, when the window is widened.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@oleg68 oleg68 changed the title Fix model dropdown parsing and panel-resize regression Fixed model dropdown parsing and panel-resize regression Sep 30, 2026
@oleg68
oleg68 merged commit c9819c8 into nbplugins:main Sep 30, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/issue-176-model-menu-parsing-and-combo-min-width branch September 30, 2026 17:48
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.

Panel occupies about half of screen width

1 participant