diff --git a/frontend/src/components/pilot/ProposalBanner.tsx b/frontend/src/components/pilot/ProposalBanner.tsx index 264213fa..491ae6f8 100644 --- a/frontend/src/components/pilot/ProposalBanner.tsx +++ b/frontend/src/components/pilot/ProposalBanner.tsx @@ -35,6 +35,8 @@ export interface ProposalBannerProps { /** Collapsed variant shown as a thin single-line strip. */ collapsed?: boolean onToggleCollapsed?: () => void + /** Silence the nudge without collapsing it (Task 11 wires this). */ + onSilenceNudge?: () => void } export function ProposalBanner(props: ProposalBannerProps) { @@ -245,12 +247,116 @@ function PartialBanner({ fix, onOutcome, onApply }: ProposalBannerProps) { ) } -// Placeholder renderers — implemented in Task 9. -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function AIConfirmingBanner(_: ProposalBannerProps) { return null } -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function NudgeBanner(_: ProposalBannerProps) { return null } -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function CollapsedBanner(_: ProposalBannerProps) { return null } +function AIConfirmingBanner({ fix, onAcceptAIProposal, onRejectAIProposal }: ProposalBannerProps) { + const proposal = fix.ai_outcome_proposal + if (!proposal) return null + const isSuccess = proposal.outcome === 'success' + const isFailure = proposal.outcome === 'failure' + + const headlineVerb = isSuccess + ? 'resolved the issue' + : isFailure + ? "didn't work" + : 'was partially applied' + + return ( +
+
+
+
+ +
+
+
+ AI detected outcome + + {isSuccess ? 'Success' : isFailure ? 'Failure' : 'Partial'} + +
+
+ AI thinks the fix {headlineVerb} — confirm? +
+
+ {proposal.reason || 'Based on the recent chat. One click either confirms or corrects.'} +
+
+
+ + +
+
+
+ ) +} + +function NudgeBanner({ fix, onOutcome, onSilenceNudge }: ProposalBannerProps) { + return ( +
+
+ + + + + + + Did "{fix.title}" work? + + + + +
+ ) +} + +function CollapsedBanner({ fix, onToggleCollapsed }: ProposalBannerProps) { + return ( + + ) +} export default ProposalBanner