メインコンテンツへスキップ

Canvas

This cluster is the universal specification of the Grida canvas editor — the interaction surface, selection, tools, precision aids, input, io, and the panels' behavioral contracts — written at spec altitude and implementation-agnostic. Any host — a web reducer, a native event loop, a headless agent — is the same editor if it conforms to these documents; it is not defined by mirroring another implementation's code.

This is the one home for these universal concepts. It points outward to the deep feature studies that each warrant their own pedantic treatment (history, realtime sync, vector networks, booleans, text editing), and inward to the reference implementation that binds these contracts to running code.

Doctrine

  1. Spec-first. A conforming implementation follows these documents; the documents never silently follow an implementation. When reality wins an argument, the spec is amended explicitly, in the same change.
  2. Headless-testable. Every behavioral claim must be assertable without a window or a human: drive the editor with commands and synthetic surface events; assert document/editor state (or pixels, via the rendering test infrastructure). A claim that cannot be tested headlessly is rewritten until it can.
  3. Verifiable contracts. Each document ends with numbered contract clauses (TGT-1, SNAP-3, IO-2, …). Conformance tests cite contract ids; the contract sections are the normative core, and prose exists to justify them.
  4. One home, no per-editor duplication. A universal concept lives here once. Two editors re-specifying selection or targeting under their own names is the smell this cluster exists to remove.

Concept map

Core

ConceptOne lineSpec
stateThe state domains (content, authoring context, view, interaction, collaboration) and the mutation vocabulary that is the only way to change the documentstate.md

Interaction

ConceptOne lineSpec
surfacePointer interaction on the canvas: hit-testing tiers, gestures, intents, chromesurface.md
selection & intentWhat selection feels like, and how pointer-down routes to intent (immediate vs deferred)ux-surface/
targetingPointer→node resolution mathematics: hit chains, graph-distance, descent, deep-select, marquee predicatesux-surface/targeting.md
selection partitionThe per-parent partition of a multi-node selection: N overlay boxes, and which commands act per-partition vs on the unionux-surface/selection-partition.md
edit modeThe exclusive nested-editing slot and its taxonomy: content modes (text, vector) vs paint sessionsedit-mode.md
toolThe authoring tool system: taxonomy, activation, insertion gestures, container adoptiontool.md
translateThe move gesture's structural models: clone-on-translate and live re-parentingtranslate.md

Structure

Commands that restructure the node tree. Each is a per-partition command — it acts once per selection partition, inserting one adopting parent per group.

ConceptOne lineSpec
groupingWrap a selection into a group or a container, per partition; ungroup as the inversegrouping.md
auto-layoutWrap-and-infer: convert a selection into a laid-out flex container, per partitionauto-layout.md
flattenCombine a selection's shapes into one baked vector, per partition (destructive)feat-vector-network/flatten.md
create outlinesConvert text to its glyph-outline vector paths, per node in place (font-baking)feat-vector-network/create-outlines.md
booleanNon-destructive path algebra: wrap a partition into one boolean-operation nodefeat-vector-network/boolean.md

Precision & chrome

ConceptOne lineSpec
snapGesture-time alignment: geometry, space, and pixel-grid snapping as interpretation stagessnap.md
measurementThe modifier-held spacing readout between the selection and the hovered nodemeasurement.md
rulerThe edge rulers and the persistent per-scene guides they authorruler.md
pixel gridThe unit lattice's visual render, split from snapping to itpixel-grid.md
transparency gridThe alpha backdrop at the bottom of the canvas stacktransparency-grid.md
alignAlign & distribute: the reference-frame rule and equal-gap distributionalign.md
nudgeThe arrow-key family: translate/resize nudge, in-flow reorder, empty-selection pannudge.md

Input

ConceptOne lineSpec
inputThe input pipeline, command vocabulary, keybinding model, and routing priorityinput.md
traversalKeyboard selection traversal: down/up the tree, across siblings, camera revealtraversal.md

IO

ConceptOne lineSpec
ioImport, export, and clipboard: files in, files out, fragments across instancesio.md
io — externalForeign content intake and outward flavors: drop matrix, paste sniffing, placement, trustio-external.md

Panels

ConceptOne lineSpec
hierarchyThe layers tree: presentation order, selection sync, drag semantics, virtualizationhierarchy.md

Deep studies (specified elsewhere, referenced here)

These concepts are technical enough to warrant their own dedicated, pedantic study. The canvas spec relies on them but does not restate them; the study is the source of truth, and this home points to it.

  • history — undo/redo as data, gesture framing, origin taxonomy: feat-history.
  • realtime sync (CRDT) — optimistic replication, authority order, presence: feat-crdt.
  • vector networks & the pen — network topology, projection, tangent mirroring, bending: feat-vector-network.
  • boolean path operations — non-destructive path algebra: feat-vector-network.
  • flatten — the destructive combine into one baked vector, the counterpart to boolean: feat-vector-network.
  • create outlines — text → its glyph-outline vector paths, per node in place: feat-vector-network.
  • text editing — the engine-level text model and geometry surface: feat-text-editing.

The reference implementation

The native reference editor (crates/grida_editor) implements this specification and carries its own implementation-binding specs — frame reconciliation, the application shell, the dev-only widget/UI layer, the inspector and layers panels, and the conformance harness — in its own docs, kept next to the code they bind. This spec stays code-agnostic; the crate owns the mapping from these contracts to running Rust.