From b2d515566be87398c84ce7603f772058f7e8b730 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Thu, 11 Jun 2026 02:17:02 -0700 Subject: [PATCH] [eric] onboarding: fix Build starters opening in Agent mode (prefill-mode now wins the reset race) + quirky 4th prompt per category (minecraft, world record, fantasy quest, moon) --- .../src/app/pages/Dashboard/DashboardToolbar.tsx | 13 ++++++++----- .../pages/Dashboard/canvas/DashboardEmptyState.tsx | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/pages/Dashboard/DashboardToolbar.tsx b/frontend/src/app/pages/Dashboard/DashboardToolbar.tsx index 04f73eb4..6684a805 100644 --- a/frontend/src/app/pages/Dashboard/DashboardToolbar.tsx +++ b/frontend/src/app/pages/Dashboard/DashboardToolbar.tsx @@ -143,12 +143,15 @@ const DashboardToolbar = React.forwardRef( } prevInputOpen.current = inputOpen; }, [inputOpen, settingsLoaded, defaultMode, defaultModel, defaultThinkingLevel]); - // A Build starter opens the composer in App Builder mode. Runs after the - // reset above (declaration order) so it wins; cleared back to default when - // prefillMode is gone (normal new chat). + // Prefill-driven mode: a Build starter opens the composer in App Builder mode + // ('view-builder'); a non-Build starter (no prefillMode) falls back to the + // default. Gated on inputOpen + declared last so it wins the reset effects + // above regardless of settings-load timing. A later manual pick survives + // because none of these deps change on a pick. useEffect(() => { - if (prefillMode) setMode(prefillMode); - }, [prefillMode]); + if (!inputOpen || !settingsLoaded) return; + setMode(prefillMode || defaultMode || 'agent'); + }, [prefillMode, inputOpen, settingsLoaded, defaultMode]); // Writes toolbar picks through to global default; otherwise the reopen-reset effect would snap back next open. const promoteToDefault = useCallback((key: K, value: AppSettings[K]) => { diff --git a/frontend/src/app/pages/Dashboard/canvas/DashboardEmptyState.tsx b/frontend/src/app/pages/Dashboard/canvas/DashboardEmptyState.tsx index ef10c865..7f2fee9d 100644 --- a/frontend/src/app/pages/Dashboard/canvas/DashboardEmptyState.tsx +++ b/frontend/src/app/pages/Dashboard/canvas/DashboardEmptyState.tsx @@ -26,7 +26,7 @@ const STARTER_CATEGORIES: StarterCategory[] = [ 'Find today\'s top news and summarize it for me', 'Compare the 3 best standing desks and recommend one', 'Plan a weekend trip to Tokyo with a day-by-day itinerary', - 'Find the highest-rated wireless earbuds under $100', + 'Find the strangest world record I could actually break', ], }, { @@ -35,7 +35,7 @@ const STARTER_CATEGORIES: StarterCategory[] = [ 'Build a focus timer that dings when the break starts', 'Make a tip calculator that splits the bill', 'Create a Snake game I can play right now', - 'Build a daily habit tracker with a streak counter', + 'Build a tiny Minecraft-style block world I can walk around in', ], }, { @@ -44,7 +44,7 @@ const STARTER_CATEGORIES: StarterCategory[] = [ 'Write a friendly email introducing myself to a new client', 'Turn my rough notes into a polished update', 'Write a product description for a coffee mug', - 'Write a short poem about the sea', + 'Write my morning routine as an epic fantasy quest', ], }, { @@ -53,7 +53,7 @@ const STARTER_CATEGORIES: StarterCategory[] = [ 'Explain how AI chatbots actually work, in plain English', 'Teach me the basics of investing in 5 minutes', 'Explain the stock market like I\'m five', - 'Give me a 5-minute crash course on climate change', + 'What would happen if the moon disappeared tomorrow?', ], }, ];