fix: KB Accelerator tree builder, approve all, canvas delete button
- Fix _build_troubleshooting_tree() to handle deep nesting, warning nodes, and DAG deduplication (placed set prevents duplicate IDs) - Fix step_sync VARCHAR(255) overflow on publish by truncating title - Add "Approve All" button to KB review screen - Add delete button (hover-reveal) to flow canvas nodes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import { CheckCircle2, AlertTriangle, BarChart3 } from 'lucide-react'
|
||||
import { CheckCircle2, AlertTriangle, BarChart3, CheckCheck } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { NodeCard } from './NodeCard'
|
||||
import { SourcePanel } from './SourcePanel'
|
||||
@@ -8,12 +8,13 @@ import type { KBImport, KBNodeEditRequest, KBCommitRequest } from '@/types/kbAcc
|
||||
interface ReviewScreenProps {
|
||||
kbImport: KBImport
|
||||
onEditNode: (nodeId: string, data: KBNodeEditRequest) => Promise<void>
|
||||
onApproveAll: () => Promise<void>
|
||||
onCommit: (data?: KBCommitRequest) => Promise<void>
|
||||
onDiscard: () => Promise<void>
|
||||
loading: boolean
|
||||
}
|
||||
|
||||
export function ReviewScreen({ kbImport, onEditNode, onCommit, onDiscard, loading }: ReviewScreenProps) {
|
||||
export function ReviewScreen({ kbImport, onEditNode, onApproveAll, onCommit, onDiscard, loading }: ReviewScreenProps) {
|
||||
const [highlightExcerpt, setHighlightExcerpt] = useState<string | null>(null)
|
||||
|
||||
const nodes = kbImport.nodes
|
||||
@@ -57,6 +58,21 @@ export function ReviewScreen({ kbImport, onEditNode, onCommit, onDiscard, loadin
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{approvedCount < nodes.length && (
|
||||
<button
|
||||
onClick={onApproveAll}
|
||||
disabled={loading}
|
||||
className={cn(
|
||||
'flex items-center gap-1.5 px-3 py-1.5 rounded-[8px] text-xs font-medium transition-colors',
|
||||
'bg-emerald-400/10 border border-emerald-400/20 text-emerald-400',
|
||||
'hover:bg-emerald-400/20 hover:border-emerald-400/30',
|
||||
'disabled:opacity-50 disabled:cursor-not-allowed'
|
||||
)}
|
||||
>
|
||||
<CheckCheck size={14} />
|
||||
Approve All
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -98,7 +114,7 @@ export function ReviewScreen({ kbImport, onEditNode, onCommit, onDiscard, loadin
|
||||
</div>
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div className="shrink-0 flex items-center justify-between gap-3 pb-1">
|
||||
<button
|
||||
onClick={onDiscard}
|
||||
disabled={loading}
|
||||
|
||||
Reference in New Issue
Block a user