chore(pilot): remove deprecated SuggestedFix task-lane card

Superseded by ProposalBanner (Phase 8). The import was already removed
from AssistantChatPage in the previous commit; this deletes the orphaned
file itself and strips the now-unused suggestedFixSlot prop from
TaskLane's interface and both call sites.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 16:48:42 -04:00
parent bdb238a274
commit 8582d24236
3 changed files with 1 additions and 106 deletions

View File

@@ -1,97 +0,0 @@
/**
* SuggestedFix card — Phase 3 task-lane section.
*
* Renders the active AI-proposed resolution path for the session
* (per FLOWPILOT-MIGRATION.md Section 3.1, "Suggested fix"). Amber-accented
* to match the mockup; clicking opens the Script Generator flow in Phase 5.
*
* For Phase 3, the card is informational + a Dismiss action. The three-option
* dialog (one_off / draft_template / build_template) is wired in Phase 5
* via a separate component.
*/
import { useState } from 'react'
import { Sparkles, X } from 'lucide-react'
import { cn } from '@/lib/utils'
import type { SessionSuggestedFix } from '@/api/sessionSuggestedFixes'
interface SuggestedFixProps {
fix: SessionSuggestedFix
onDismiss: () => Promise<void> | void
// Phase 5: clicking the card body opens the inline Script Generator panel
// (TemplateMatchPanel for template-matched fixes, NoTemplateDialog otherwise).
onActivate?: () => void
// Whether the script panel is currently open for THIS fix — controls the
// "Open" / "Close" affordance label on the card.
panelOpen?: boolean
}
function confidenceBucket(pct: number): { label: string; tone: string } {
if (pct >= 80) return { label: 'high', tone: 'text-success' }
if (pct >= 50) return { label: 'medium', tone: 'text-warning' }
return { label: 'low', tone: 'text-muted-foreground' }
}
export function SuggestedFix({ fix, onDismiss, onActivate, panelOpen }: SuggestedFixProps) {
const [busy, setBusy] = useState(false)
const conf = confidenceBucket(fix.confidence_pct)
const handleDismiss = async (e: React.MouseEvent) => {
e.stopPropagation() // don't trigger the card-body activation
setBusy(true)
try { await onDismiss() } finally { setBusy(false) }
}
return (
<section>
<div className="pb-2">
<div className="flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[1.2px] text-muted-foreground pl-0.5">
<span className="w-1.5 h-1.5 rounded-full bg-warning" />
Suggested fix
<span className="text-muted-foreground">·</span>
<span className={`tabular-nums ${conf.tone}`}>{fix.confidence_pct}% confidence</span>
</div>
</div>
<div
onClick={onActivate}
className={cn(
'rounded-lg border-l-[3px] border-l-warning border border-warning/25 bg-warning-dim/15 p-3 mb-2 transition-colors',
onActivate && 'cursor-pointer hover:border-warning/50 hover:bg-warning-dim/25',
panelOpen && 'border-warning/60 bg-warning-dim/30',
)}
>
<div className="flex items-start gap-2">
<Sparkles size={14} className="text-warning shrink-0 mt-0.5" />
<div className="min-w-0 flex-1">
<div className="text-[0.8125rem] font-medium text-heading leading-snug">
{fix.title}
</div>
<div className="mt-1 text-[0.75rem] text-muted-foreground leading-relaxed">
{fix.description}
</div>
{fix.script_template_id && (
<div className="mt-1.5 text-[0.6875rem] text-success">
Matches an existing Script Library template click to use
</div>
)}
{!fix.script_template_id && fix.ai_drafted_script && (
<div className="mt-1.5 text-[0.6875rem] text-accent-text">
Custom script drafted click to review options
</div>
)}
</div>
<button
onClick={handleDismiss}
disabled={busy}
className="p-1 rounded text-muted-foreground hover:text-danger hover:bg-elevated/40 transition-colors"
title="Dismiss this suggestion"
>
<X size={11} />
</button>
</div>
</div>
</section>
)
}
export default SuggestedFix