diff --git a/vibn-frontend/components/vibn-chat/chat-panel.tsx b/vibn-frontend/components/vibn-chat/chat-panel.tsx index 1411495..2ad3967 100644 --- a/vibn-frontend/components/vibn-chat/chat-panel.tsx +++ b/vibn-frontend/components/vibn-chat/chat-panel.tsx @@ -1290,6 +1290,7 @@ export function ChatPanel({ let assistantContent = ""; let lastKind = ""; + let currentThoughtText = ""; const assistantMsg: Message = { role: "assistant", content: "" }; let msgIndex = -1; @@ -1434,6 +1435,16 @@ export function ChatPanel({ }); } else if (ev.type === "thinking_delta" && ev.text) { lastKind = "thought"; + currentThoughtText += ev.text; + + // Extract the latest bold heading to display in the spinner label + const matches = [...currentThoughtText.matchAll(/\*\*([^*]+)\*\*/g)]; + if (matches.length > 0) { + setCurrentPhaseLabel(matches[matches.length - 1][1].trim() + "..."); + } else { + setCurrentPhaseLabel("Thinking..."); + } + setMessages((prev) => { const next = [...prev]; if (msgIndex >= 0 && next[msgIndex]) { @@ -2090,32 +2101,7 @@ export function ChatPanel({ )} - {/* Action Status Bar anchored above composer */} - {sending && currentPhaseLabel && ( -
- - - {currentPhaseLabel} - -
- )} + {(selectToggle) => (