Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fixed terminal scrollbar disappearing when Claude shows a choice/confirmation prompt (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/22)
- Fixed Cancel button sending Ctrl+C instead of Esc, making it impossible to exit /usage and similar screens
- Fixed Default profile settings not saving in Tools → Options → Profiles (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/31)
- Fixed "Open with Claude Code" context menu not applying Default profile settings (API key, proxy, Extra CLI args, etc.) (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/23)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,14 @@ private void switchSouthCard(String card) {
if (southCard == null || southCardLayout == null) return;
activeCard = card;
southCardLayout.show(southCard, card);
splitPane.setEnabled(!CARD_CHOICE.equals(card));
// Disable only the divider when the choice menu is shown, not the whole
// splitPane. setEnabled(false) on the splitPane propagates to all child
// components including the terminal widget's scrollbar, making it
// unresponsive. Disabling only the divider prevents the user from
// dragging the splitter while leaving the terminal fully interactive.
if (splitPane.getUI() instanceof javax.swing.plaf.basic.BasicSplitPaneUI ui) {
ui.getDivider().setEnabled(!CARD_CHOICE.equals(card));
}
if (!CARD_CHOICE.equals(card)) {
// restore divider for this card
int total = splitPane.getHeight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,56 @@ void preferredHeightAfterSplitPaneValidateCoversAllContent() throws Exception {
});
}

// -------------------------------------------------------------------------
// Regression: splitPane must stay enabled when choice menu is shown (#22)
// -------------------------------------------------------------------------

/**
* Regression test for issue #22: showing the choice menu must not disable
* the {@link JSplitPane}. Disabling the whole splitPane propagated to all
* child components including the terminal scrollbar, making it unresponsive.
* The fix disables only the divider via {@code BasicSplitPaneUI.getDivider()}.
*/
@Test
void splitPaneRemainsEnabledWhenChoiceMenuShown() throws Exception {
SwingUtilities.invokeAndWait(() -> {
ChoiceMenuPanel choiceMenuPanel = new ChoiceMenuPanel(() -> null);
JPanel promptPanel = new JPanel();

java.awt.CardLayout cardLayout = new java.awt.CardLayout();
JPanel southCard = new JPanel(cardLayout);
southCard.add(promptPanel, "prompt");
southCard.add(choiceMenuPanel, "choice");

JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
new JPanel(), southCard);

JFrame frame = new JFrame();
frame.add(splitPane);
frame.setSize(400, 600);
frame.setVisible(true);

try {
choiceMenuPanel.show(new ChoiceMenuModel("Continue?",
List.of(new Option("Yes", "1"), new Option("No", "2")), -1),
answer -> {});
cardLayout.show(southCard, "choice");

// Simulate the production switchSouthCard(CARD_CHOICE) path:
// only the divider is disabled, not the whole splitPane.
if (splitPane.getUI() instanceof javax.swing.plaf.basic.BasicSplitPaneUI ui) {
ui.getDivider().setEnabled(false);
}

assertTrue(splitPane.isEnabled(),
"splitPane must remain enabled when choice menu is shown — " +
"disabling it would also disable the terminal scrollbar (issue #22)");
} finally {
frame.dispose();
}
});
}

// -------------------------------------------------------------------------
// helpers
// -------------------------------------------------------------------------
Expand Down
Loading