create-claude-code-visualizer 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-code-visualizer",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Run and manage Claude Code agents through a web UI",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -46,6 +46,9 @@ export default function AgentDetailPage({ params }: { params: Promise<{ slug: st
46
46
  // Track if initial session load has been triggered (prevents double-fire)
47
47
  const initialLoadRef = useRef(false);
48
48
 
49
+ // Track the previous slug so we can detect agent switches
50
+ const prevSlugRef = useRef(slug);
51
+
49
52
  // Mark notifications as read for the currently viewed session
50
53
  const markSessionNotificationsRead = useCallback((sid: string) => {
51
54
  fetch("/api/notifications", {
@@ -55,6 +58,26 @@ export default function AgentDetailPage({ params }: { params: Promise<{ slug: st
55
58
  }).catch(() => {});
56
59
  }, []);
57
60
 
61
+ // --- Clean up when switching between agents (slug change) ---
62
+ // Without this, the SSE connection from the previous agent stays alive
63
+ // and streams tool output into the wrong conversation.
64
+
65
+ useEffect(() => {
66
+ if (prevSlugRef.current !== slug) {
67
+ prevSlugRef.current = slug;
68
+ disconnect();
69
+ reset();
70
+ setIsRunning(false);
71
+ setCurrentPrompt(null);
72
+ setConversationRuns([]);
73
+ setCompletedRunEvents({});
74
+ setSessionId(null);
75
+ currentRunIdRef.current = null;
76
+ activeSessionRef.current = null;
77
+ initialLoadRef.current = false;
78
+ }
79
+ }, [slug, disconnect, reset]);
80
+
58
81
  // --- Data loading ---
59
82
 
60
83
  useEffect(() => {
@@ -47,7 +47,10 @@ function categorizeSkill(slug: string): string {
47
47
  if (slug.startsWith("gws-")) return "Google Workspace";
48
48
  if (slug.startsWith("recipe-")) return "Recipes";
49
49
  if (slug.startsWith("persona-")) return "Personas";
50
- if (slug.includes("frontend") || slug.includes("design")) return "Development";
50
+ if (["create-blog-post", "create-linkedin-post", "create-post-designs", "publish-wordpress", "content-humanizer"].includes(slug)) return "Content";
51
+ if (slug === "linkedin-analytics") return "Analytics";
52
+ if (slug === "store-supabase") return "Data";
53
+ if (slug === "frontend-design") return "Development";
51
54
  return "Other";
52
55
  }
53
56