diff --git a/public/index.html b/public/index.html index 04b425e..9017b09 100644 --- a/public/index.html +++ b/public/index.html @@ -100,6 +100,60 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + display: flex; + align-items: center; + gap: 8px; + } + + .state-badge { + padding: 2px 8px; + border-radius: 4px; + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; + flex-shrink: 0; + } + + .state-ready { + background: #6b7280; + color: white; + } + + .state-thinking { + background: #3b82f6; + color: white; + } + + .state-thinking::after { + content: '...'; + animation: dots 1.5s infinite; + } + + @keyframes dots { + 0%, 20% { content: '.'; } + 40% { content: '..'; } + 60%, 100% { content: '...'; } + } + + .state-permission { + background: #f59e0b; + color: white; + } + + .state-question { + background: #f59e0b; + color: white; + } + + .state-complete { + background: #10b981; + color: white; + } + + .state-interrupted { + background: #ef4444; + color: white; } .session-cwd { @@ -566,6 +620,7 @@ output: '', outputRenderedLength: 0, expanded: false, + state: 'ready', }); renderSessions(); }); @@ -602,6 +657,15 @@ renderPrompts(); }); + es.addEventListener('state', (e) => { + const data = JSON.parse(e.data); + const session = state.sessions.get(data.session_id); + if (session) { + session.state = data.state; + updateSessionCard(data.session_id); + } + }); + state.eventSource = es; } @@ -615,6 +679,19 @@ } }; + function renderStateBadge(sessionState) { + const labels = { + ready: 'Ready', + thinking: 'Thinking', + permission: 'Permission Required', + question: 'Question', + complete: 'Complete', + interrupted: 'Interrupted' + }; + const label = labels[sessionState] || sessionState; + return `${label}`; + } + function renderSessions() { if (state.sessions.size === 0) { $sessions.innerHTML = '