Skip to content

feat(grida_editor): introduce the rust-native editor crate#945

Closed
softmarshmallow wants to merge 1 commit into
mainfrom
feat/grida-editor-paints
Closed

feat(grida_editor): introduce the rust-native editor crate#945
softmarshmallow wants to merge 1 commit into
mainfrom
feat/grida-editor-paints

Conversation

@softmarshmallow

@softmarshmallow softmarshmallow commented Jul 5, 2026

Copy link
Copy Markdown
Member

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-only grida engine.

See crates/grida_editor/README.md — it's doctrine, not documentation.

Why this crate exists

The legacy model was "replace the DOM with a wasm canvas, keep the JS core." @grida/canvas-wasm was 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 + math2 only, nothing depends on it; the core is feature-free and rendererless (ARCH-1), the windowed shell sits behind the shell feature. Each shipped concept is specced (RFC id) → implemented → conformance-tested.

  • Core — document + closed mutation vocabulary (invertible/serializable/atomic/validated), editor, history, sync (loopback CRDT), damage-ledger frame orchestration.
  • Interaction — surface, HUD (intent-in / mirror-out), tool + pen/vector-edit state machine, snap family, measurement, ruler + guides, pixel grid, transparency grid, translate.
  • Input — the normative keybinding sheet as data, routing, traversal, nudge.
  • Structure / features — align & distribute, flatten, grouping (partial), io + wire codec, context menu (menu-as-data + anchored presenter).
  • Panels & UI — the UI kernel/policy seam, widget atoms + composites (select, segmented, toggle, text, number, slider, swatch, color picker, quad, list section), the properties inspector, the hierarchy tree.
  • Shell — windowed app: canvas + panels, key routing through the binding table.

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 in crates/grida_editor/TODO.md.

Status

Spec container and pioneer (README §5). The RFC cluster under crates/grida_editor/docs is 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 fills paint-list domain (multiple fills; solid / gradient / image), replacing the old single-fill_solid special case — document patch domain (invertible/serializable/validated) → Binding::entry addressing + 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

cargo run  -p grida_editor --features shell   # the windowed shell
cargo test -p grida_editor                    # core conformance (headless, no renderer)
cargo test -p grida_editor --features shell   # full suite incl. raster probes

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.

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
backgrounds Building Building Preview, Comment Jul 5, 2026 7:52am
blog Building Building Preview, Comment Jul 5, 2026 7:52am
docs Ready Ready Preview, Comment Jul 5, 2026 7:52am
grida Building Building Preview, Comment Jul 5, 2026 7:52am
viewer Building Building Preview, Comment Jul 5, 2026 7:52am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
code Ignored Ignored Jul 5, 2026 7:52am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06ee43e1-e083-4551-995e-dfb42d56f9bc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/grida-editor-paints

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@softmarshmallow softmarshmallow changed the title feat(grida_editor): fills paint-list — multiple fills, solid/gradient/image feat(grida_editor): introduce the rust-native editor crate Jul 5, 2026
@softmarshmallow softmarshmallow deleted the feat/grida-editor-paints branch July 5, 2026 07:52
@softmarshmallow

Copy link
Copy Markdown
Member Author

Superseded by #946 — branch renamed feat/grida-editor-paintsfeat/grida-editor (the rename closed this one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant