fix(flowpilot): widen message bar, add close/abandon session support

- Message bar now fixed-positioned above action bar with full-width
  layout (respects both app sidebar and session sidebar)
- Added abandon_session endpoint (POST /ai-sessions/{id}/abandon)
- Added "Close" button to FlowPilot action bar with confirmation dialog
- Session can now be closed without resolving or escalating

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michael Chihlas
2026-03-21 18:20:34 -04:00
parent 74bc5a532d
commit 6ecb5a9bbd
8 changed files with 170 additions and 43 deletions

View File

@@ -29,6 +29,7 @@ export interface UseFlowPilotSession {
escalateSession: (data: EscalateSessionRequest) => Promise<SessionDocumentation>
pauseSession: () => Promise<void>
resumeOwnSession: () => Promise<void>
abandonSession: () => Promise<void>
rateSession: (rating: number, feedback?: string) => Promise<void>
loadSession: (sessionId: string) => Promise<void>
@@ -190,6 +191,18 @@ export function useFlowPilotSession(): UseFlowPilotSession {
}
}, [session])
const abandonSession = useCallback(async () => {
if (!session) return
try {
await aiSessionsApi.abandonSession(session.id)
setSession(prev => prev ? { ...prev, status: 'abandoned' } : null)
setCurrentStep(null)
toast.success('Session closed')
} catch {
toast.error('Failed to close session')
}
}, [session])
const rateSession = useCallback(async (rating: number, feedback?: string) => {
if (!session) return
try {
@@ -245,6 +258,7 @@ export function useFlowPilotSession(): UseFlowPilotSession {
escalateSession,
pauseSession,
resumeOwnSession,
abandonSession,
rateSession,
loadSession,
isActive,