From 1707f8f3d4c46c34e2eef71a9779d05437ef5379 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Tue, 24 Mar 2026 10:12:13 +0000 Subject: [PATCH] feat: add HandoffModal for unified park/escalate Fixed overlay with park/escalate intent toggle (accent-dim when active), notes textarea, elevated priority checkbox (escalate only), and Cancel/Submit buttons. Mobile responsive: items-end on mobile, items-center on sm+. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/components/session/HandoffModal.tsx | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 frontend/src/components/session/HandoffModal.tsx diff --git a/frontend/src/components/session/HandoffModal.tsx b/frontend/src/components/session/HandoffModal.tsx new file mode 100644 index 00000000..4e2826ac --- /dev/null +++ b/frontend/src/components/session/HandoffModal.tsx @@ -0,0 +1,167 @@ +import { useState } from 'react' +import { X } from 'lucide-react' +import { cn } from '@/lib/utils' +import type { HandoffCreateRequest } from '@/types/branching' + +interface HandoffModalProps { + onClose: () => void + onSubmit: (data: HandoffCreateRequest) => Promise +} + +type HandoffIntent = 'park' | 'escalate' + +export function HandoffModal({ onClose, onSubmit }: HandoffModalProps) { + const [intent, setIntent] = useState('park') + const [notes, setNotes] = useState('') + const [elevated, setElevated] = useState(false) + const [isSubmitting, setIsSubmitting] = useState(false) + + async function handleSubmit() { + setIsSubmitting(true) + try { + const data: HandoffCreateRequest = { + intent, + engineer_notes: notes.trim() || undefined, + priority: intent === 'escalate' && elevated ? 'elevated' : 'normal', + } + await onSubmit(data) + onClose() + } finally { + setIsSubmitting(false) + } + } + + return ( +
+ {/* Backdrop */} +