From d0b3e0d9bbc6fafd141ee84feee751a616ccf938 Mon Sep 17 00:00:00 2001 From: Shirone Date: Tue, 6 Jan 2026 01:53:08 +0100 Subject: [PATCH 1/3] refactor: move logger initialization outside of useCliStatus function - Moved the logger initialization to the top of the file for better readability and to avoid re-initialization on each function call. - This change enhances the performance and clarity of the code in the useCliStatus hook. - fix infinite loop calling caused by rerender because of logger --- apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts b/apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts index 43c8a6f6..811f7719 100644 --- a/apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts +++ b/apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts @@ -7,6 +7,7 @@ interface UseCliStatusOptions { setCliStatus: (status: any) => void; setAuthStatus: (status: any) => void; } +const logger = createLogger('CliStatus'); export function useCliStatus({ cliType, @@ -15,7 +16,6 @@ export function useCliStatus({ setAuthStatus, }: UseCliStatusOptions) { const [isChecking, setIsChecking] = useState(false); - const logger = createLogger('CliStatus'); const checkStatus = useCallback(async () => { logger.info(`Starting status check for ${cliType}...`); From b8e0c18c53fa584ed5e0dadaf4cff38bd6ff9f82 Mon Sep 17 00:00:00 2001 From: Shirone Date: Tue, 6 Jan 2026 02:00:41 +0100 Subject: [PATCH 2/3] fix: theme switch bug - when user had set up theme on the project lvl i and went trought the setup wizard again and changed theme its was not updating because its was only updating global theme and app was reverting back to show current project theme --- .../src/components/views/setup-view/steps/theme-step.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/ui/src/components/views/setup-view/steps/theme-step.tsx b/apps/ui/src/components/views/setup-view/steps/theme-step.tsx index 835678ef..2698ca7c 100644 --- a/apps/ui/src/components/views/setup-view/steps/theme-step.tsx +++ b/apps/ui/src/components/views/setup-view/steps/theme-step.tsx @@ -11,7 +11,7 @@ interface ThemeStepProps { } export function ThemeStep({ onNext, onBack }: ThemeStepProps) { - const { theme, setTheme, setPreviewTheme } = useAppStore(); + const { theme, setTheme, setPreviewTheme, currentProject, setProjectTheme } = useAppStore(); const [activeTab, setActiveTab] = useState<'dark' | 'light'>('dark'); const handleThemeHover = (themeValue: string) => { @@ -24,6 +24,11 @@ export function ThemeStep({ onNext, onBack }: ThemeStepProps) { const handleThemeClick = (themeValue: string) => { setTheme(themeValue as typeof theme); + // Also update the current project's theme if one exists + // This ensures the selected theme is visible since getEffectiveTheme() prioritizes project theme + if (currentProject) { + setProjectTheme(currentProject.id, themeValue as typeof theme); + } setPreviewTheme(null); }; From a4968f7235aa590c9006259124fbfca841a48734 Mon Sep 17 00:00:00 2001 From: Shirone Date: Tue, 6 Jan 2026 02:04:08 +0100 Subject: [PATCH 3/3] 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', {