From 68489b5c9998c5fcceb29bc8c2eefb37c0367242 Mon Sep 17 00:00:00 2001 From: Paul Liu <20290410+Paulkm2006@users.noreply.github.com> Date: Fri, 7 Aug 2026 19:42:13 +0800 Subject: [PATCH 1/2] feat: fetch models in profile creation page --- frontend/src/components/ModelPicker.tsx | 68 ++++++++++--------- .../src/components/ProviderModelPicker.tsx | 51 ++++++++++++++ frontend/src/pages/AgentProfilePage.tsx | 14 ++-- frontend/src/pages/AgentSelectionPage.tsx | 6 +- .../pages/EnvironmentOverviewPage.test.tsx | 4 +- .../src/pages/EnvironmentOverviewPage.tsx | 2 +- frontend/src/pages/ProfilesPage.test.tsx | 24 +++++++ frontend/src/pages/ProfilesPage.tsx | 14 ++-- frontend/src/state/wizardReducer.test.ts | 4 ++ frontend/src/state/wizardReducer.ts | 2 +- 10 files changed, 141 insertions(+), 48 deletions(-) create mode 100644 frontend/src/components/ProviderModelPicker.tsx diff --git a/frontend/src/components/ModelPicker.tsx b/frontend/src/components/ModelPicker.tsx index efe54d8..e3f41b7 100644 --- a/frontend/src/components/ModelPicker.tsx +++ b/frontend/src/components/ModelPicker.tsx @@ -1,5 +1,5 @@ import { Check, Search } from "lucide-react"; -import { useMemo, useState } from "react"; +import { useMemo } from "react"; import { useI18n } from "../i18n"; @@ -7,50 +7,52 @@ interface ModelPickerProps { models: string[]; value: string; onChange: (value: string) => void; + inputId?: string; + inputLabel?: string; + required?: boolean; } -export function ModelPicker({ models, value, onChange }: ModelPickerProps) { +export function ModelPicker({ models, value, onChange, inputId = "manual-model", inputLabel, required }: ModelPickerProps) { const { t } = useI18n(); - const [query, setQuery] = useState(""); const filtered = useMemo( - () => models.filter((model) => model.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase())), - [models, query], + () => models.filter((model) => model.toLocaleLowerCase().includes(value.trim().toLocaleLowerCase())), + [models, value], ); return (
{status.providers[draft.provider]?.has_key diff --git a/frontend/src/pages/AgentSelectionPage.tsx b/frontend/src/pages/AgentSelectionPage.tsx index 041d86a..48e4bf1 100644 --- a/frontend/src/pages/AgentSelectionPage.tsx +++ b/frontend/src/pages/AgentSelectionPage.tsx @@ -6,12 +6,12 @@ import { AgentRow } from "../components/AgentRow"; import { MirrorSetting } from "../components/MirrorSetting"; import { PageScaffold } from "../components/PageScaffold"; import { RuntimePrompt } from "../components/RuntimePrompt"; +import { StatusBadge } from "../components/StatusBadge"; import { useI18n } from "../i18n"; -import { byRank } from "../state/ranking"; import { desktopApps, desktopProtocol } from "../state/desktopSetup"; +import { byRank } from "../state/ranking"; import { useWizard } from "../state/WizardContext"; import type { AgentCatalogItem } from "../types/api"; -import { StatusBadge } from "../components/StatusBadge"; export function AgentSelectionPage() { const navigate = useNavigate(); @@ -75,8 +75,8 @@ export function AgentSelectionPage() {
diff --git a/frontend/src/state/wizardReducer.test.ts b/frontend/src/state/wizardReducer.test.ts
index 34faf53..36a1050 100644
--- a/frontend/src/state/wizardReducer.test.ts
+++ b/frontend/src/state/wizardReducer.test.ts
@@ -33,6 +33,10 @@ const successProbe = {
} satisfies ProbeResponse;
describe("wizardReducer", () => {
+ it("defaults Agent selection to desktop", () => {
+ expect(initialWizardState.setupKind).toBe("desktop");
+ });
+
it("loads status and reports status errors", () => {
let state = wizardReducer(initialWizardState, { type: "STATUS_LOADING" });
expect(state.statusState).toBe("loading");
diff --git a/frontend/src/state/wizardReducer.ts b/frontend/src/state/wizardReducer.ts
index a61dfa7..8d4ff36 100644
--- a/frontend/src/state/wizardReducer.ts
+++ b/frontend/src/state/wizardReducer.ts
@@ -57,7 +57,7 @@ export const initialWizardState: WizardState = {
status: null,
statusState: "idle",
statusError: "",
- setupKind: "cli",
+ setupKind: "desktop",
selectedAgentIds: [],
provider: "ppio",
probeModel: "",
From 0dae5d5eb213f68b94a066e83d33f5def434147d Mon Sep 17 00:00:00 2001
From: Paul Liu <20290410+Paulkm2006@users.noreply.github.com>
Date: Fri, 7 Aug 2026 19:45:37 +0800
Subject: [PATCH 2/2] fix: allow empty list in desktop agents
---
frontend/src/state/desktopSetup.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/state/desktopSetup.ts b/frontend/src/state/desktopSetup.ts
index 66a4263..8de43e6 100644
--- a/frontend/src/state/desktopSetup.ts
+++ b/frontend/src/state/desktopSetup.ts
@@ -2,7 +2,7 @@ import type { DesktopAgentStatus, ProfileSummary, StatusResponse } from "../type
export function desktopApps(status: StatusResponse): DesktopAgentStatus[] {
const seen = new Set