feat(studio): optimistic in-memory edits (near-instant canvas) + inspector round 4#77
Merged
Merged
Conversation
…-first - every edit applies to the in-memory model immediately (raw mutation via the pure setters, scenario rebuild through the loader pipeline — measured 492us release on a 44KB doc, no coalescing needed — fresh Arcs, generation bump) and nudges the rev signal directly: canvas updates in ~one render instead of ~300-550ms; the 250ms debounced disk write is unchanged (history/undo/write_error/saving intact); transiently-invalid edits leave the model untouched silently - self-write ledger: the watcher skips reloads whose content hash matches our last write (a correction: the disk reload could overwrite a newer in-memory state under continuous typing); external edits still reload; undo/redo note their write AND adopt the restored state in memory (failed adoption clears the note so the watcher takes over); annotation writes keep the watcher path - color picker: internal HSV mirror closes the selection loop locally — square/hue drags preview live and forward on_color_change per change (all usages covered: curated rows, ColorList, Fill); popover opens leftward (right-edge panel) and flips up when it would clip the window bottom - CONTENT section renders above PROPERTIES for text-family components - HTML sources gain an in-memory html_source for the optimistic retranspile; known pre-existing limit documented (two different fields in one debounce window: disk converges on next edit)
This was referenced Jul 19, 2026
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 #76.
Near-instant editing (user: "quasi-instantanéité"): every edit applies to the in-memory model immediately — raw mutation via the pure setters, scenario rebuild through the exact loader pipeline (measured 492µs release on a 44KB/360-element doc → no coalescing needed), fresh Arcs (prefetch #68 follows), generation bump, and a direct rev-signal nudge. Perceived latency: ~15-25ms (one render) instead of ~300-550ms. The 250ms debounced disk write is byte-for-byte unchanged (undo history, Saving flag, write_error). Transiently-invalid mid-typing edits leave the model untouched, silently.
Self-write skip (correctness, not just optimization): a ledger of written-content hashes lets the watcher skip reloading our own writes — the disk reload could otherwise overwrite a newer in-memory state under continuous typing. External edits (agents, editors) still reload. Undo/redo note their writes AND adopt the restored state in memory; a failed adoption clears the note so the watcher takes over. Annotation writes keep the watcher path.
Color picker fixes (live-testing feedback, diagnosed via the written file): the popover's square/hue drags now preview live and propagate per change — the selection loop is closed through a local HSV mirror, covering every usage (curated rows, ColorList, Fill) at once. The popover opens leftward (the inspector hugs the right edge) and flips upward when it would clip the window bottom.
Content first for text-family components.
Skipped with rationale: the optional "Not visible at this frame" hint — the inspector panel is deliberately memoized against frame changes (wave-1 design: controls keep focus during playback); doing it right needs an isolated sub-component subscribed to
currentalone. Proposed for a later round.Tests: 6 new (self-write decisions, optimistic rebuild + invalid-mutation safety, HTML retranspile, undo adoption flow, content-first ordering). 397 total, all green.
Verify:
cargo check -p rustmotion-studio✓ ·cargo test --workspace→ 397 passed ✓ ·cargo fmt --check✓ · clippy gated ≤1 ✓