feat(studio): undo/redo and dirty-state indicator#38
Merged
Conversation
- History: bounded (64) undo/redo stacks of whole-file snapshots (uniform for JSON and HTML sources), captured on effective disk writes only (post-debounce; no-op writes excluded); new edits clear the redo stack - App-global slot survives watcher reloads (the model is replaced, the slot is not); lazy reset on file switch; reloads never push - Undo/redo rewrite the source file and let the watcher reload; a failed write rolls the stacks back exactly and surfaces write_error - Cmd/Ctrl+Z and Shift+Cmd/Ctrl+Z at the StudioApp root; the inspector subtree stops propagation so text fields keep their native undo; topbar gains Undo/Redo buttons and a Saving indicator
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #14.
Goal: studio edits become recoverable and unsaved state visible.
perform_writenow reports whether it wrote); JSON annotation writes join the linear history; new edits clear redoTests: 8 new (TDD): cap/eviction, redo invalidation, empty-stack no-ops, roundtrip, path-switch reset, plus model-level integration on temp files (undo rewrites file, redo restores). 198 total, all green.
Verify:
cargo check -p rustmotion-studio✓ ·cargo test --workspace→ 198 passed ✓ ·cargo fmt --check✓ · clippy 0 warnings ✓