Skip to content

Themes#16

Merged
krishna-santosh merged 16 commits into
mainfrom
themes
Jul 3, 2026
Merged

Themes#16
krishna-santosh merged 16 commits into
mainfrom
themes

Conversation

@krishna-santosh

@krishna-santosh krishna-santosh commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added expanded theme options, including new custom themes with a richer theme picker experience and color swatches.
    • Introduced an improved theme system that applies consistent, theme-scoped styling across the dashboard.
  • Bug Fixes

    • Updated Settings menu highlighting so it remains active for nested Settings routes.
    • Refined theme application so the correct theme styling is applied reliably when switching options.
  • Style / UI

    • Enhanced visuals (gradients, elevation/shadows, chrome, and interactive states) to better match the selected theme, including improved dark-mode behavior.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ee586f6c-060f-4f5e-9cac-2d7dc86b468c

📥 Commits

Reviewing files that changed from the base of the PR and between 93fe670 and 7575e21.

📒 Files selected for processing (1)
  • apps/dashboard/src/components/theme-toggle.tsx

📝 Walkthrough

Walkthrough

This PR adds custom dashboard themes, updates theme selection and application to handle them, expands theme-specific CSS and styling, and changes the sidebar Settings item to stay active on nested routes.

Changes

Custom Theme System

Layer / File(s) Summary
Theme type and application logic
apps/dashboard/src/components/theme-provider.tsx
Theme now includes custom theme literals; DARK_THEMES, LIGHT_THEMES, and CUSTOM_THEMES categorize theme keys; root class cleanup removes theme marker and custom classes; custom themes add theme-<key> plus theme-dark/theme-light.
Theme toggle dropdown UI
apps/dashboard/src/components/theme-toggle.tsx
The theme menu now renders from BASE_THEMES and NITRO_THEMES arrays, uses radio-group selection with useTheme(), and shows per-theme swatches.
CSS theme derivation and component styling
apps/dashboard/src/styles.css
Tailwind dark: now matches .theme-dark; new theme token derivation, palette classes, shared shadows, scoped component styling, and .theme-swatch-* gradient classes are added.
Sidebar settings active-state fix
apps/dashboard/src/components/sidebar/app-sidebar.tsx
Settings active state now matches pathname prefixes so nested settings routes stay active.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the changes but too generic to convey the main update. Use a more specific title like "Add custom dashboard themes and theme picker".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch themes

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/dashboard/src/components/theme-provider.tsx (1)

3-141: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Wire Sonner to the dashboard theme context apps/dashboard/src/components/ui/sonner.tsx still reads useTheme from next-themes, but apps/dashboard/src/main.tsx only provides the local ThemeProvider. Without a next-themes provider, the toaster will stay on the default/system theme instead of following the custom palettes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/components/theme-provider.tsx` around lines 3 - 141, The
Sonner toaster is still using the wrong theme source, so it won’t follow the
dashboard’s custom palette state. Update the theme wiring in the Sonner
component (the `sonner.tsx` `useTheme` usage) to consume the local
`ThemeProvider`/`useTheme` from `theme-provider.tsx` instead of `next-themes`.
Make sure the toaster reads the current `theme` value and maps custom themes
through the existing `DARK_THEMES` and `LIGHT_THEMES` handling so it stays in
sync with `ThemeProvider`.
🧹 Nitpick comments (4)
apps/dashboard/src/components/sidebar/app-sidebar.tsx (1)

133-133: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Consider boundary check to avoid matching sibling routes.

startsWith(settingsUrl) will also match any route with settingsUrl as a literal prefix (e.g. a hypothetical /sites/$id/settings-general route), not just nested paths. Given current routes, this is unlikely to cause an issue, but a trailing-slash check would be more robust.

💡 Optional boundary-safe check
-              isActive={pathname.startsWith(settingsUrl)}
+              isActive={pathname === settingsUrl || pathname.startsWith(`${settingsUrl}/`)}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/components/sidebar/app-sidebar.tsx` at line 133, The
active-state check in the app sidebar is too broad because
`pathname.startsWith(settingsUrl)` can match sibling routes that only share the
same prefix. Update the `isActive` logic in `app-sidebar` to use a boundary-safe
path check for `settingsUrl`, so it only matches the settings route and its
nested children; keep the change localized to the `isActive` prop where the
current `pathname.startsWith(settingsUrl)` is used.
apps/dashboard/src/styles.css (2)

93-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Comment understates the light-theme set.

This says .theme-light is for "Citrus Sherbet" only, but there are 6 light palettes (citrus-sherbet, desert-khaki, sunrise, hanami, cotton-candy, mint-apple), matching LIGHT_THEMES in theme-provider.tsx. Same drift as the dark-theme comment there — worth updating both together.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/styles.css` around lines 93 - 97, Update the theme
documentation comment in styles.css so `.theme-light` reflects all light
palettes, not just Citrus Sherbet; it should match the `LIGHT_THEMES` set used
by `ThemeProvider` in theme-provider.tsx. Also check the corresponding
dark-theme note in the same area and keep both comments aligned with the actual
palette lists so the marker-class behavior is described accurately.

9-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Custom-variant expansion is correct; Stylelint warning here is a known false positive.

@custom-variant is Tailwind v4 syntax that Stylelint's CSS parser doesn't recognize (scss/at-rule-no-unknown). Since this pattern already existed and is just being extended to include .theme-dark, consider adding @custom-variant to Stylelint's ignoreAtRules to silence this recurring false positive.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/styles.css` around lines 9 - 12, The `@custom-variant` in
`styles.css` is valid Tailwind v4 syntax, but Stylelint flags it as an unknown
at-rule. Update the Stylelint configuration to add `custom-variant` to
`ignoreAtRules` so the `dark` variant definition on `.theme-dark` is no longer
reported as a false positive. Keep the existing `@custom-variant dark` usage
unchanged and make the lint rule exemption apply globally.

Source: Linters/SAST tools

apps/dashboard/src/components/theme-provider.tsx (1)

88-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale comment: only lists a handful of the actual dark themes.

The block comment above DARK_THEMES/.theme-dark usage (and the mirrored comment in styles.css lines 93-97) says custom dark themes are "Crimson Moon, Sepia, Midnight Blurple, Forest, Dusk" but DARK_THEMES now contains 13 entries (also blurple-twilight, dusk, aurora, sunset, mars, retro-storm, under-the-sea, strawberry-lemonade, neon-nights). Worth updating the comment to avoid confusing future maintainers about which themes are dark vs. light.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/components/theme-provider.tsx` around lines 88 - 115,
Update the stale theme documentation in theme-provider so it matches the current
DARK_THEMES list and the mirrored note in styles.css. The comment around the
theme handling in theme-provider and the CSS comment should be revised to
mention all current dark themes, using the existing DARK_THEMES and theme-dark
usage as the source of truth, so maintainers are not misled by the outdated
short list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/dashboard/src/components/theme-toggle.tsx`:
- Around line 45-67: The theme selector is using a plain DropdownMenuItem with a
manual aria-checked state, but the checked behavior should be handled by radio
menu semantics. Update renderItem in theme-toggle.tsx to use
DropdownMenuRadioGroup with DropdownMenuRadioItem instead of DropdownMenuItem,
and move the selected state from aria-checked/onClick into the radio item’s
value/change handling while keeping the active styling and Check icon tied to
the current theme.

---

Outside diff comments:
In `@apps/dashboard/src/components/theme-provider.tsx`:
- Around line 3-141: The Sonner toaster is still using the wrong theme source,
so it won’t follow the dashboard’s custom palette state. Update the theme wiring
in the Sonner component (the `sonner.tsx` `useTheme` usage) to consume the local
`ThemeProvider`/`useTheme` from `theme-provider.tsx` instead of `next-themes`.
Make sure the toaster reads the current `theme` value and maps custom themes
through the existing `DARK_THEMES` and `LIGHT_THEMES` handling so it stays in
sync with `ThemeProvider`.

---

Nitpick comments:
In `@apps/dashboard/src/components/sidebar/app-sidebar.tsx`:
- Line 133: The active-state check in the app sidebar is too broad because
`pathname.startsWith(settingsUrl)` can match sibling routes that only share the
same prefix. Update the `isActive` logic in `app-sidebar` to use a boundary-safe
path check for `settingsUrl`, so it only matches the settings route and its
nested children; keep the change localized to the `isActive` prop where the
current `pathname.startsWith(settingsUrl)` is used.

In `@apps/dashboard/src/components/theme-provider.tsx`:
- Around line 88-115: Update the stale theme documentation in theme-provider so
it matches the current DARK_THEMES list and the mirrored note in styles.css. The
comment around the theme handling in theme-provider and the CSS comment should
be revised to mention all current dark themes, using the existing DARK_THEMES
and theme-dark usage as the source of truth, so maintainers are not misled by
the outdated short list.

In `@apps/dashboard/src/styles.css`:
- Around line 93-97: Update the theme documentation comment in styles.css so
`.theme-light` reflects all light palettes, not just Citrus Sherbet; it should
match the `LIGHT_THEMES` set used by `ThemeProvider` in theme-provider.tsx. Also
check the corresponding dark-theme note in the same area and keep both comments
aligned with the actual palette lists so the marker-class behavior is described
accurately.
- Around line 9-12: The `@custom-variant` in `styles.css` is valid Tailwind v4
syntax, but Stylelint flags it as an unknown at-rule. Update the Stylelint
configuration to add `custom-variant` to `ignoreAtRules` so the `dark` variant
definition on `.theme-dark` is no longer reported as a false positive. Keep the
existing `@custom-variant dark` usage unchanged and make the lint rule exemption
apply globally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 68162ea7-c3c2-46e7-b341-acaf161f7302

📥 Commits

Reviewing files that changed from the base of the PR and between 5e96162 and 93fe670.

📒 Files selected for processing (4)
  • apps/dashboard/src/components/sidebar/app-sidebar.tsx
  • apps/dashboard/src/components/theme-provider.tsx
  • apps/dashboard/src/components/theme-toggle.tsx
  • apps/dashboard/src/styles.css

Comment thread apps/dashboard/src/components/theme-toggle.tsx
@krishna-santosh krishna-santosh merged commit f146855 into main Jul 3, 2026
5 of 12 checks passed
@krishna-santosh krishna-santosh deleted the themes branch July 3, 2026 04:45
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.

1 participant