Commit 684397e
feat(tui): add theme system with 3 built-in themes (#299)
* feat: add theme TOML files and hex color parser
- Create 3 built-in themes: phosphor, tokyo-night, catppuccin-latte
- Add parse_hex_color() utility for #RRGGBB and #RGB formats
- All themes have 17 required color fields in TOML format
- phosphor.toml matches existing Theme::phosphor() RGB values
Tasks: #2 (TOML files) + #3 (hex parser) from theme-system plan
* feat(tui): add ThemeColor newtype with Serde support
- Add ThemeColor(Color) newtype wrapper for serialization
- Implement Serialize/Deserialize for hex color format
- Update all 17 Theme struct fields to use ThemeColor
- Fix all downstream usage sites with explicit derefs (*)
- Enable TOML-based theme loading (Task 1 complete)
All 399 type errors resolved. Build passes with zero errors.
Part of theme system implementation (Issue #295).
* feat(tui): apply theme changes immediately in settings view
Wire immediate theme application when user changes theme in settings:
- Add pending_theme_change tracking in SettingsView
- Add take_pending_theme_change() accessor in SettingsView
- Check for pending theme in home/input.rs SettingsAction::Continue
- Return Action::SetTheme(name) to apply immediately via app.rs
- Add Action::SetTheme handler to handle_mouse() for consistency
Theme now updates visually in real-time instead of on settings close.
Verified:
- OPENSSL_NO_VENDOR=1 cargo check: 0 errors
- cargo clippy: 0 warnings
- OPENSSL_NO_VENDOR=1 cargo test --lib: 641 passed
* fix(tui): add Theme category to settings view
Discovered during F3 TUI QA: SettingsCategory::Theme was defined but
not included in the categories vector. Theme now appears as first
category in Settings.
* test: add merge_configs tests for theme override
Adds two tests to match the pattern used for other config types:
- test_merge_configs_with_theme_override: verifies profile override applies
- test_merge_configs_theme_inherits_when_not_overridden: verifies global inherits
* feat(themes): add tokyo-night-storm theme
Add darker Tokyo Night variant with official Storm palette colors:
- Background: #24283b (vs #1a1b26 in regular tokyo-night)
- Border: #414868 (Terminal Black)
- Selection: #364a82
All semantic colors (running, waiting, error, idle) match tokyo-night.
* fix: dereference ThemeColor in dialog styles
* chore: remove .sisyphus from tracking
* docs: add theme config section
* chore: remove .sisyphus from tracking
* fix: address PR review feedback
- Use let-else pattern for ThemeColor::Serialize invariant
- Read theme directly from field value instead of config
- Remove comments from tokyo-night-storm.toml for consistency
* refactor: remove ThemeColor wrapper, use native ratatui Color serde
- Enable ratatui 'serde' feature for native Color deserialization
- Delete ThemeColor newtype and color.rs module
- Add semantic color fields to Theme (diff_*, branch, sandbox, worktree_*)
- Update all 4 theme TOML files with official palette colors
- Verify all TUI primitives use theme colors (no hardcoded Color::)
* feat(themes): add diff_modified and help_key semantic colors
- Add diff_modified for FileStatus::Modified (yellow)
- Add help_key for keyboard shortcuts in help panels (yellow)
- Preserves original phosphor Color::Yellow mapping
- Uses palette-correct yellow for tokyo-night/catppuccin
* cleanup
---------
Co-authored-by: njbrake <njbrake@gmail.com>1 parent dd9bbad commit 684397e
13 files changed
Lines changed: 351 additions & 28 deletions
File tree
- docs/guides
- src
- session
- tui
- components
- dialogs/new_session
- diff
- home
- settings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
706 | 729 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
304 | 317 | | |
305 | 318 | | |
306 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
307 | 323 | | |
308 | 324 | | |
309 | 325 | | |
| |||
333 | 349 | | |
334 | 350 | | |
335 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
336 | 355 | | |
337 | 356 | | |
338 | 357 | | |
| |||
542 | 561 | | |
543 | 562 | | |
544 | 563 | | |
| 564 | + | |
545 | 565 | | |
546 | 566 | | |
547 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| |||
239 | 245 | | |
240 | 246 | | |
241 | 247 | | |
242 | | - | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
247 | | - | |
248 | | - | |
| 253 | + | |
| 254 | + | |
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
| |||
330 | 336 | | |
331 | 337 | | |
332 | 338 | | |
333 | | - | |
| 339 | + | |
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
| |||
495 | 501 | | |
496 | 502 | | |
497 | 503 | | |
498 | | - | |
| 504 | + | |
499 | 505 | | |
500 | 506 | | |
501 | 507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
| |||
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
48 | 59 | | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
52 | 72 | | |
53 | 73 | | |
54 | 74 | | |
| |||
61 | 81 | | |
62 | 82 | | |
63 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
64 | 87 | | |
65 | 88 | | |
66 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
0 commit comments