Editor's session restore (per #161) restores the editor's state from sessionStorage, but the gallery designs list is in localStorage — user with a stale localStorage (e.g., cleared it) gets a 'design not found' error in the editor with no graceful re… #309
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#309
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
The editor reads the design from
tc_workspace_snapshot(sessionStorage). The Gallery's designs are inlocalStorage.designs(per #148). If the user:grep -rn 'design.*not.*found\|handleMissingDesign' src/pages/Editor.tsxreturns 0. The editor doesn't handle the case where the design's data is incomplete or the loadedDesignId points to a non-existent design.A user with a stale localStorage:
The fix is a graceful recovery: detect the missing design and either re-save as a new design, or warn the user.
Where
src/pages/Editor.tsx:handleSave(line 832)src/pages/Editor.tsx:loadInitialFilenameetc.localStorage.getItem('designs')grep -rn 'design.*not.*found' src/pages/Editor.tsxreturns 0Suggested fix shape
Detect: when loading, check if
loadedDesignIdRef.currentmatches a design in the Gallery. If not, log a warning and treat as a new design.Save flow: when saving with a
loadedDesignIdthat doesn't exist in the Gallery:Auto-save: the session restore (per #161) auto-saves to sessionStorage. If the user closes the editor and reopens later, the design is still there. The recovery is only needed if the Gallery's localStorage is cleared.
Edge case: if the user has a different browser profile, the Gallery's localStorage is per-profile, but sessionStorage is also per-profile. The mismatch is rare but possible.
Severity
Low. The user can re-save. Edge case.
Discovered by
Code review (2026-10-02) of editor save flow.
Related
Shipped in
fa03760(bundled with #308 multi-document tabs) +194fd2f(test).Editor.handleSave now intercepts the case where
loadedDesignIdpoints at a row no longer present in localStorage and opens a confirmation modal instead of silently creating a fresh row via saveDesignToGallery's addDesign fallback.Modal affordances:
Also noted in the issue: the original "save fails with a generic error toast" claim was inaccurate — saveDesignToGallery already fell through to addDesign. The actual UX problem was the silent fall-through (user thought they'd update an existing row but got a brand-new one). The modal makes the recovery explicit.