Commit 07485b3
committed
🤖 Remove coupling with usePersistedState internals
Address PR feedback: instead of manually duplicating localStorage write
and event dispatch logic, use a new utility function updatePersistedState()
that encapsulates this behavior.
Changes:
- Add updatePersistedState() utility to usePersistedState.ts
- Enable listener in ThinkingProvider to pick up external changes
- Remove setThinkingLevel() call from ChatInput toast handler
- Rename event to cmux:thinkingLevelToast to clarify it's UI-only
- Use updatePersistedState() in App.tsx instead of manual duplication
This eliminates coupling between App.tsx and usePersistedState internals
while maintaining the same functionality.
Change-Id: Iee36b05db11d5e39740f31071fffb9a0e2cbb7e5
Signed-off-by: Thomas Kosiewski <tk@coder.com>1 parent 3299c56 commit 07485b3
File tree
4 files changed
+46
-25
lines changed- src
- components
- contexts
- hooks
4 files changed
+46
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
314 | 306 | | |
315 | 307 | | |
316 | | - | |
317 | | - | |
| 308 | + | |
| 309 | + | |
318 | 310 | | |
319 | 311 | | |
320 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
457 | | - | |
458 | 456 | | |
459 | 457 | | |
460 | 458 | | |
| |||
469 | 467 | | |
470 | 468 | | |
471 | 469 | | |
472 | | - | |
473 | | - | |
474 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
475 | 473 | | |
476 | 474 | | |
477 | 475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
6 | 36 | | |
7 | 37 | | |
8 | 38 | | |
| |||
0 commit comments