fix(frontend): deduplicate live workflow activity

This commit is contained in:
User
2026-07-15 11:55:14 +02:00
parent e7a8bc29b0
commit 279b79516c
8 changed files with 169 additions and 183 deletions
+4 -7
View File
@@ -279,7 +279,7 @@ export function AppShell() {
// The harness "holds the ball" whenever a session is live, no widget is waiting on
// the human, AND the Pi turn is still in flight (agentActive). Without the last
// condition the final workflow step — which ends with no follow-up gate — would
// leave the spinner on forever.
// leave the working state on forever.
const pendingWidget = useSessionStore((s) => s.pendingWidget);
const resetSession = useSessionStore((s) => s.resetSession);
const recordLifecycle = useSessionStore((s) => s.recordLifecycle);
@@ -289,7 +289,7 @@ export function AppShell() {
const agentActive = useSessionStore((s) => s.agentActive);
const sessionViewOpen = Boolean(activeSessionId) || creatingSession;
const working = sessionViewOpen && !pendingWidget && agentActive;
// Processing time counts only while the harness works, not while a finalized
// The workflow bar runs only while the harness works, not while a finalized
// session sits idle or a gate awaits the reviewer (pendingWidget).
const running = working && !finalized;
@@ -336,7 +336,7 @@ export function AppShell() {
}
function finishSessionCreation(id: string) {
// React batches these updates, preserving the provisional view and timer
// React batches these updates, preserving the provisional session view
// while useSessionStream opens the durable session's SSE channel.
selectActiveSession(id);
setCreatingSession(false);
@@ -406,10 +406,7 @@ export function AppShell() {
<div className="mx-auto flex max-w-4xl flex-col gap-6">
{sessionViewOpen ? (
<>
<CentralStatus
working={working}
workingLabel={creatingSession ? "Creating session…" : "Analyzing question…"}
/>
<CentralStatus working={working} />
{activeSessionId && <WidgetHost sessionId={activeSessionId} />}
{finalized && !agentActive && (
<div className="rounded-2xl border border-border/80 bg-card p-5 text-center shadow-md">