From b08e28030bf9ec7bad1ecd1e4faea10c3f18c68d Mon Sep 17 00:00:00 2001 From: chihlasm Date: Tue, 24 Mar 2026 10:01:45 +0000 Subject: [PATCH] feat: add ForkCard component for in-chat fork decision points Renders fork reason text and a list of option buttons. Selected option gets an accent border and accent-dim background. Unselected options use border-default. GitFork icon in header. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/session/ForkCard.tsx | 61 ++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 frontend/src/components/session/ForkCard.tsx diff --git a/frontend/src/components/session/ForkCard.tsx b/frontend/src/components/session/ForkCard.tsx new file mode 100644 index 00000000..7974faf5 --- /dev/null +++ b/frontend/src/components/session/ForkCard.tsx @@ -0,0 +1,61 @@ +import { GitFork } from 'lucide-react' +import { cn } from '@/lib/utils' +import type { ForkPointResponse } from '@/types/branching' + +interface ForkCardProps { + fork: ForkPointResponse + selectedBranchId: string | null + onSelectOption: (branchId: string) => void +} + +export function ForkCard({ fork, selectedBranchId, onSelectOption }: ForkCardProps) { + return ( +
+ {/* Header */} +
+ + + Fork Point + +
+ + {/* Fork reason */} +

{fork.fork_reason}

+ + {/* Options */} +
+ {fork.options.map((option) => { + const isSelected = option.branch_id === selectedBranchId + return ( + + ) + })} +
+
+ ) +}