feat(flowpilot): add always-visible message bar, remove hidden free text escape hatch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michael Chihlas
2026-03-21 16:49:46 -04:00
parent ad64f26883
commit ec7df50064
3 changed files with 85 additions and 52 deletions

View File

@@ -2,9 +2,7 @@ import { useState } from 'react'
import { MessageSquare, Zap, CheckCircle2, SkipForward, ChevronDown, ChevronUp } from 'lucide-react'
import { cn } from '@/lib/utils'
import type { AISessionStepResponse, StepResponseRequest } from '@/types/ai-session'
import type { FileUploadResponse } from '@/types/upload'
import { MarkdownContent } from '@/components/ui/MarkdownContent'
import { RichTextInput } from '@/components/common/RichTextInput'
import { FlowPilotOptions } from './FlowPilotOptions'
import { InSessionScriptGenerator } from './InSessionScriptGenerator'
@@ -27,10 +25,7 @@ const STEP_TYPE_ICONS = {
} as const
export function FlowPilotStepCard({ step, isCurrentStep, isProcessing, sessionId, onRespond }: FlowPilotStepCardProps) {
const [freeText, setFreeText] = useState('')
const [showFreeText, setShowFreeText] = useState(false)
const [isCollapsed, setIsCollapsed] = useState(!isCurrentStep)
const [_freeTextUploads, setFreeTextUploads] = useState<FileUploadResponse[]>([])
const content = step.content as Record<string, unknown>
const stepText = (content.text as string) || ''
@@ -42,13 +37,6 @@ export function FlowPilotStepCard({ step, isCurrentStep, isProcessing, sessionId
onRespond({ selected_option: value })
}
const handleFreeTextSubmit = () => {
if (!freeText.trim()) return
onRespond({ free_text_input: freeText.trim() })
setFreeText('')
setShowFreeText(false)
}
const handleSkip = () => {
onRespond({ was_skipped: true })
}
@@ -197,46 +185,6 @@ export function FlowPilotStepCard({ step, isCurrentStep, isProcessing, sessionId
</div>
)}
{/* Free text escape hatch */}
{!isResolutionSuggestion && step.allow_free_text && (
<>
{!showFreeText ? (
<button
onClick={() => setShowFreeText(true)}
className="text-xs text-muted-foreground hover:text-foreground transition-colors"
>
None of these let me describe
</button>
) : (
<div className="space-y-2">
<RichTextInput
value={freeText}
onChange={setFreeText}
onFilesChange={setFreeTextUploads}
sessionId={sessionId}
placeholder="Describe what you're seeing..."
rows={3}
/>
<div className="flex gap-2">
<button
onClick={handleFreeTextSubmit}
disabled={!freeText.trim()}
className="rounded-lg bg-gradient-brand px-4 py-1.5 text-sm font-semibold text-[#101114] hover:opacity-90 disabled:opacity-50 transition-opacity"
>
Submit
</button>
<button
onClick={() => { setShowFreeText(false); setFreeText('') }}
className="rounded-lg px-4 py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors"
>
Cancel
</button>
</div>
</div>
)}
</>
)}
{/* Skip option */}
{!isResolutionSuggestion && step.allow_skip && (
<button