feat(evidence): add RichTextInput with clipboard paste and wire into FlowPilot

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 03:31:03 +00:00
parent f87f3d47de
commit 1d5454c31b
6 changed files with 313 additions and 19 deletions

View File

@@ -1,7 +1,9 @@
import { useState } from 'react'
import { AlertTriangle, Loader2 } from 'lucide-react'
import { Modal } from '@/components/common/Modal'
import { RichTextInput } from '@/components/common/RichTextInput'
import type { EscalateSessionRequest } from '@/types/ai-session'
import type { FileUploadResponse } from '@/types/upload'
interface EscalateModalProps {
open: boolean
@@ -9,10 +11,12 @@ interface EscalateModalProps {
onEscalate: (data: EscalateSessionRequest) => Promise<unknown>
isProcessing: boolean
hasPsaTicket: boolean
sessionId?: string
}
export function EscalateModal({ open, onClose, onEscalate, isProcessing, hasPsaTicket }: EscalateModalProps) {
export function EscalateModal({ open, onClose, onEscalate, isProcessing, hasPsaTicket, sessionId }: EscalateModalProps) {
const [reason, setReason] = useState('')
const [_escalateUploads, setEscalateUploads] = useState<FileUploadResponse[]>([])
const handleSubmit = async () => {
if (!reason.trim() || reason.trim().length < 5) return
@@ -42,13 +46,13 @@ export function EscalateModal({ open, onClose, onEscalate, isProcessing, hasPsaT
<label className="mb-1.5 block text-sm font-medium text-foreground">
Why are you escalating?
</label>
<textarea
<RichTextInput
value={reason}
onChange={(e) => setReason(e.target.value)}
onChange={setReason}
onFilesChange={setEscalateUploads}
sessionId={sessionId}
placeholder="e.g. I've exhausted all networking diagnostics and suspect this is a firewall policy issue that requires senior admin access..."
className="w-full rounded-lg border border-border bg-card px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground focus:border-[rgba(6,182,212,0.3)] focus:outline-none resize-none"
rows={4}
autoFocus
/>
<p className="mt-1 text-[0.625rem] text-[#5a6170]">
Minimum 5 characters. This will be shown to the engineer who picks up.