diff --git a/scripts/classify-documents.ts b/scripts/classify-documents.ts index 1340885e9..d9740730c 100644 --- a/scripts/classify-documents.ts +++ b/scripts/classify-documents.ts @@ -110,7 +110,7 @@ async function loadDocuments(supabase: SupabaseAdmin, args: ClassifyArgs) { .from("documents") .select("id,owner_id,title,file_name,source_path,status,metadata") .eq("status", "indexed") - .order("created_at", { ascending: true }) + .order("id", { ascending: true }) .range(args.documentId ? 0 : args.offset, args.documentId ? 0 : args.offset + args.limit - 1); if (args.documentId) query = query.eq("id", args.documentId); diff --git a/src/app/mockups/evidence-option/page.tsx b/src/app/mockups/evidence-option/page.tsx index 1c1108b85..df0e23f5d 100644 --- a/src/app/mockups/evidence-option/page.tsx +++ b/src/app/mockups/evidence-option/page.tsx @@ -1,134 +1,120 @@ import Image from "next/image"; import type { Metadata } from "next"; import { - ArrowRight, BadgeCheck, - BookOpen, CheckCircle2, ChevronRight, Copy, ExternalLink, - Eye, FileImage, FileSearch, FileText, Filter, + FolderOpen, + Image as ImageIcon, Layers3, - Library, ListChecks, - PanelRightOpen, Quote, Search, ShieldCheck, Sparkles, - SplitSquareHorizontal, Table2, - Target, type LucideIcon, } from "lucide-react"; import type { ReactNode } from "react"; export const metadata: Metadata = { - title: "Premium Evidence Mockups - Clinical KB", - description: "Premium ChatGPT-style evidence workspace mockups.", + title: "Evidence Option Mockups - Clinical KB", + description: "Clinical KB evidence mockups in the app visual style.", }; -type Tone = "green" | "amber" | "blue" | "graphite"; +type Tone = "source" | "success" | "warning" | "info" | "neutral"; const evidenceItems = [ { title: "ANC monitoring frequency table", kind: "Table", source: "Clozapine physical health protocol", - meta: "p. 12 - 97% direct support", - summary: "Baseline and ongoing blood monitoring cadence with hold thresholds.", + meta: "p.12 - 97% direct", + body: "Blood monitoring cadence, baseline checks, and action thresholds.", icon: Table2, - tone: "green", + tone: "source", }, { title: "Constipation escalation passage", kind: "Quote", source: "Clozapine safety bulletin", - meta: "p. 4 - exact quote", - summary: "Same-day review wording for severe constipation and abdominal symptoms.", + meta: "p.4 - exact quote", + body: "Same-day review wording for severe constipation symptoms.", icon: Quote, - tone: "blue", + tone: "info", }, { - title: "Observation pathway crop", + title: "Observation pathway image", kind: "Image", source: "Acute behavioural disturbance pathway", - meta: "p. 8 - visual extraction", - summary: "Diagram labels, observation frequency, and escalation checkpoints.", + meta: "p.8 - visual", + body: "Page crop, diagram labels, and neighbouring source text.", icon: FileImage, - tone: "graphite", + tone: "neutral", }, { - title: "Lithium toxicity threshold span", + title: "Lithium toxicity document span", kind: "Document span", source: "Lithium monitoring guideline", - meta: "p. 6 - review due", - summary: "Older local passage retained with date and governance warning.", + meta: "p.6 - review due", + body: "Threshold wording retained with governance warning.", icon: FileText, - tone: "amber", + tone: "warning", }, ] as const; const tableRows = [ ["Baseline", "FBC, LFT, U&E, lipids, glucose", "Before initiation"], - ["Weekly", "FBC/ANC", "Initial titration phase"], - ["Escalate", "Chest pain, fever, severe constipation", "Urgent medical review"], + ["Weekly", "FBC/ANC", "Initial titration"], + ["Escalate", "Chest pain, fever, constipation", "Urgent review"], ] as const; -const sourceKinds = [ +const evidenceTypes = [ ["Tables", "621", Table2], ["Quotes", "8,904", Quote], ["Images", "2,840", FileImage], ["PDF regions", "4,221", FileSearch], - ["Document pages", "1,834", FileText], + ["Documents", "1,834", FileText], ] as const; -function tone(t: Tone) { - if (t === "green") return "border-emerald-200 bg-emerald-50 text-emerald-800"; - if (t === "amber") return "border-amber-200 bg-amber-50 text-amber-800"; - if (t === "blue") return "border-sky-200 bg-sky-50 text-sky-800"; - return "border-zinc-200 bg-zinc-100 text-zinc-700"; +function toneClass(tone: Tone) { + if (tone === "source") return "border-[color:var(--clinical-chat-teal)]/25 bg-[color:var(--clinical-chat-teal-soft)] text-[color:var(--clinical-chat-teal)]"; + if (tone === "success") return "border-[color:var(--success-border)] bg-[color:var(--success-soft)] text-[color:var(--success)]"; + if (tone === "warning") return "border-[color:var(--warning-border)] bg-[color:var(--warning-soft)] text-[color:var(--warning)]"; + if (tone === "info") return "border-[color:var(--info-border)] bg-[color:var(--info-soft)] text-[color:var(--info)]"; + return "border-[color:var(--border)] bg-[color:var(--surface-subtle)] text-[color:var(--text-muted)]"; } -function Badge({ children, variant = "graphite" }: { children: ReactNode; variant?: Tone }) { +function Pill({ children, tone = "neutral" }: { children: ReactNode; tone?: Tone }) { return ( - + {children} ); } -function Glyph({ icon: Icon, variant = "graphite" }: { icon: LucideIcon; variant?: Tone }) { +function IconTile({ icon: Icon, tone = "source" }: { icon: LucideIcon; tone?: Tone }) { return ( - + ); } -function GhostButton({ - children, - icon: Icon, - primary = false, -}: { - children: ReactNode; - icon?: LucideIcon; - primary?: boolean; -}) { +function Action({ children, icon: Icon, primary = false }: { children: ReactNode; icon?: LucideIcon; primary?: boolean }) { return ( @@ -209,80 +209,74 @@ function EvidenceCard({ item, compact = false }: { item: (typeof evidenceItems)[ function EvidenceTable() { return ( -
-
- Stage - Evidence - Action +
+
+ Stage + Evidence + Action
{tableRows.map(([stage, evidence, action]) => ( -
- {stage} - {evidence} - {action} +
+ {stage} + {evidence} + {action}
))}
); } -function TopNav() { - return ( -
-
- - - - Clinical KB Evidence -
-
- {["Home", "Search", "Tables", "Images", "Quotes"].map((item, index) => ( - - {item} - - ))} -
-
- ); -} - -function HomeOne() { +function MockupHome() { return ( - -
- -
-
-
-

Evidence workspace

-

- Ask across every document part with source-grade confidence. -

-

- Search images, extracted tables, exact quotes, PDF regions, and source spans without leaving the answer - workflow. -

-
- -
+ +
+ +
+ +
+ +
+
+ +

Tables as first-class evidence

+

Rows, image crop, source page, confidence, and provenance together.

+
+
- ))} +
+
+ +

Images with inspection tools

+

Page crops, labels, region highlights, and neighbouring text.

+ Risk flow evidence preview +
-
-