From 51780d142160289e64cf71518f0e1d0326e8c0cd Mon Sep 17 00:00:00 2001 From: Forgotten Date: Tue, 17 Feb 2026 20:07:41 -0600 Subject: [PATCH] Improve OnboardingWizard: model picker and styled working directory input - Step 2 now queries adapter models and shows a model selection dropdown - Working directory input uses the shared folder icon + border style from AgentConfigForm for visual consistency - Directory picker button falls back gracefully when showDirectoryPicker is unavailable Co-Authored-By: Claude Sonnet 4.6 --- ui/src/components/OnboardingWizard.tsx | 91 +++++++++++++++++++++----- 1 file changed, 75 insertions(+), 16 deletions(-) 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 && (