55import { getUuid , setUuid , apiBind , apiFetchSessions , apiFetchAllSessions , apiFetchEnvironments , apiFetchSession , apiFetchSessionHistory , apiSendEvent , apiSendControl , apiInterrupt , apiCreateSession } from "./api.js" ;
66import { connectSSE , disconnectSSE } from "./sse.js" ;
77import { appendEvent , renderPermissionRequest , showLoading , isLoading , resetReplayState , renderReplayPendingRequests } from "./render.js" ;
8+ import { initTaskPanel , toggleTaskPanel , resetTaskState } from "./task-panel.js" ;
89import { esc , formatTime , statusClass } from "./utils.js" ;
910
1011// ============================================================
@@ -159,6 +160,12 @@ function stopDashboardRefresh() {
159160
160161async function renderSessionDetail ( id ) {
161162 currentSessionId = id ;
163+
164+ // Reset task state for new session and init panel
165+ resetTaskState ( ) ;
166+ const taskPanelEl = document . getElementById ( "task-panel" ) ;
167+ if ( taskPanelEl ) initTaskPanel ( taskPanelEl ) ;
168+
162169 try {
163170 const session = await apiFetchSession ( id ) ;
164171 document . getElementById ( "session-title" ) . textContent = session . title || session . id ;
@@ -586,6 +593,18 @@ function setupIdentityPanel() {
586593 } ) ;
587594}
588595
596+ // ============================================================
597+ // Task Panel Toggle
598+ // ============================================================
599+
600+ function setupTaskPanelToggle ( ) {
601+ window . __toggleTaskPanel = toggleTaskPanel ;
602+ const toggleBtn = document . getElementById ( "task-panel-toggle" ) ;
603+ if ( toggleBtn ) {
604+ toggleBtn . addEventListener ( "click" , ( ) => toggleTaskPanel ( ) ) ;
605+ }
606+ }
607+
589608// ============================================================
590609// Init
591610// ============================================================
@@ -594,5 +613,6 @@ document.addEventListener("DOMContentLoaded", () => {
594613 setupControlBar ( ) ;
595614 setupNewSessionDialog ( ) ;
596615 setupIdentityPanel ( ) ;
616+ setupTaskPanelToggle ( ) ;
597617 handleRoute ( ) ;
598618} ) ;
0 commit comments