From 0065304d917e8e081e5bea3ed6505912ef70d247 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 | 1 + pom.xml | 2 +- .../java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c3225e..752ce884 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Fixed toolbar button focusing an existing session tab instead of opening a new one when all open tabs have active sessions - Reorganized General and Advanced settings tabs: moved technical settings (hang timeout, MCP port, Enable MCP integration, session list limit, debug mode) to Advanced - Fixed prompt area being collapsible to zero height by dragging the divider - Fixed terminal scrolling to the beginning and locking when a choice/confirmation menu appears (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/22) diff --git a/pom.xml b/pom.xml index 5884868c..b4ef043c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbclaudecodegui netbeans-claude-code-gui - 0.22.16-SNAPSHOT + 0.22.17-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 a211caad..0aed0335 100644 --- a/src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java +++ b/src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java @@ -614,7 +614,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); } @@ -661,7 +660,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); } @@ -671,6 +669,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)) {