diff --git a/frontend/src/components/pilot/ScriptBuilderTab.tsx b/frontend/src/components/pilot/ScriptBuilderTab.tsx index 662ca50c..a87c211c 100644 --- a/frontend/src/components/pilot/ScriptBuilderTab.tsx +++ b/frontend/src/components/pilot/ScriptBuilderTab.tsx @@ -165,7 +165,9 @@ export function ScriptBuilderTab({ // onViewScript is required by ScriptBuilderChat — provide a no-op for now // (inline preview is a future extension). - const handleViewScript = (_script: string, _filename: string | null) => { + const handleViewScript = (script: string, filename: string | null) => { + void script + void filename // Future: open inline preview panel } diff --git a/frontend/src/hooks/useFlowPilotSession.ts b/frontend/src/hooks/useFlowPilotSession.ts index 85b9d542..3ef4b68b 100644 --- a/frontend/src/hooks/useFlowPilotSession.ts +++ b/frontend/src/hooks/useFlowPilotSession.ts @@ -100,11 +100,13 @@ export function useFlowPilotSession(): UseFlowPilotSession { setCurrentStep(firstStep) } catch (e: unknown) { // Prefer the backend's detail message over the generic axios status string - const detail = (e as any)?.response?.data?.detail + const axiosErr = e as { response?: { status?: number; data?: { detail?: unknown } } } + const detail = axiosErr?.response?.data?.detail const message = typeof detail === 'string' ? detail : (e instanceof Error ? e.message : 'Failed to start session') setError(message) // Global axios interceptor already shows a toast for 5xx — skip duplicate - if (!(e as any)?.response?.status || (e as any)?.response?.status < 500) { + const status = axiosErr?.response?.status + if (!status || status < 500) { toast.error(message) } } finally { diff --git a/frontend/src/pages/FlowPilotSessionPage.tsx b/frontend/src/pages/FlowPilotSessionPage.tsx index 4ab4d0b6..e1ecd22e 100644 --- a/frontend/src/pages/FlowPilotSessionPage.tsx +++ b/frontend/src/pages/FlowPilotSessionPage.tsx @@ -19,8 +19,9 @@ export default function FlowPilotSessionPage() { const navigate = useNavigate() const location = useLocation() const prefill = (location.state as { prefill?: string } | null)?.prefill || '' - const psaTicketId = (location.state as any)?.psaTicketId as string | undefined - const psaTicket = (location.state as any)?.psaTicket as PSATicketInfo | undefined + const locationState = location.state as { psaTicketId?: string; psaTicket?: PSATicketInfo } | null + const psaTicketId = locationState?.psaTicketId + const psaTicket = locationState?.psaTicket const isPickup = searchParams.get('pickup') === 'true' const fp = useFlowPilotSession() const branching = useBranching() diff --git a/frontend/src/pages/TicketsPage.tsx b/frontend/src/pages/TicketsPage.tsx index 256b0314..b89d9bce 100644 --- a/frontend/src/pages/TicketsPage.tsx +++ b/frontend/src/pages/TicketsPage.tsx @@ -141,23 +141,42 @@ export default function TicketsPage() { function updateFilters(updated: Partial) { const next = new URLSearchParams(searchParams) - if ('search' in updated) updated.search ? next.set('search', updated.search!) : next.delete('search') - if ('board_id' in updated) updated.board_id ? next.set('board', String(updated.board_id)) : next.delete('board') - if ('status_id' in updated) updated.status_id ? next.set('status', String(updated.status_id)) : next.delete('status') - if ('priority' in updated) updated.priority ? next.set('priority', updated.priority!) : next.delete('priority') - if ('company_id' in updated) updated.company_id ? next.set('company', String(updated.company_id)) : next.delete('company') - if ('assigned' in updated) { - const a = updated.assigned - a === 'all' ? next.delete('assigned') : next.set('assigned', String(a)) + if ('search' in updated) { + if (updated.search) next.set('search', updated.search) + else next.delete('search') + } + if ('board_id' in updated) { + if (updated.board_id) next.set('board', String(updated.board_id)) + else next.delete('board') + } + if ('status_id' in updated) { + if (updated.status_id) next.set('status', String(updated.status_id)) + else next.delete('status') + } + if ('priority' in updated) { + if (updated.priority) next.set('priority', updated.priority) + else next.delete('priority') + } + if ('company_id' in updated) { + if (updated.company_id) next.set('company', String(updated.company_id)) + else next.delete('company') + } + if ('assigned' in updated) { + if (updated.assigned === 'all') next.delete('assigned') + else next.set('assigned', String(updated.assigned)) + } + if ('include_closed' in updated) { + if (updated.include_closed) next.set('closed', 'true') + else next.delete('closed') } - if ('include_closed' in updated) updated.include_closed ? next.set('closed', 'true') : next.delete('closed') next.delete('page') // reset to 1 on filter change setSearchParams(next) } function updatePage(p: number) { const next = new URLSearchParams(searchParams) - p === 1 ? next.delete('page') : next.set('page', String(p)) + if (p === 1) next.delete('page') + else next.set('page', String(p)) setSearchParams(next) }