feat(theme): swap next-themes for better-themes provider#24
Conversation
Greptile OverviewGreptile SummaryThis PR migrates the theme management system from Key Changes
API CompatibilityThe migration maintains full compatibility with existing usage:
Issues FoundTwo documentation inconsistencies where "next-themes" is still referenced instead of "better-themes":
These are non-critical style issues but should be corrected for consistency. Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant App as Application
participant Root as __root.tsx
participant TP as ThemeProvider
participant BT as better-themes
participant TT as ThemeToggle
participant Router as TanStack Router
App->>Root: Initialize app
Root->>TP: Mount with props<br/>(attribute, defaultTheme, etc.)
TP->>BT: Forward props to better-themes
BT->>BT: Initialize theme system<br/>Read from localStorage/system
BT-->>Root: Render children with theme context
Root->>TT: Render ThemeToggle
TT->>Router: useHydrated()
Router-->>TT: Return hydration status
alt Not Hydrated
TT-->>Root: Show disabled toggle (Sun icon)
else Hydrated
TT->>BT: useTheme() hook
BT-->>TT: Return { theme, setTheme }
TT-->>Root: Show interactive toggle
Note over TT,Root: User clicks toggle
TT->>BT: setTheme(newTheme)
BT->>BT: Update theme in context<br/>Save to localStorage
BT->>Root: Trigger re-render with new theme
Root-->>App: Apply new theme class to HTML
end
|
Additional Comments (2)
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/routes/index.tsx
Line: 76:76
Comment:
The description text still references "next-themes" but the codebase has been migrated to "better-themes". This should be updated for consistency.
```suggestion
<p className="text-muted-foreground text-sm">Seamless theme switching with better-themes</p>
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: README.md
Line: 28:28
Comment:
The README still references "next-themes" in the features section. This should be updated to reflect the migration to "better-themes".
```suggestion
- **🎨 Dark/Light Mode** — Theme switching with `better-themes` and CSS variables
```
How can I resolve this? If you propose a fix, please make it concise. |
Update documentation and UI copy to reflect replacement of next-themes with better-themes for dark/light mode handling. Change README and the feature description in the home route so displayed text and docs stay consistent with the codebase's chosen theming library. This clarifies the actual dependency and avoids confusing references to next-themes.
No description provided.