Open
Conversation
- Add ThemeContext with localStorage persistence (defaults to dark) - Enable Tailwind class-based dark mode strategy - Add dark: variants to all components for proper light mode styling - Add ThemeToggle button (sun/moon icon) in SettingsBar and session page - Wire ThemeProvider into root layout
There was a problem hiding this comment.
1 issue found across 15 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/app/layout.tsx">
<violation number="1" location="src/app/layout.tsx:24">
P2: Hard-coding `className="dark"` on `<html>` forces an incorrect initial theme for users who previously selected light mode, causing a dark-to-light flash after hydration.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| return ( | ||
| <html lang="en"> | ||
| <html lang="en" className="dark"> |
There was a problem hiding this comment.
P2: Hard-coding className="dark" on <html> forces an incorrect initial theme for users who previously selected light mode, causing a dark-to-light flash after hydration.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/app/layout.tsx, line 24:
<comment>Hard-coding `className="dark"` on `<html>` forces an incorrect initial theme for users who previously selected light mode, causing a dark-to-light flash after hydration.</comment>
<file context>
@@ -20,10 +21,12 @@ export default function RootLayout({
return (
- <html lang="en">
+ <html lang="en" className="dark">
<body className="min-h-screen">
<QueryClientProvider client={queryClient}>
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
localStorageand defaults to dark mode, preserving the existing lookdark:variants for proper light mode stylingChanges
tailwind.config.tsdarkMode: "class"strategysrc/context/theme-context.tsxThemeProvider+useThemehook with localStorage persistencesrc/components/theme-toggle.tsxThemeTogglebutton component (sun/moon icons from lucide)src/app/layout.tsxThemeProvider, setclass="dark"on<html>by defaultsrc/app/globals.cssdark:body stylesdark:Tailwind variants alongside light mode base colorsScreenshots
Dark mode (default):
The existing dark UI is fully preserved -- no visual changes when the toggle is set to dark.
Light mode:
Clean light theme with white/zinc-100 backgrounds, proper contrast, and matching borders/text colors.
Summary by cubic
Adds a light/dark theme toggle (sun/moon) in the settings bar and session header. Introduces a ThemeProvider with localStorage persistence, enables Tailwind darkMode: class, sets the html element to dark by default, and updates component styles for proper light mode.
Written for commit 57ed918. Summary will update on new commits.