From a4968f7235aa590c9006259124fbfca841a48734 Mon Sep 17 00:00:00 2001 From: Shirone Date: Tue, 6 Jan 2026 02:04:08 +0100 Subject: [PATCH] fix: show success toast only during project creation flow - Updated the useSpecRegeneration hook to conditionally display the success toast message only when the user is in the active project creation flow, preventing unnecessary notifications during regular spec regeneration. --- .../layout/sidebar/hooks/use-spec-regeneration.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.ts b/apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.ts index 88348655..9dc9c669 100644 --- a/apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.ts +++ b/apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.ts @@ -42,6 +42,9 @@ export function useSpecRegeneration({ } if (event.type === 'spec_regeneration_complete') { + // Only show toast if we're in active creation flow (not regular regeneration) + const isCreationFlow = creatingSpecProjectPath !== null; + setSpecCreatingForProject(null); setShowSetupDialog(false); setProjectOverview(''); @@ -49,9 +52,12 @@ export function useSpecRegeneration({ // Clear onboarding state if we came from onboarding setNewProjectName(''); setNewProjectPath(''); - toast.success('App specification created', { - description: 'Your project is now set up and ready to go!', - }); + + if (isCreationFlow) { + toast.success('App specification created', { + description: 'Your project is now set up and ready to go!', + }); + } } else if (event.type === 'spec_regeneration_error') { setSpecCreatingForProject(null); toast.error('Failed to create specification', {