This repository was archived by the owner on Oct 20, 2026. It is now read-only.
Repository navigation
Resize by handles re-renders, baked text gets its face, importer ignores comments - #5
Merged
Merged
Conversation
A `.html` file's `<style>` blocks become the frame's CSS and its `<body>` the HTML. The importer found them with two regular expressions over the whole file, so a `<style>` or `<body>` named inside a comment, a `<title>` or a script string was taken for one: the spring mailer opened for the paged.web film said in its head comment that "the <style> block" becomes the CSS, and the CSS then began inside that comment and ran over the head. The importer now scans the markup the way a tokenizer does as far as tags go: comments and the content of raw-text elements are text. A body that never closes runs to the end of the file. Tests: comment, raw-text, legacy CDO/CDC and unclosed-body cases, plus hostile fragments that must not throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMsNAAdpKNFJHkAku215dT
The canvas follows the document through `document.onDidChange`, which reports mutations, undos and redos. The editor resizes a frame by its handles as a canvas gesture: begun, updated and committed on the engine, answered by `gestureCommitted`, which that door does not report. A single web frame resized by its handles therefore kept its old, clipped render until "Render frame" was run by hand, and the source panel's preview kept its old size. (The journeys resized with a `resizeFrame` mutation, which the door does report.) `document-edited.ts` adds the editor client's gesture commits to the door's events (the `host.editor` escape hatch, as `document-opened.ts` hears an open on an older host); the auto renderer and the preview size follow both. A commit that changed no size renders nothing, as before. Tests: against the real host and engine, a resize gesture driven through the engine's gesture messages (with the client fanning every reply out to its subscribers, as the editor's does) re-renders the frame and its undo renders again; the control bar's W/H path (`frameBounds`) is pinned too; unit tests for the auto renderer and the panel's preview size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMsNAAdpKNFJHkAku215dT
A baked run names the face the engine shaped it in. The web film's mailer
names "IBM Plex Sans", which no document holds, so the engine shaped every
run in its bundled Inter, and the bake wrote native text in Inter, a face
the document's font registry did not hold either: the Fonts collection
flagged it missing ("Missing fonts: 1") and the canvas drew the baked text
in a substitute. The same held for a face a source's `@font-face` rule
loads.
Before the bake writes its text, each family its runs name that the
document holds no face for (`assets.getFontFace` answers from the document
registry) is given the bytes the engine shaped with: the bundled face, or
the `@font-face` faces in their declared styles. It happens before the
runs are measured, so they are measured in their face too. A family the
document holds is left alone; a host without `assets.fonts@1` gets nothing.
The plugin API has no door for a document face (`assets.registerFont` is
scene-layer only), so the engine's `registerFont` with `scope: "document"`
goes through the `host.editor` escape hatch until the SDK has one
(ADR 411, amendment 2026-10-12).
Tests: against the real host and engine with the editor's asset source
(bytes from the document registry): the mailer bakes in Inter and Inter is
not missing; a flow bake; an `@font-face` face; a family the document
already holds is not registered again. The 200-run bake budget gains the
one capability probe (207 -> 208 door calls).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QMsNAAdpKNFJHkAku215dT
…fixes status: the importer reads no tags out of comments or raw text; a resize by the frame's handles re-renders; the bake gives the document the faces its text names. architecture: the two `host.editor` escape-hatch uses (gesture commits; the document-font registration) and the bake's `getFontFace` read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMsNAAdpKNFJHkAku215dT
…mments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMsNAAdpKNFJHkAku215dT
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Defects found by recording the paged.media films in the real editor. Each fix landed with a test that failed first; each was also checked in the real editor (WebGPU, film-like launch) before and after, with the published
0.1.0-canary.14and with this branch packed as0.1.0-canary.15.1. A web frame resized by its handles kept its old, clipped render
host.document.onDidChange, which reports mutations, undos and redos. The editor resizes a frame by its handles as a canvas gesture (beginGesture/updateGesture/commitGesture, a{ kind: "resize" }gesture in the editor'sViewportCanvas), answeredgestureCommitted— which the SDK's door does not forward (plugin-sdkhost-impl.ts,document.onDidChange: mutation/undo/redo only). So no pass ran until "Render frame". The control bar's W/H fields writeframeBoundswith a mutation and already re-rendered (reproduced in the editor on canary.14); the journeys resize withresizeFrame, which is why they never saw it.document-edited.ts: the door's events plus the editor client'sgestureCommittedbroadcast (thehost.editorescape hatch, the waydocument-opened.tshears an open on an older host). The auto renderer and the source panel's preview size follow both; a commit that changed no size still renders nothing.frameBounds(W/H) path pinned; unit tests for the auto renderer and the preview size.document.onDidChangeto report gesture commits; then the raw listener here can go.2. Baked text was flagged as a missing font
Inter; after Bake the Fonts collection readInter, isMissing: true). The document's font registry held no Inter face: the editor loads Inter as the document default font bytes, not under a family, and the core flags a family with no registered face. The same held for a source's@font-facefaces.assets.getFontFaceanswers from the document registry) gets the bytes the engine shaped with: the bundled face, or the@font-facefaces in their declared styles. A family the document holds is left alone; a host withoutassets.fonts@1gets nothing. There is no plugin-API door for a document face (assets.registerFontis scene-layer only), so the engine'sregisterFontwithscope: "document"goes through thehost.editorescape hatch until the SDK has one. ADR 411 amended.@font-faceface; a family the document already holds is not registered again. The 200-run bake budget gains one capability probe (207 → 208 door calls).["Inter"]; this branch:[].3. The HTML importer read a
<style>named in a comment as the CSS<style>(or<body>) inside a comment, a<title>or a script string was taken for one.Investigated, not changed here
packages/shell/src/state/use-selection-object-type.tsx,useSelectionEditContext;MenuBar.tsx,showContextMenu). Measured: one web frame selected → "Web" context menu; two → none. "Thread flow into frames" stays reachable from Plugins ▸ Web (enabled), not only from the palette.idle()helpers), a re-entrant reflow (no mutation on selection). Note: CDP screencast sends frames only on visual change — after a click or a save it delivered none for 2.8–3.5 s while the page answered at once, so "frames stopped" is not by itself a freeze.Verification
pnpm -r typecheck— exit 0.REQUIRE_REAL_ENGINE=1 pnpm -r test— exit 0: web-model 290 passed / 9 skipped (corpus, as on main), web-conformance 103, web-bundle 334 (45 files).scripts/package-hash.mjs --check— ok, 0.1.0-canary.15 is a new version (the bump is in this PR so main's publish run does not fail on changed sources). Not merged, tagged or published.🤖 Generated with Claude Code
https://claude.ai/code/session_01QMsNAAdpKNFJHkAku215dT