Commit 6fca142
fix(sandboxes): stop create mode surviving a return to an open sandbox
Cursor Bugbot. Create mode and having a sandbox open are mutually exclusive, but
nothing enforced it, so both could be set at once — and the screen then lied about
which sandbox its Delete pointed at.
With `isCreating` true and `selectedId` restored, `baseline` is null, so the editor
renders an empty "New sandbox" form, while the Delete action is built from
`selected` and still targets the restored sandbox. An admin looking at a blank
create form could delete a sandbox it never named.
Two ways in, both closed:
- Browser Forward after starting a new sandbox restores `selectedId` without going
through `closeEditor`. The render-time sync that already drops a stale draft now
also leaves create mode, which is the same class of correction and the reason
that block exists.
- "New sandbox" set `isCreating` without clearing `selectedId`, so the same
contradiction was reachable without touching history at all. It now clears the
selection, with `history: 'replace'` because switching mode is not a destination.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 4170319 commit 6fca142
1 file changed
Lines changed: 8 additions & 0 deletions
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
260 | 265 | | |
261 | 266 | | |
262 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
| |||
0 commit comments