Commit 2d2de6c
fix: Fix system theme toggle in Sidebar (#224)
* conductor-checkpoint-start
* feat(sidebar): add system theme option to sidebar theme toggle
Enhance the theme toggle functionality in the sidebar to support cycling through all three theme modes:
light → dark → system → light, instead of just alternating between light and dark.
- Add Monitor icon from lucide-react for system theme display
- Update click handler to cycle through ThemeMode.light, ThemeMode.dark, and ThemeMode.system
- Update icon rendering logic to show Monitor icon when system theme is active
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* conductor-checkpoint-msg_2025101919535727204b0a6f3c438c
* conductor-checkpoint-msg_20251019195555b541a7966005447a
* fix(sidebar): use settedTheme for theme switching logic
Fix the theme switching functionality when in system mode by using settedTheme
instead of actualTheme for state comparison and icon display.
- Use settedTheme to determine current theme mode for switching logic
- Use settedTheme to display correct icon (Sun/Moon/Monitor)
- Keep theme prop for Icon component styling (actual theme appearance)
- Update tooltip to show settedTheme label instead of actualTheme
Resolves issue where theme switching was stuck after selecting system theme.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(sidebar): update lucide-react icon imports to use direct exports
* refactor(sidebar): replace theme switching if/else with array-based cycle
Replace verbose three-branch if/else structure with a simple array-based
cycle mechanism. This eliminates branching logic, centralizes the theme
sequence, and makes the code easier to test and maintain.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(sidebar): rename theme prop to $resolvedTheme to avoid conflicts
- rename styled component prop from 'theme' to '$resolvedTheme' to prevent naming conflicts
- update all Icon component usages to use the new prop name
- maintain same functionality while improving prop naming clarity
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d87a723 commit 2d2de6c
1 file changed
Lines changed: 27 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| |||
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
37 | | - | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
86 | | - | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | | - | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| |||
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
115 | | - | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
| |||
160 | 170 | | |
161 | 171 | | |
162 | 172 | | |
163 | | - | |
| 173 | + | |
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
| |||
171 | 181 | | |
172 | 182 | | |
173 | 183 | | |
174 | | - | |
175 | | - | |
| 184 | + | |
| 185 | + | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
| |||
195 | 205 | | |
196 | 206 | | |
197 | 207 | | |
198 | | - | |
199 | | - | |
| 208 | + | |
| 209 | + | |
200 | 210 | | |
201 | 211 | | |
202 | 212 | | |
| |||
0 commit comments