fix: clear cockpit state on session switch and add loading placeholders

- Reset triageMeta, psaTicketId, steps, and completedSteps when
  activeChatId changes (prevents stale triage data from previous session
  showing while AI processes the new one)
- Split the activeChatId and activeActions reset effects so triage
  only resets on session switch, not on every new action set
- Add loading placeholders to cockpit work zone: spinner + "analyzing"
  text in steps panel, "questions will appear here" in right panel
- Add centered "Starting session..." loader to FlowPilot page when
  loading with no messages yet (prefill creation period)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-04-03 05:56:29 +00:00
parent b03f84aecf
commit 91e3f80707
2 changed files with 55 additions and 21 deletions

View File

@@ -149,6 +149,12 @@ export default function FlowPilotPage() {
</p>
</div>
)}
{session.messages.length === 0 && session.loading && (
<div className="flex flex-col items-center justify-center h-full text-center gap-3">
<Loader2 size={24} className="animate-spin text-primary" />
<p className="text-sm text-muted-foreground">Starting session...</p>
</div>
)}
{session.messages.map((msg, i) => (
<ChatMessage
key={i}