Conversation
- 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
- 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
- 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.
📝 WalkthroughWalkthroughThree files were modified to enhance theme configuration and spec regeneration handling. The theme step now synchronizes project-level theme settings with global theme changes, the spec regeneration handler conditionally displays toast notifications based on creation flow status, and logger initialization was moved from hook scope to module scope for reuse. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
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 several small but impactful bugs across the application's UI. It resolves issues with redundant toast notifications during app spec generation, ensures theme selections in the setup wizard are correctly applied even when an existing project has its own theme, and fixes an infinite re-render loop related to logger creation in a CLI status hook. These changes improve user experience and application stability. 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
The pull request introduces a conditional success toast for app specification creation, ensuring it only appears during an active creation flow rather than general regeneration. It also refactors the useCliStatus hook by moving the logger initialization outside the hook to prevent re-creation on every render. Furthermore, the theme selection logic in ThemeStep was updated to not only set the global theme but also apply the selected theme to the currentProject if one exists, prioritizing project-specific themes. A review comment highlights a type safety concern within this theme selection logic, specifically regarding the themeValue as typeof theme assertion, which is problematic because ThemeMode (used by theme) appears to be outdated and narrower than the Theme type that themeValue can represent, potentially causing runtime issues.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.ts (1)
5-6: Organize imports before module-level declarations.The
const loggerdeclaration is placed between import statements, which breaks conventional code organization. Move all imports to the top, then place module-level declarations.🔎 Suggested fix
import { useEffect } from 'react'; import { createLogger } from '@automaker/utils/logger'; import { toast } from 'sonner'; - -const logger = createLogger('SpecRegeneration'); import { getElectronAPI } from '@/lib/electron'; import type { SpecRegenerationEvent } from '@/types/electron'; + +const logger = createLogger('SpecRegeneration');apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts (1)
69-69: Removeloggerfrom the dependency array.Since
loggeris now a module-level constant with a stable reference, it doesn't need to be in theuseCallbackdependency array. Including it is unnecessary and could confuse readers into thinking it might change.🔎 Suggested fix
- }, [cliType, statusApi, setCliStatus, setAuthStatus, logger]); + }, [cliType, statusApi, setCliStatus, setAuthStatus]);
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.tsapps/ui/src/components/views/setup-view/hooks/use-cli-status.tsapps/ui/src/components/views/setup-view/steps/theme-step.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/ui/src/components/views/setup-view/steps/theme-step.tsxapps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.tsapps/ui/src/components/views/setup-view/hooks/use-cli-status.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/ui/src/components/views/setup-view/steps/theme-step.tsxapps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.tsapps/ui/src/components/views/setup-view/hooks/use-cli-status.ts
🧠 Learnings (1)
📚 Learning: 2025-12-30T01:02:07.114Z
Learnt from: illia1f
Repo: AutoMaker-Org/automaker PR: 324
File: apps/ui/src/components/views/board-view/components/kanban-card/kanban-card.tsx:122-131
Timestamp: 2025-12-30T01:02:07.114Z
Learning: Tailwind CSS v4 uses postfix syntax for the important modifier: append ! at the end of the utility class (e.g., backdrop-blur-[0px]! or hover:bg-red-500!). The older v3 style used a prefix (!) at the start (e.g., !backdrop-blur-[0px]); prefer the postfix form for consistency across TSX files.
Applied to files:
apps/ui/src/components/views/setup-view/steps/theme-step.tsx
🧬 Code graph analysis (1)
apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts (2)
libs/utils/src/logger.ts (1)
createLogger(127-219)libs/utils/src/index.ts (1)
createLogger(44-44)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: e2e
🔇 Additional comments (3)
apps/ui/src/components/layout/sidebar/hooks/use-spec-regeneration.ts (1)
44-60: LGTM!The conditional toast logic correctly distinguishes between creation flow and regular regeneration. The
isCreationFlowcheck with the inline comment makes the intent clear, and this should effectively eliminate the duplicate toast notifications.apps/ui/src/components/views/setup-view/hooks/use-cli-status.ts (1)
10-10: Good fix for the infinite loop.Moving the logger to module scope ensures a stable reference across renders, correctly addressing the re-render loop issue.
apps/ui/src/components/views/setup-view/steps/theme-step.tsx (1)
25-33: LGTM!The fix correctly addresses the theme synchronization issue. By updating both the global theme and the project-level theme when a selection is made, the selected theme will persist correctly since
getEffectiveTheme()prioritizes the project theme. The conditional check forcurrentProjectsafely handles cases where no project exists.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.