Commit f021e9f
committed
fix(settings): reasoning depth UI now reflects the picked value
Two bugs in one small control:
1. The <select> was bound directly to the `value` prop from the
parent, and the parent never knew a save happened (onUpdated was
a no-op stub), so after clicking a new level the dropdown snapped
right back to the old one.
2. Even if the parent HAD re-fetched, we'd still show a flash of
stale state during the IPC round-trip — not great.
Fix: local controlled state with optimistic update. The select tracks
its own `current` initialized from the prop and kept in sync via
useEffect. On change we set current immediately, kick off the IPC,
and roll back only if the save fails AND no newer pick is in flight.
The refreshed row is now actually bubbled to ProvidersList via a new
onRowChanged callback so the canonical rows list stays fresh.
- Settings.tsx: ReasoningDepthSelector uses setState + saveSeq guard
- ProviderCard gains onRowChanged prop, wired through from ProvidersList1 parent a5b737f commit f021e9f
1 file changed
Lines changed: 22 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
| 262 | + | |
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
| |||
359 | 361 | | |
360 | 362 | | |
361 | 363 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 364 | + | |
368 | 365 | | |
369 | 366 | | |
370 | 367 | | |
| |||
470 | 467 | | |
471 | 468 | | |
472 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
473 | 479 | | |
474 | 480 | | |
475 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
476 | 485 | | |
477 | 486 | | |
478 | 487 | | |
| |||
486 | 495 | | |
487 | 496 | | |
488 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
489 | 501 | | |
490 | 502 | | |
491 | 503 | | |
492 | 504 | | |
493 | 505 | | |
494 | 506 | | |
495 | | - | |
| 507 | + | |
496 | 508 | | |
497 | 509 | | |
498 | 510 | | |
499 | | - | |
500 | 511 | | |
501 | 512 | | |
502 | 513 | | |
| |||
799 | 810 | | |
800 | 811 | | |
801 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
802 | 816 | | |
803 | 817 | | |
804 | 818 | | |
| |||
0 commit comments