fix: prevent 'No App Specification Found' during spec generation#363
fix: prevent 'No App Specification Found' during spec generation#363
Conversation
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 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a user experience issue where the application UI would incorrectly display an error message or encounter server errors when an application specification was in the process of being generated. The changes introduce a mechanism to detect ongoing spec generation, allowing the UI to show an appropriate 'Generating Specification' message instead of misleading errors, thereby providing clearer feedback to the user. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves an issue where a "No App Specification Found" message would flicker during spec generation. By adding a status check in the useSpecLoading hook, the application now correctly identifies when a generation process is active and avoids attempting to load the spec file prematurely. The changes in SpecView properly utilize the new isGenerationRunning flag to display the correct UI state to the user. The implementation is solid and directly addresses the problem. I've included one minor suggestion to enhance the robustness of the state management in use-spec-loading.ts.
| 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); | ||
| } |
There was a problem hiding this comment.
This is a small refactoring for improved robustness. By moving setIsGenerationRunning(false) outside the if (api.specRegeneration) block, we ensure that isGenerationRunning is always reset to false if the generation is not running. This handles the edge case where api.specRegeneration might not be available and makes the state handling more predictable.
| 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); | |
| } | |
| 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); |
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 <noreply@anthropic.com>
Summary
Changes
useSpecLoadingnow checksspecRegeneration.status()before reading the fileisGenerationRunningflagSpecViewusesisGenerationRunningto show the generating UI properly