Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.

Document faces and gesture commits through the plugin API (0.1.0-canary.16) - #6

Merged
drietsch merged 2 commits into
mainfrom
fix/font-door
Oct 14, 2026
Merged

drietsch merged 2 commits into
mainfrom
fix/font-door

Conversation

@drietsch

Copy link
Copy Markdown
Contributor

Moves paged.web off its two host.editor escape hatches onto the doors plugin SDK 0.2.55-canary.0 added for them (plugin-sdk #15, ADR 327 / ADR 328), and releases 0.1.0-canary.16.

Document faces (document-faces.ts)

The bake gave the document the faces its text names (ADR 411, amendment 2026-10-12) by sending the engine's registerFont with scope: "document" through the editor client. It now calls host.assets.registerDocumentFont (assets.documentFont@1), which fills a gap and never replaces a face the document holds. A family the document holds is still not offered at all; a refused face is reported as a problem; on a host without the door a missing family is reported as drawn in a substitute. Capabilities are probed lazily, so the 200-run bake keeps its 208 door calls.

Gesture commits (document-edited.ts, removed)

document.onDidChange now reports a canvas gesture's commit and a script run, so the auto renderer and the panel's preview size follow that event alone. Every change except an undo/redo counts as an edit (may grow a frame).

Pins

@paged-media/plugin-api / plugin-sdk devDependencies → 0.2.55-canary.0, peer floor >=0.2.55-canary.0 (the bundle relies on the gesture events). Peers stay peers.

Tests (each failed before the change)

  • conformance/bake-faces.spec.ts — a bake on a host whose host.editor throws still gives the document its face (old code: no registration, a "drawn in a substitute" problem).
  • auto-render.spec.ts — gesture commit / script run via the door re-render; the raw broadcast is ignored; no extra raw subscription (old code failed 3 cases).
  • panel-reach.spec.tsx — preview follows a gesture commit and a script run; the fixture host has no editor handle.
  • conformance/auto-render.spec.ts — the real-engine resize gesture re-renders (and its undo) without the test's own broadcast wrapper.

Locally: contract-import lint, pnpm -r typecheck, REQUIRE_REAL_ENGINE=1 pnpm -r test (web-model 290, web-conformance 103, web-bundle 336), package-hash --check. No Rust changes.

🤖 Generated with Claude Code

drietsch and others added 2 commits October 14, 2026 10:04
Two escape hatches through host.editor are gone, replaced by the plugin
SDK 0.2.55 doors made for them.

Document faces (document-faces.ts). The bake gives the document the faces
its text names when the document has none (ADR 411, amendment
2026-10-12). It sent the engine's registerFont with scope "document"
through the editor client; it now calls host.assets.registerDocumentFont
(assets.documentFont@1), which fills a gap and never replaces a face the
document holds. A family the document holds (assets.getFontFace) is still
not offered at all; a face the door refuses (over budget, a format the
canvas cannot read, the engine's refusal) is reported as a problem; on a
host without the door a family the document lacks is reported as drawn in
a substitute. Each capability is probed once per bake, and only when a
family needs it, so the 200-run bake keeps its 208 door calls.

Gesture commits (document-edited.ts, removed). A frame resized by its
handles is a canvas gesture whose commit the host's change event did not
report, so the auto renderer and the panel's preview size also listened
for gestureCommitted on the editor client. document.onDidChange now
reports gesture commits and script runs (document.onDidChange@2), so both
follow that event alone. The auto renderer treats every change but an undo
or redo as an edit (a gesture commit or a script run may grow a frame).

The contract pins move to plugin-api / plugin-sdk 0.2.55-canary.0, and the
peer floor with them: the bundle relies on the gesture events.

Tests (each failed before):
- conformance/bake-faces.spec.ts: a bake on a host whose host.editor
  throws still gives the document its face (Inter not missing, one
  document registration, no face problem). Fails on the old code: no
  registration, a "drawn in a substitute" problem.
- auto-render.spec.ts: a gesture commit and a script run reported by the
  door re-render a resized frame; the raw client broadcast is not listened
  to, and no raw subscription is held besides the older-host open path.
  Fails on the old code (it re-rendered on the raw broadcast and held one
  more raw subscription).
- panel-reach.spec.tsx: the preview follows a gesture commit and a script
  run from the door; the fixture host has no editor handle.
- conformance/auto-render.spec.ts: the resize gesture on the real engine
  re-renders and its undo too, without the test's own broadcast wrapper
  (the headless client broadcasts the commit since SDK 0.2.55).

Docs: architecture door table, status, ADR 411 amendment 2026-10-14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the plugin API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@drietsch
drietsch merged commit dc94b0b into main Oct 14, 2026
3 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant