fix: allow reopening completed subagent windows + add Agent label

- Subagent windows now always minimize instead of being removed
- restoreSubagentWindow recreates window if it was deleted
- Badge now shows "Agent 1" instead of just "1"
- Use activeSessionId as fallback parent for orphan agents

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-26 20:07:00 +01:00
co-authored by Claude Opus 4.5
parent 45332b6438
commit e763599bab
4 changed files with 30 additions and 21 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ When user says "COM": 1) Increment version in BOTH `package.json` AND `CLAUDE.md
Claudeman is a Claude Code session manager with a web interface and autonomous Ralph Loop. It spawns Claude CLI processes via PTY, streams output in real-time via SSE, and supports scheduled/timed runs.
**Version**: 0.1385 (must match `package.json`)
**Version**: 0.1386 (must match `package.json`)
**Tech Stack**: TypeScript (ES2022/NodeNext, strict mode), Node.js, Fastify, Server-Sent Events, node-pty
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "claudeman",
"version": "0.1385",
"version": "0.1386",
"description": "The missing control plane for Claude Code - run 20 autonomous agents with real-time monitoring and session persistence",
"type": "module",
"main": "dist/index.js",
+17 -15
View File
@@ -1980,7 +1980,7 @@ class ClaudemanApp {
onmouseenter="app.showSubagentDropdown(this)"
onmouseleave="app.scheduleHideSubagentDropdown(this)"
onclick="event.stopPropagation(); app.pinSubagentDropdown(this);">
<span class="subagent-count">${minimizedAgents.size}</span>
<span class="subagent-label">Agent</span><span class="subagent-count">${minimizedAgents.size}</span>
<div class="subagent-dropdown" onmouseenter="app.cancelHideSubagentDropdown()" onmouseleave="app.scheduleHideSubagentDropdown(this.parentElement)">
${agentItems.join('')}
</div>
@@ -5752,14 +5752,14 @@ class ClaudemanApp {
if (!windowData) return;
const agent = this.subagents.get(agentId);
const parentSessionId = agent?.parentSessionId;
const parentSessionId = agent?.parentSessionId || this.activeSessionId;
// Always minimize to tab (use active session if no parent)
windowData.element.style.display = 'none';
windowData.minimized = true;
// Track minimized agent for the session
if (parentSessionId) {
// Minimize to tab instead of removing
windowData.element.style.display = 'none';
windowData.minimized = true;
// Track minimized agent for the parent session
if (!this.minimizedSubagents.has(parentSessionId)) {
this.minimizedSubagents.set(parentSessionId, new Set());
}
@@ -5767,15 +5767,10 @@ class ClaudemanApp {
// Update tab badge to show minimized agents
this.renderSessionTabs();
// Persist the state change
this.saveSubagentWindowStates();
} else {
// No parent session - fully remove the window
windowData.element.remove();
this.subagentWindows.delete(agentId);
}
// Persist the state change
this.saveSubagentWindowStates();
this.updateConnectionLines();
}
@@ -5820,8 +5815,15 @@ class ClaudemanApp {
restoreSubagentWindow(agentId) {
const windowData = this.subagentWindows.get(agentId);
const agent = this.subagents.get(agentId);
// If window doesn't exist but agent does, recreate it
if (!windowData && agent) {
this.createSubagentWindow(agentId);
return;
}
if (windowData) {
const agent = this.subagents.get(agentId);
const settings = this.loadAppSettingsFromStorage();
const activeTabOnly = settings.subagentActiveTabOnly ?? false;
+11 -4
View File
@@ -2958,11 +2958,11 @@ kbd {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 16px;
gap: 2px;
height: 16px;
padding: 0 4px;
padding: 0 5px;
border-radius: 8px;
font-size: 0.65rem;
font-size: 0.6rem;
cursor: pointer;
background: var(--accent);
color: white;
@@ -2972,7 +2972,14 @@ kbd {
.session-tab .tab-subagent-badge:hover {
background: var(--accent-hover);
transform: scale(1.1);
transform: scale(1.05);
}
.session-tab .tab-subagent-badge .subagent-label {
font-size: 0.55rem;
opacity: 0.85;
text-transform: uppercase;
letter-spacing: 0.02em;
}
.session-tab .tab-subagent-badge .subagent-count {