feat(grida_editor): introduce the rust-native editor crate#945
feat(grida_editor): introduce the rust-native editor crate#945softmarshmallow wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #946 — branch renamed |
Introduces
crates/grida_editor— the Rust-native Grida editor: document working copy, invertible mutations, history, interaction — all editor plumbing — built from scratch as the reference implementation of the universal canvas spec, on the read-onlygridaengine.Why this crate exists
The legacy model was "replace the DOM with a wasm canvas, keep the JS core."
@grida/canvas-wasmwas a stateless renderer; JS owned all scene state and flushed it across. It worked — until it didn't. It died of split ownership (state in JS, capability in Rust — the text editor), sync-as-architecture (mutate → sync → query → update was the architecture), a write path bolted on late, and death by accretion. The failure was architectural, not incidental.This crate answers that with six laws that are the merge bar (README §2): one owner per concern · data flows one way · the write path is first-class · one module/one concept/one golden contract · "it works" is not an argument · prototypes retire, specs carry.
What's in the box
An island: depends on
grida+math2only, nothing depends on it; the core is feature-free and rendererless (ARCH-1), the windowed shell sits behind theshellfeature. Each shipped concept is specced (RFC id) → implemented → conformance-tested.Suite: 396 tests green (core) / 406 under
--features shell, across 26 contract suites plus a shell-gated raster suite. Every contract test cites its RFC id (harness.md); the per-concept status ledger and remaining gaps live incrates/grida_editor/TODO.md.Status
Spec container and pioneer (README §5). The RFC cluster under
crates/grida_editor/docsis normative; this crate is its executable form. It is not a product yet — the UI is deliberately crude, the engine is read-only from here — and wasm shipping stays frozen until this rebuild can swap in as v2. Milestones M1–M4 (core → canvas → panels → the two-instance concurrent-authoring deliverable) are tracked in the TODO.Recent work included here
The Fills properties section landed as part of this branch: the general
fillspaint-list domain (multiple fills; solid / gradient / image), replacing the old single-fill_solidspecial case — document patch domain (invertible/serializable/validated) →Binding::entryaddressing + bind-owned list resolvers (ARCH-3) → paint rows assembled from atoms →tests/paint_contracts.rs. Strokes are the next slice reusing the same machinery.Running & testing
Draft: large introductory diff (~50k lines, the crate authored fast and not yet fully reviewed — README §3 treats its own code as the first suspect). Opened to continue across machines.