Commit ef0d092
authored
## Summary
- The `useEffect` in `View.tsx` that synced
`renderSettings.showSimulationBox` with `embedConfig.showSimulationBox`
lacked an `isEmbeddedMode` guard
- Since `embedConfig.showSimulationBox` defaults to `true`, any user
toggle of the checkbox was immediately overwritten back to `true`,
making it appear permanently enabled and unclickable
- Fix: added `isEmbeddedMode &&` condition so the sync only runs when
actually in embedded mode
## Behavior after fix
- **Non-embedded mode**: checkbox is freely toggleable as expected
- **Embedded mode**: `embedConfig.showSimulationBox` (from URL params)
continues to override the setting, preserving existing behavior
## Test plan
- [ ] Open the app in normal (non-embedded) mode → verify the "Show
simulation box" checkbox in Settings can be checked/unchecked
- [ ] Open the app in embedded mode with `showSimulationBox=false` in
the URL config → verify the box is hidden and the setting is locked to
`false`
- [ ] Open the app in embedded mode with no explicit `showSimulationBox`
config (defaults to `true`) → verify the box is shown
- [ ] `npm run build` passes with no errors ✅
Closes #308
🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
412 | 415 | | |
413 | 416 | | |
414 | | - | |
| 417 | + | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
| |||
0 commit comments