From 00441befe6e86e153d6e5a9e147499d9dce2d6be Mon Sep 17 00:00:00 2001 From: Oleg Samarin Date: Sat, 11 Apr 2026 09:43:08 +0300 Subject: [PATCH 1/2] Fixed --continue passed even when no sessions exist for the directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When SessionMode.CONTINUE_LAST was selected, claude --continue was unconditionally appended. If no prior sessions existed for the working directory, the CLI would fail. Fix: extracted appendSessionFlags() from start(), added ClaudeSessionStore.hasAnySessions() (file-existence check, no parsing), and guard --continue behind it — falls back to a new session silently. Fixed tab not closing when CLOSE_ONLY is selected in SaveAndSwitchDialog After stopping and renaming a session, the tab now closes itself via `doCloseTab()` (which calls `TopComponent.close()`). A protected hook method was introduced to make the behaviour testable without the full NetBeans platform. Added "Restart Advanced..." option to Save & Switch dialog Stops the current session and returns to the selector panel in the same tab, allowing full reconfiguration (directory, profile, mode) before starting a new session. Also fixed a bug where selecting "Resume specific" in the selector panel showed an empty session list until the profile was changed. Root cause: reloadSessionModePanel() only updated SessionModePanel when mode was already RESUME_SPECIFIC, so the stored workingDir was stale. Fix: always update SessionModePanel on directory/profile changes, and also refresh on pathCombo changes. Co-Authored-By: Claude Sonnet 4.6 --- pom.xml | 2 +- .../nbclaudecodegui/model/SessionMode.java | 4 ++ .../process/ClaudeProcess.java | 56 ++++++++++++----- .../process/ClaudeSessionStore.java | 25 ++++++++ .../ui/ClaudeSessionSelectorPanel.java | 4 +- .../nbclaudecodegui/ui/ClaudeSessionTab.java | 11 +++- .../nbclaudecodegui/ui/SessionModePanel.java | 29 +++++---- .../process/ClaudeProcessTest.java | 60 ++++++++++++++++++ .../ui/ClaudeSessionTabCloseOnlyTest.java | 61 +++++++++++++++++++ .../ui/SessionModePanelTest.java | 14 +++++ 10 files changed, 235 insertions(+), 31 deletions(-) create mode 100644 src/test/java/io/github/nbclaudecodegui/ui/ClaudeSessionTabCloseOnlyTest.java diff --git a/pom.xml b/pom.xml index aa9791eb..ab4e7cad 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbclaudecodegui netbeans-claude-code-gui - 0.21.18-SNAPSHOT + 0.21.22-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/model/SessionMode.java b/src/main/java/io/github/nbclaudecodegui/model/SessionMode.java index c401aee3..9bf4fc81 100644 --- a/src/main/java/io/github/nbclaudecodegui/model/SessionMode.java +++ b/src/main/java/io/github/nbclaudecodegui/model/SessionMode.java @@ -6,6 +6,9 @@ *