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,9 +1,11 @@
import { useState, useEffect } from 'react'
import { Sparkles, FileText, Terminal, X, AlertTriangle } from 'lucide-react'
import { TicketPickerModal } from '@/components/session/TicketPickerModal'
import { RichTextInput } from '@/components/common/RichTextInput'
import { integrationsApi } from '@/api/integrations'
import type { AISessionCreateRequest } from '@/types/ai-session'
import type { PSATicketInfo, PsaConnectionResponse } from '@/types/integrations'
import type { FileUploadResponse } from '@/types/upload'
interface FlowPilotIntakeProps {
onSubmit: (request: AISessionCreateRequest) => void
@@ -20,6 +22,9 @@ export function FlowPilotIntake({ onSubmit, isLoading }: FlowPilotIntakeProps) {
const [psaConnection, setPsaConnection] = useState<PsaConnectionResponse | null>(null)
const [psaChecked, setPsaChecked] = useState(false)
// Upload state (no session_id yet — uploads linked later)
const [_intakeUploads, setIntakeUploads] = useState<FileUploadResponse[]>([])
// Selected ticket state
const [selectedTicket, setSelectedTicket] = useState<PSATicketInfo | null>(null)
const [selectedTicketId, setSelectedTicketId] = useState<string | null>(null)
@@ -168,19 +173,12 @@ export function FlowPilotIntake({ onSubmit, isLoading }: FlowPilotIntakeProps) {
{/* Main text area (hidden when ticket is selected) */}
{!selectedTicket && (
<textarea
<RichTextInput
value={text}
onChange={(e) => setText(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault()
if (text.trim() || logContent.trim()) handleSubmit()
}
}}
onChange={setText}
onFilesChange={setIntakeUploads}
placeholder="e.g. User can't access shared drive after password reset, getting 'Access Denied' in Event Viewer..."
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={5}
autoFocus
/>
)}