diff --git a/ui/src/components/OnboardingWizard.tsx b/ui/src/components/OnboardingWizard.tsx index 91a66232..57a9c201 100644 --- a/ui/src/components/OnboardingWizard.tsx +++ b/ui/src/components/OnboardingWizard.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { useNavigate } from "react-router-dom"; -import { useQueryClient } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useDialog } from "../context/DialogContext"; import { useCompany } from "../context/CompanyContext"; import { companiesApi } from "../api/companies"; @@ -9,6 +9,11 @@ import { agentsApi } from "../api/agents"; import { issuesApi } from "../api/issues"; import { queryKeys } from "../lib/queryKeys"; import { Dialog, DialogContent } from "@/components/ui/dialog"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; import { Button } from "@/components/ui/button"; import { cn } from "../lib/utils"; import { @@ -23,6 +28,8 @@ import { Sparkles, Check, Loader2, + FolderOpen, + ChevronDown, } from "lucide-react"; type Step = 1 | 2 | 3 | 4; @@ -37,6 +44,7 @@ export function OnboardingWizard() { const [step, setStep] = useState(1); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); + const [modelOpen, setModelOpen] = useState(false); // Step 1 const [companyName, setCompanyName] = useState(""); @@ -59,6 +67,14 @@ export function OnboardingWizard() { const [createdCompanyId, setCreatedCompanyId] = useState(null); const [createdAgentId, setCreatedAgentId] = useState(null); + const { data: adapterModels } = useQuery({ + queryKey: ["adapter-models", adapterType], + queryFn: () => agentsApi.adapterModels(adapterType), + enabled: onboardingOpen && step === 2, + }); + + const selectedModel = (adapterModels ?? []).find((m) => m.id === model); + function reset() { setStep(1); setLoading(false); @@ -377,23 +393,69 @@ export function OnboardingWizard() { - setCwd(e.target.value)} - /> +
+ + setCwd(e.target.value)} + /> + +
- setModel(e.target.value)} - /> + + + + + + + {(adapterModels ?? []).map((m) => ( + + ))} + +
)} @@ -553,9 +615,6 @@ export function OnboardingWizard() { )}
- - {step < 4 && "Cmd+Enter to continue"} - {step === 1 && (