fix: theme toggle label, session stability #1408#1411
fix: theme toggle label, session stability #1408#1411Sompalkar wants to merge 3 commits intoMail-0:stagingfrom
Conversation
WalkthroughThe changes refine session and user ID checks across multiple components and hooks, ensuring actions are only performed if a valid user ID exists in the session. Additionally, the theme toggle UI text in the navigation user menu is updated to dynamically display "Light Theme" or "Dark Theme" based on the current theme. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NavUserComponent
participant ThemeManager
User->>NavUserComponent: Clicks theme toggle
NavUserComponent->>ThemeManager: Get current theme
ThemeManager-->>NavUserComponent: Returns 'dark' or 'light'
NavUserComponent-->>User: Displays "Light Theme" or "Dark Theme"
sequenceDiagram
participant User
participant Component
participant AuthProvider
User->>Component: Initiates action (e.g., upgrade, navigate)
Component->>Component: Check session?.user?.id
alt user id exists
Component->>Component: Proceed with action (navigate/upgrade)
else user id missing
Component->>AuthProvider: Trigger Google sign-in with callback
end
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
You have two open PRs with similar changes |
Description:
🎨 UI Improvement – Theme Toggle (Fixes #1408)
Previously, the theme toggle button just said "App Theme", which wasn’t very informative.
Now, it dynamically updates to show "Light Theme" or "Dark Theme", depending on what’s currently active.

This small change makes it much clearer what clicking the button will do — a simple win for user experience.
🛠️ Session Stability Fixes
There were some issues where the app would crash or behave oddly if the session wasn’t available yet — especially noticeable on first load or when the user was logged out.
To fix this, I’ve added optional chaining (?.) throughout the code to safely access session data.
This change touches several key parts of the app, like:
use-settings.ts
client-providers.tsx
use-drafts.ts
create-email.tsx
Pricing pages
These updates make the app much more resilient and prevent unexpected crashes due to missing session data.
🖥️ Windows CLI Compatibility – sync Command Fix
Running pnpm nizzy sync on Windows was throwing spawn pnpm ENOENT errors.
Turns out, Node’s child_process.spawn doesn’t use the system shell by default, and on Windows, tools like pnpm and npx need it to resolve properly (since they’re .cmd files).
Updated the runCommand utility in packages/cli/src/utils.ts to use { shell: true }.
Now, it works seamlessly on Windows and other platforms without error.
Summary by CodeRabbit