From 9d9778fb459a5b5e68a45fc927159bd898ce02fe Mon Sep 17 00:00:00 2001 From: Oleg Samarin Date: Wed, 22 Apr 2026 16:33:52 +0300 Subject: [PATCH] Fixed toolbar button focusing an existing session tab instead of opening a new one when all open tabs have active sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved selectorPanel.lock() into startSession() so it is called centrally for every code path that launches a session. Previously onSaveAndSwitch() called startSession() without locking the selector panel first — after cleanupChatLayout() called unlock(), the Open button remained enabled, causing isSessionActive() to return false for an active session. The toolbar's openNewOrFocus() would then find that tab and focus it instead of creating a new empty one. Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 2 ++ pom.xml | 2 +- .../java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f9b4e11..9b86824e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- Fixed toolbar button focusing an existing session tab instead of opening a new one when all open tabs have active sessions + # 0.21.54 (2026-04-22) - Fixed prompt area being collapsible to zero height by dragging the divider diff --git a/pom.xml b/pom.xml index 35fe8506..c7d51f4a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbclaudecodegui netbeans-claude-code-gui - 0.21.57-SNAPSHOT + 0.21.58-SNAPSHOT nbm Netbeans Claude Code GUI NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE. diff --git a/src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java b/src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java index 2d2d7a49..e4fc3c3f 100644 --- a/src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java +++ b/src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java @@ -604,7 +604,6 @@ public void autoStart(File dir, String profileName, String extraCliArgs, selectorPanel.setProfile(profileName); selectorPanel.preselectForDirectory(dir); selectorPanel.setExtraCliArgs(extraCliArgs); - selectorPanel.lock(); startSession(dir, profileName, extraCliArgs != null ? extraCliArgs : "", mode != null ? mode : SessionMode.NEW, resumeSessionId); } @@ -651,7 +650,6 @@ public String getSelectedProfileName() { /** Fired by the selector panel when the user confirms a valid directory. */ private void onDirectoryOpened(File dir, String profileName, String extraCliArgs, SessionMode mode, String resumeSessionId) { - selectorPanel.lock(); startSession(dir, profileName, extraCliArgs, mode, resumeSessionId); } @@ -661,6 +659,7 @@ private void startSession(File dir, String profileName, String extraCliArgs) { private void startSession(File dir, String profileName, String extraCliArgs, SessionMode mode, String resumeSessionId) { + selectorPanel.lock(); this.activeResumeSessionId = resumeSessionId; Path configDir = null; if (!ClaudeProfile.DEFAULT_NAME.equals(profileName)) {