"use client"; import { DndContext, DragOverlay, } from "@dnd-kit/core"; import { SortableContext, verticalListSortingStrategy, } from "@dnd-kit/sortable"; import { Card, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { HotkeyButton } from "@/components/ui/hotkey-button"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; import { KanbanColumn, KanbanCard } from "./components"; import { Feature } from "@/store/app-store"; import { FastForward, Lightbulb, Trash2 } from "lucide-react"; import { useKeyboardShortcutsConfig } from "@/hooks/use-keyboard-shortcuts"; import { COLUMNS, ColumnId } from "./constants"; interface KanbanBoardProps { sensors: any; collisionDetectionStrategy: (args: any) => any; onDragStart: (event: any) => void; onDragEnd: (event: any) => void; activeFeature: Feature | null; getColumnFeatures: (columnId: ColumnId) => Feature[]; backgroundImageStyle: React.CSSProperties; backgroundSettings: { columnOpacity: number; columnBorderEnabled: boolean; hideScrollbar: boolean; cardOpacity: number; cardGlassmorphism: boolean; cardBorderEnabled: boolean; cardBorderOpacity: number; }; onEdit: (feature: Feature) => void; onDelete: (featureId: string) => void; onViewOutput: (feature: Feature) => void; onVerify: (feature: Feature) => void; onResume: (feature: Feature) => void; onForceStop: (feature: Feature) => void; onManualVerify: (feature: Feature) => void; onMoveBackToInProgress: (feature: Feature) => void; onFollowUp: (feature: Feature) => void; onCommit: (feature: Feature) => void; onRevert: (feature: Feature) => void; onMerge: (feature: Feature) => void; onComplete: (feature: Feature) => void; onImplement: (feature: Feature) => void; featuresWithContext: Set; runningAutoTasks: string[]; shortcuts: ReturnType; onStartNextFeatures: () => void; onShowSuggestions: () => void; suggestionsCount: number; onDeleteAllVerified: () => void; } export function KanbanBoard({ sensors, collisionDetectionStrategy, onDragStart, onDragEnd, activeFeature, getColumnFeatures, backgroundImageStyle, backgroundSettings, onEdit, onDelete, onViewOutput, onVerify, onResume, onForceStop, onManualVerify, onMoveBackToInProgress, onFollowUp, onCommit, onRevert, onMerge, onComplete, onImplement, featuresWithContext, runningAutoTasks, shortcuts, onStartNextFeatures, onShowSuggestions, suggestionsCount, onDeleteAllVerified, }: KanbanBoardProps) { return (
{COLUMNS.map((column) => { const columnFeatures = getColumnFeatures(column.id); return ( 0 ? ( ) : column.id === "backlog" ? (
{columnFeatures.length > 0 && ( Make )}
) : undefined } > f.id)} strategy={verticalListSortingStrategy} > {columnFeatures.map((feature, index) => { // Calculate shortcut key for in-progress cards (first 10 get 1-9, 0) let shortcutKey: string | undefined; if (column.id === "in_progress" && index < 10) { shortcutKey = index === 9 ? "0" : String(index + 1); } return ( onEdit(feature)} onDelete={() => onDelete(feature.id)} onViewOutput={() => onViewOutput(feature)} onVerify={() => onVerify(feature)} onResume={() => onResume(feature)} onForceStop={() => onForceStop(feature)} onManualVerify={() => onManualVerify(feature)} onMoveBackToInProgress={() => onMoveBackToInProgress(feature) } onFollowUp={() => onFollowUp(feature)} onCommit={() => onCommit(feature)} onRevert={() => onRevert(feature)} onMerge={() => onMerge(feature)} onComplete={() => onComplete(feature)} onImplement={() => onImplement(feature)} hasContext={featuresWithContext.has(feature.id)} isCurrentAutoTask={runningAutoTasks.includes( feature.id )} shortcutKey={shortcutKey} opacity={backgroundSettings.cardOpacity} glassmorphism={ backgroundSettings.cardGlassmorphism } cardBorderEnabled={ backgroundSettings.cardBorderEnabled } cardBorderOpacity={ backgroundSettings.cardBorderOpacity } /> ); })}
); })}
{activeFeature && ( {activeFeature.description} {activeFeature.category} )}
); }