From 380ac474f9ad6c4293d355a4fb949a996f3902bd Mon Sep 17 00:00:00 2001 From: sid597 Date: Wed, 15 Apr 2026 12:05:53 +0530 Subject: [PATCH 1/2] ENG-1595: Wire extract button; build system prompt from selected node types --- .../extract-nodes/components/Sidebar.tsx | 27 ++-- .../app/(extract)/extract-nodes/page.tsx | 52 ++++++ apps/website/app/api/ai/extract/route.ts | 7 +- apps/website/app/prompts/extraction.ts | 152 +++++++++++++----- apps/website/app/types/extraction.ts | 2 +- 5 files changed, 176 insertions(+), 64 deletions(-) diff --git a/apps/website/app/(extract)/extract-nodes/components/Sidebar.tsx b/apps/website/app/(extract)/extract-nodes/components/Sidebar.tsx index 627c0fac7..c6e7424b8 100644 --- a/apps/website/app/(extract)/extract-nodes/components/Sidebar.tsx +++ b/apps/website/app/(extract)/extract-nodes/components/Sidebar.tsx @@ -3,7 +3,7 @@ import { useRef } from "react"; import { Button } from "@repo/ui/components/ui/button"; import { Checkbox } from "@repo/ui/components/ui/checkbox"; import { Textarea } from "@repo/ui/components/ui/textarea"; -import { ChevronDown, Upload } from "lucide-react"; +import { Upload } from "lucide-react"; import { NODE_TYPE_DEFINITIONS } from "~/types/extraction"; const SECTION_LABEL_CLASS = @@ -16,6 +16,9 @@ type SidebarProps = { onResearchQuestionChange: (value: string) => void; selectedTypes: Set; onToggleType: (candidateTag: string) => void; + onExtract: () => void; + canExtract: boolean; + isExtracting: boolean; }; export const Sidebar = ({ @@ -25,6 +28,9 @@ export const Sidebar = ({ onResearchQuestionChange, selectedTypes, onToggleType, + onExtract, + canExtract, + isExtracting, }: SidebarProps): React.ReactElement => { const fileInputRef = useRef(null); @@ -92,17 +98,6 @@ export const Sidebar = ({ )} -
-

Model

- -
-

Research Question