Vector Import Flow
A guarded vector-import flow: format-aware preview, phased progress, a result stats banner, and a record-preview table before a destructive ingest.
Vector Import Flow
The Vector Import Flow wraps useImportExport: a preview panel (detected-format badge, total / with-vectors / text-only counts, detected dimensions, dimension-mismatch warning, Cancel/Confirm), a phased progress bar (parsing → validating → embedding → importing), a result stats banner (imported / skipped / re-embedded, format, duration), and a record-preview table for row-level sanity checks before a destructive ingest. It references the cross-family FormatDetectionBadge and inlines a minimal fallback so it builds independently.
Preview
Installation
pnpm dlx shadcn@latest add @localmode/ui/local-first/vector-import-flownpx shadcn@latest add @localmode/ui/local-first/vector-import-flowyarn dlx shadcn@latest add @localmode/ui/local-first/vector-import-flowbunx --bun shadcn@latest add @localmode/ui/local-first/vector-import-flowData source & dependencies
Data source: renders the import preview/progress/result you pass and emits Cancel/Confirm — works with any backend. Recommended producer: useImportExport (backed by the import/export parsers) from @localmode/react (on-device, optional).
lucide-react— iconsclsx+tailwind-merge— via the sharedcn()util (installed automatically as a registry dependency)
Registry dependencies
@localmode/ui/data-documents/format-detection-badge— the shared format badge (a minimal inline fallback ships with this item)
Files installed
vector-import-flow.tsx— theVectorImportFlowcomponentlib/utils.ts— thecn()helper (if not already present)
Props
VectorImportFlow
Prop
Type
ImportPreview
Prop
Type
Examples
Preview then import
const { parseResult, progress, stats, parsePreview, importData } = useImportExport({ db, model });
<VectorImportFlow
preview={parseResult}
targetDimensions={db.dimensions}
progress={progress}
stats={stats}
onConfirm={() => importData({ content })}
/>Customization
The dimension-mismatch warning compares preview.dimensions against targetDimensions. Swap the inline FormatBadge for the installed @localmode/ui/data-documents/format-detection-badge when present. Styled entirely with shadcn/ui CSS-variable utilities so it inherits your theme — because you own the copied file, every class and threshold is yours to change.
Vector Export Panel
An export surface for vector data: per-format export actions, corpus counts, a busy state, and a last-export summary banner.
Semantic Cache Status Bar
A compact toolbar for useSemanticCache: entry count, hit-rate, clear button, and an enable/disable toggle — with a per-message Cached annotation.