From 84d93c2901f82b8a9a011edf4231174957620627 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 5 Jan 2026 15:57:17 +0100 Subject: [PATCH 1/2] fix: prevent "No App Specification Found" during spec generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check generation status before trying to load the spec file. This prevents 500 errors and confusing UI during spec generation. Changes: - useSpecLoading now checks specRegeneration.status() first - If generation is running, skip the file read and set isGenerationRunning - SpecView uses isGenerationRunning to show generating UI properly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/ui/src/components/views/spec-view.tsx | 17 +++++++++++------ .../views/spec-view/hooks/use-spec-loading.ts | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/apps/ui/src/components/views/spec-view.tsx b/apps/ui/src/components/views/spec-view.tsx index 1a2d24ca..189e0f9a 100644 --- a/apps/ui/src/components/views/spec-view.tsx +++ b/apps/ui/src/components/views/spec-view.tsx @@ -14,7 +14,7 @@ export function SpecView() { const { currentProject, appSpec } = useAppStore(); // Loading state - const { isLoading, specExists, loadSpec } = useSpecLoading(); + const { isLoading, specExists, isGenerationRunning, loadSpec } = useSpecLoading(); // Save state const { isSaving, hasChanges, saveSpec, handleChange, setHasChanges } = useSpecSave(); @@ -82,15 +82,20 @@ export function SpecView() { ); } - // Empty state - no spec exists - if (!specExists) { + // Empty state - no spec exists or generation is running + // When generation is running, we skip loading the spec to avoid 500 errors, + // so we show the empty state with generation indicator + if (!specExists || isGenerationRunning) { + // If generation is running (from loading hook check), ensure we show the generating UI + const showAsGenerating = isCreating || isGenerationRunning; + return ( <> setShowCreateDialog(true)} /> diff --git a/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts b/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts index 01abbfbe..d90c3148 100644 --- a/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts +++ b/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts @@ -9,6 +9,7 @@ export function useSpecLoading() { const { currentProject, setAppSpec } = useAppStore(); const [isLoading, setIsLoading] = useState(true); const [specExists, setSpecExists] = useState(true); + const [isGenerationRunning, setIsGenerationRunning] = useState(false); const loadSpec = useCallback(async () => { if (!currentProject) return; @@ -16,6 +17,20 @@ export function useSpecLoading() { setIsLoading(true); try { const api = getElectronAPI(); + + // Check if spec generation is running before trying to load + // This prevents showing "No App Specification Found" during generation + if (api.specRegeneration) { + const status = await api.specRegeneration.status(); + if (status.success && status.isRunning) { + logger.debug('Spec generation is running, skipping load'); + setIsGenerationRunning(true); + setIsLoading(false); + return; + } + setIsGenerationRunning(false); + } + const result = await api.readFile(`${currentProject.path}/.automaker/app_spec.txt`); if (result.success && result.content) { @@ -42,6 +57,7 @@ export function useSpecLoading() { isLoading, specExists, setSpecExists, + isGenerationRunning, loadSpec, }; } From 73d0edb87372e6aeb5ac53d5dcfe9ded9259fe8f Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 5 Jan 2026 16:01:41 +0100 Subject: [PATCH 2/2] refactor: move setIsGenerationRunning(false) outside if block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address PR review feedback - ensure isGenerationRunning is always reset to false when generation is not running, even if api.specRegeneration is not available. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../src/components/views/spec-view/hooks/use-spec-loading.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts b/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts index d90c3148..52826020 100644 --- a/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts +++ b/apps/ui/src/components/views/spec-view/hooks/use-spec-loading.ts @@ -28,8 +28,9 @@ export function useSpecLoading() { setIsLoading(false); return; } - setIsGenerationRunning(false); } + // Always reset when generation is not running (handles edge case where api.specRegeneration might not be available) + setIsGenerationRunning(false); const result = await api.readFile(`${currentProject.path}/.automaker/app_spec.txt`);