diff --git a/CHANGELOG.md b/CHANGELOG.md index dff93854..171a3d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Fixed tab title showing "Claude Code" for sessions opened in non-project directories — now shows the directory name - Added OpenAI-compatible proxy: profiles can now route Claude Code through any OpenAI-compatible API provider (OpenAI, Azure, Groq, DeepSeek, Ollama, local models, etc.) # 1.1.7 (2026-05-22) diff --git a/pom.xml b/pom.xml index ea4b004c..75b32a3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbplugins netbeans-plugin-claude-code-gui - 1.2.7-SNAPSHOT + 1.2.8-SNAPSHOT nbm Netbeans Plugin 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/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanel.java b/src/main/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanel.java index f77bdf54..85b40fc5 100644 --- a/src/main/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanel.java +++ b/src/main/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanel.java @@ -337,7 +337,7 @@ public void preselectForDirectory(File dir) { * Resolves the tab label for a session directory. * *

Returns the NetBeans project display name when {@code dir} matches an - * open project, or {@code "Claude Code"} as a fallback. Returns the + * open project, or the directory name as a fallback. Returns the * localised "New Session" string when {@code dir} is {@code null}. * * @param dir working directory, or {@code null} for a new empty session @@ -373,8 +373,8 @@ public static String resolveTabLabel(File dir) { LOG.fine("canonical path comparison failed: " + e.getMessage()); } } - LOG.warning("resolveTabLabel: no project match for " + dir.getAbsolutePath()); - return "Claude Code"; + LOG.fine("resolveTabLabel: no project match for " + dir.getAbsolutePath() + ", using dir name"); + return dir.getName(); } // ------------------------------------------------------------------------- diff --git a/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeCodeTopComponentTest.java b/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeCodeTopComponentTest.java index 9f3535c1..7574198a 100644 --- a/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeCodeTopComponentTest.java +++ b/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeCodeTopComponentTest.java @@ -31,7 +31,7 @@ void testSessionPanelLabelResolutionNoProject() throws IOException { tmpDir.deleteOnExit(); try { String label = ClaudeSessionSelectorPanel.resolveTabLabel(tmpDir); - assertEquals("Claude Code", label); + assertEquals(tmpDir.getName(), label); } finally { tmpDir.delete(); } @@ -72,15 +72,15 @@ void testTabTooltipSetImmediatelyOnStartSession() throws IOException { void testTabNameRemainsStableWhenProjectsAlreadyLoaded() throws IOException { // When openProjects() Future is already done (projects fully loaded), // updateDisplayName must not schedule a background refresh — the name is final. - // Verify this by checking that a tab created for a non-project dir keeps "Claude Code". + // Verify this by checking that a tab created for a non-project dir uses the dir name. File tmpDir = Files.createTempDirectory("proj-loaded-test").toFile(); tmpDir.deleteOnExit(); try { ClaudeSessionTab tc = new ClaudeSessionTab(); tc.autoStart(tmpDir, "default"); - // openProjects() is done in test env (no real projects) — name must be "Claude Code" - assertEquals("Claude Code", tc.getDisplayName(), - "Tab name for non-project dir must be 'Claude Code'"); + // openProjects() is done in test env (no real projects) — name must be the dir basename + assertEquals(tmpDir.getName(), tc.getDisplayName(), + "Tab name for non-project dir must be the directory name"); } finally { tmpDir.delete(); } diff --git a/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanelTest.java b/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanelTest.java index 2605f352..85e866f2 100644 --- a/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanelTest.java +++ b/src/test/java/io/github/nbplugins/claudecodegui/ui/ClaudeSessionSelectorPanelTest.java @@ -151,9 +151,9 @@ void resolveTabLabelNonProjectDirReturnsFallback() throws IOException { tmpDir.deleteOnExit(); try { String label = ClaudeSessionSelectorPanel.resolveTabLabel(tmpDir); - // No open projects in the headless test environment → fallback "Claude Code" - assertEquals("Claude Code", label, - "resolveTabLabel must fall back to 'Claude Code' for non-project dirs"); + // No open projects in the headless test environment → fallback is the directory name + assertEquals(tmpDir.getName(), label, + "resolveTabLabel must fall back to the directory name for non-project dirs"); } finally { tmpDir.delete(); }