From 80237bdd624bdb6306ac03eee31ba66ea6fbaf58 Mon Sep 17 00:00:00 2001 From: Tony <44562332+TonyGuy@users.noreply.github.com> Date: Sat, 28 Mar 2026 15:35:30 +0800 Subject: [PATCH] fix(ui): seed CCXT select defaults and validate connection fields in account wizard Controlled selects did not set `exchange` until changed, leaving it undefined for Zod validation. Initialize select fields without metadata defaults to the first option, require connection fields before step 2, and gate Next/Create accordingly. --- ui/src/pages/TradingPage.tsx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/ui/src/pages/TradingPage.tsx b/ui/src/pages/TradingPage.tsx index 99dc46d1..b07c8d42 100644 --- a/ui/src/pages/TradingPage.tsx +++ b/ui/src/pages/TradingPage.tsx @@ -370,7 +370,13 @@ function CreateWizard({ brokerTypes, existingAccountIds, onSave, onClose }: { if (!bt) return const defaults: Record = {} for (const f of bt.fields) { - if (f.default !== undefined) defaults[f.name] = f.default + if (f.default !== undefined) { + defaults[f.name] = f.default + } else if (f.type === 'select' && f.options?.length) { + // Controlled