feat: add --theme CLI option for custom color schemes#217
Conversation
Add support for loading custom color themes from JSON files at runtime. Changes: - Add --theme <filename> CLI flag to argument parsing - Create theme file loader with JSON parsing and hex color validation - Implement deep merge for partial theme overrides (fallback to defaults) - Make colors object runtime-configurable while maintaining type safety - Wire theme initialization into TUI startup (before components render) - Add comprehensive unit tests for loader, validator, and merge functions - Include bundled themes: bright-theme.json, high-contrast-theme.json - Document --theme option in README with example screenshot Usage: ralph-tui run --theme ./assets/themes/high-contrast-theme.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
@esumerfield is attempting to deploy a commit to the plgeek Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds JSON-driven theming: new theme assets, a runtime theming core with load/validate/merge/apply functions and a Proxy-backed active colors object, CLI Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as Command Line<br/>(src/commands/run.tsx)
participant ThemeSys as Theme System<br/>(src/tui/theme.ts)
participant FS as File System
participant TUI as TUI Components
User->>CLI: ralph run --theme ./path/theme.json
CLI->>CLI: parse args, extract themePath
CLI->>ThemeSys: initializeTheme(themePath)
ThemeSys->>FS: read theme JSON file
FS-->>ThemeSys: return JSON
ThemeSys->>ThemeSys: parse, validate hex colours
ThemeSys->>ThemeSys: merge partial theme with defaults
ThemeSys->>ThemeSys: update activeColors (Proxy)
ThemeSys-->>CLI: initialization success
CLI->>TUI: start/render UI
TUI->>ThemeSys: access colors proxy
ThemeSys-->>TUI: provide active colours
TUI-->>User: render themed interface
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
|
@esumerfd mind adding a couple of screenshots to the PR? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #217 +/- ##
==========================================
+ Coverage 44.93% 45.04% +0.10%
==========================================
Files 84 84
Lines 24486 24596 +110
==========================================
+ Hits 11004 11079 +75
- Misses 13482 13517 +35
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@esumerfd Thanks - looks good - but before i merge can you please
Thanks! |
feat: add --theme CLI option for custom color schemes
Add support for loading custom color themes from JSON files at runtime.
Changes:
Usage:
ralph-tui run --theme ./assets/themes/high-contrast-theme.json
Screenshots
Custom Theme Example:
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.