feat: add dark mode support#5
Open
aidandaly24 wants to merge 10 commits intomainfrom
Open
Conversation
- Add light and dark color palettes - Add system color scheme detection - Add theme preference types (light/dark/system) - Maintain backward compatibility with existing color exports
- Create ThemeProvider component for wrapping the app - Add useTheme hook for accessing theme colors - Support light/dark/system theme preferences - Memoize context values for performance
- Add ThemeProvider to App component - Theme context is now available throughout the app
- Test useTheme hook behavior - Test theme preference changes - Test system color scheme detection - Test color palette structure
- Use ink-testing-library render for component tests - Test ThemeProvider with different initial preferences - Test theme utility functions - Test system color scheme detection
Coverage Report
|
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
This PR adds dark mode support to the CLI dashboard as requested in #2.
Changes
New Features
LIGHT_PALETTEandDARK_PALETTEwith semantic color definitions for status, interactive, text, and border colorsCOLORFGBG,COLOR_SCHEME)light,dark, orsystemFiles Modified
src/cli/tui/theme.ts- Expanded with light/dark palettes and detection utilitiessrc/cli/tui/context/ThemeContext.tsx- New file for theme context and providersrc/cli/tui/context/index.ts- Export new theme contextsrc/cli/tui/App.tsx- Wrapped app with ThemeProvidersrc/cli/tui/context/__tests__/ThemeContext.test.tsx- Comprehensive testsUsage
Components can now use the
useThemehook to access theme-aware colors:Backward Compatibility
The existing
STATUS_COLORS,INTERACTIVE_COLORS,TEXT_COLORS, andTHEMEexports are preserved (marked as deprecated) to allow gradual migration of existing components.Testing
Added comprehensive tests for:
Closes #2