fix: detect Quick Prompt completion from all terminal events

The popup stayed in 'streaming' phase because it only transitioned
to 'complete' on message-complete or status:idle when prev was
exactly 'streaming'. If other events (agent-activity, run-updated)
arrived between the last delta and idle, the phase guard could miss.

Broaden completion detection:
- status:idle now completes from any non-idle/non-complete phase
- agent-activity:completed also triggers completion
- Covers all paths the sidecar uses to signal turn end

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-04-13 12:45:40 +02:00
co-authored by Copilot
parent b02a90a15f
commit 872476b2e3
@@ -80,7 +80,9 @@ export function QuickPromptApp() {
} else if (event.kind === 'message-complete') {
setPhase('complete');
} else if (event.kind === 'status' && event.status === 'idle') {
setPhase((prev) => (prev === 'streaming' ? 'complete' : prev));
setPhase((prev) => (prev === 'idle' || prev === 'complete' ? prev : 'complete'));
} else if (event.kind === 'agent-activity' && event.activityType === 'completed') {
setPhase((prev) => (prev === 'idle' || prev === 'complete' ? prev : 'complete'));
} else if (event.kind === 'error') {
setErrorMessage(event.error ?? 'An unexpected error occurred.');
setPhase('error');