Skip to content

fix: prevent new projects from overriding global theme setting#583

Merged
webdevcody merged 2 commits intoAutoMaker-Org:v0.13.0rcfrom
stefandevo:fix/initial-theme
Jan 18, 2026
Merged

fix: prevent new projects from overriding global theme setting#583
webdevcody merged 2 commits intoAutoMaker-Org:v0.13.0rcfrom
stefandevo:fix/initial-theme

Conversation

@stefandevo
Copy link
Copy Markdown
Collaborator

@stefandevo stefandevo commented Jan 18, 2026

Summary

Fixes an issue where newly created projects would always have their theme explicitly set, even when it matched the global theme. This caused:

  • "Use Global Theme" checkbox to be unchecked for new projects
  • Global theme changes not affecting these projects

Problem

Multiple call sites were calculating an effectiveTheme and passing it to upsertAndSetCurrentProject, which always stored it as project.theme. The design expects theme: undefined to mean "use global", but code never left it undefined.

Solution

  1. Store handles trashed project recovery - Moved theme recovery logic into app-store.ts's upsertAndSetCurrentProject action
  2. Callers no longer calculate theme - Simplified all call sites to just pass path and name
  3. Setup wizard clears project theme - theme-step.tsx now clears the project theme instead of setting it, ensuring "Use Global Theme" stays checked

Files Changed

File Change
app-store.ts Only set theme if explicitly provided or recovering from trash
use-project-creation.ts Remove theme prop, remove theme calculation, simplify calls
sidebar.tsx Remove theme calculation, simplify call
project-switcher.tsx Remove theme calculation, simplify call
welcome-view.tsx Remove theme calculation, simplify call
theme-step.tsx Clear project theme instead of setting it

Test Plan

  • Fresh start flow: Create new project during setup → "Use Global Theme" should be CHECKED
  • Global theme change: Change global theme → project should reflect the change
  • Trashed project recovery: Delete project, re-create at same path → original theme should be preserved
  • Manual override: Set project-specific theme → should work and "Use Global Theme" unchecked
  • Existing projects: Projects with explicit theme set should continue working

When creating new projects, the theme was always explicitly set even when
matching the global theme. This caused "Use Global Theme" to be unchecked,
preventing global theme changes from affecting the project.

Now theme is only set on new projects when explicitly provided or when
recovering a trashed project's theme preference.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 18, 2026

Warning

Rate limit exceeded

@stefandevo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 43 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 96202d4 and b6cb926.

📒 Files selected for processing (7)
  • apps/ui/src/components/layout/project-switcher/project-switcher.tsx
  • apps/ui/src/components/layout/sidebar.tsx
  • apps/ui/src/components/layout/sidebar/hooks/use-project-creation.ts
  • apps/ui/src/components/views/dashboard-view.tsx
  • apps/ui/src/components/views/setup-view/steps/theme-step.tsx
  • apps/ui/src/components/views/welcome-view.tsx
  • apps/ui/src/store/app-store.ts

Note

Other AI code review bot(s) detected

CodeRabbit 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @stefandevo, 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 delivers significant improvements to project theme management, ensuring new projects seamlessly inherit global theme settings. It also centralizes loading indicators for a more consistent user experience and refines data handling across different application modes. Key updates include robust GitHub PR state validation, a unified development data directory, and smarter settings synchronization, all contributing to a more stable and developer-friendly application.

Highlights

  • Theme Inheritance Fix for New Projects: Resolved an issue where newly created projects would explicitly set their theme, preventing them from inheriting global theme changes and causing the 'Use Global Theme' checkbox to be unchecked. The system now correctly leaves the project theme undefined by default, allowing it to fall back to the global setting.
  • Centralized Loading Spinner Component: Introduced a new Spinner component and replaced various Loader2 icons and custom loading indicators across numerous UI files. This standardizes the visual representation of loading states throughout the application, improving UI/UX consistency and maintainability.
  • Improved GitHub PR State Handling: Enhanced server-side logic for GitHub Pull Request (PR) states by introducing a new PRState type and validatePRState function. This ensures consistent and validated PR states (OPEN, MERGED, CLOSED) when interacting with external APIs like GitHub CLI, and allows for better detection of state changes.
  • Unified Data Directory for Development: Configured Electron in development mode to use a shared data directory at the project root (./data). This ensures that projects and settings are consistent and visible across both Electron and web development environments, streamlining the development workflow.
  • Refined Settings Migration and Sync Logic: Updated the settings migration and synchronization mechanisms to prioritize a local storage cache for fresh server settings, trigger immediate syncs when the projects array changes, and persist session tokens in web mode for improved authentication stability across page reloads.
  • Automatic Removal of Non-Existent Projects: The dashboard now automatically detects and removes projects from the list if their associated directory no longer exists on the filesystem, preventing broken links and improving user experience.
  • Standardized Test ID Sanitization: Implemented a new sanitizeForTestId utility function to create consistent and safe data-testid attributes for UI elements, enhancing the reliability and maintainability of automated tests.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively resolves the issue of new projects overriding the global theme setting by centralizing theme logic within the app-store. The solution is well-implemented, ensuring that new projects correctly inherit the global theme by default while preserving themes for recovered trashed projects.

Beyond the primary fix, this PR introduces several valuable improvements across the codebase:

  • A consistent, reusable Spinner component has been created and adopted throughout the UI, which greatly improves code maintainability and visual consistency.
  • Worktree and Pull Request types have been centralized in @automaker/types, enhancing type safety and code sharing between the server and UI.
  • The development environment has been significantly improved with unified data directories for Electron and web modes, and more robust session handling for web development.
  • Settings synchronization and migration logic has been made more resilient, preventing potential data loss.

Overall, this is an excellent and comprehensive update. I have one minor suggestion for cleanup.

Comment thread apps/server/src/index.ts
Missed this code path which is used when opening projects from the
dashboard after completing setup.
@stefandevo stefandevo changed the base branch from main to v0.13.0rc January 18, 2026 15:22
@stefandevo stefandevo marked this pull request as ready for review January 18, 2026 15:23
@webdevcody webdevcody merged commit 1c1d9d3 into AutoMaker-Org:v0.13.0rc Jan 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants