feat(ui): add undo, json import and export, and the raw editor #34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/m7-authoring"
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?
Summary
Test plan
pnpm test- 556 pass, including the milestone exit gate: export a template, reimport it into a clean profile, get the same sheetpnpm lint,npx tsc --noEmit,pnpm buildcleancloses #22
closes #23
Review findings from
/code-review medium, all three fixed in6874937,5712ec4and57dc5ad.Import raced a concurrent edit.
importFileread the file across an await and then built the import on the library the render that started it had captured, so an edit committed while the file was being read was reverted in memory and overwritten in storage.useLibrary'scommitnow takes the change as a function of the library as it stands.Rename bypassed the undo stack.
renamewent straight toupdate, sorecordnever saw it: an undo aimed at the edit before a rename took the rename back with it, and a rename on its own was not undoable at all. It moved touseEditorand commits through the same gate as every other edit, with a no-op when the name is unchanged so the blur after an Enter is not a second entry.The name field lost focus on Enter. Keying it on the name remounted the input as the rename it had just committed landed. It reseeds on the name instead, the way the JSON editor does, and is still keyed on the template id so a switch drops a half-typed draft.
Four tests added, each of which fails without its fix.
pnpm test560 pass,pnpm lint,npx tsc --noEmitandpnpm buildclean.