fonts: a wait for a font is a short modal; prefetch the families
Review 7 (#83). Replaying input cannot be made faithful, so nothing is queued or replayed. An action that needs a family not yet loaded is cancelled before anything changes; the editor, the formatting bar and the menu bar go inert, and a status strip over the bar says a font is loading, at once, in a polite live region. When the family is in, the original transaction is dispatched once. A family that fails or misses the three-second deadline drops the action, restores editing and says so. One wait at a time: anything else that would change the document meanwhile is refused, visibly. There is no document-wide capture, so the title, dialogs and comments keep their input, and focus returns to the document only if it was there and nobody moved it. A wait never begins in an IME composition; a change in a cold family during one is drawn in that family's fallback. Undo and redo follow the same wait. Remote updates are unchanged: FIFO, checked before Yjs, never dropped. The floating notes are gone: every font note is said in the strip over the formatting bar, which takes no space, never covers text, and whose substitute and unavailable notes time out or can be dismissed. After the reveal, on an editor page, every picker family's faces are fetched when idle, one at a time at low priority, and loaded from the cache: 5.91 MiB beyond the page's own, once. Not with Save-Data or 2G. The WebKit probe failure: Playwright's screenshot style option inserted and removed a stylesheet around every capture, and WebKit rebuilt its @font-face set on each, reporting loaded Carlito faces as unloaded when the editor mounted. Without it, 20 of 20 WebKit runs pass (with it, 2 of 8 failed). The engines check adds nothing to the page, compares an action's pictures by their ink, and has a prefetched-pick scenario. Tests, failing first on e7a4ac3: the short-modal table (keys, an IME commit, the title, a second action, a collaborator, a failed and a late font), the status never covering text at 390x640 and 1280x1000, the prefetch after the reveal, a wait during the prefetch, a composition never starting a wait, and a second pick refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 files changed,
+1,177
−396
AGENTS.md+35 −19fixtures/editor-entry.js+104 −175fixtures/engines/first-reveal.mjs+61 −22fixtures/font-session.mjs+64 −0fixtures/font-session.test.mjs+124 −1fixtures/font-status.mjs+49 −0fixtures/fonts-gate.mjs+35 −4fixtures/toolbar.mjs+22 −29internal/docs/fontgate.go+8 −2internal/docs/fonts_browser_test.go+596 −98internal/docs/render.go+3 −1internal/docs/static/editor.46336512a20874d7.js+14 −0internal/docs/static/editor.b266d764c5ad91c1.js+0 −14internal/docs/static/fontsgate.4b08e336e60c4a71.js+0 −1internal/docs/static/fontsgate.c5a7dd05de721ce2.js+1 −0internal/docs/views/show.html+61 −30
CI passed — run details
Intent
AGENTS.mdLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/engines/first-reveal.mjsLoading diff…
fixtures/font-session.mjsLoading diff…
fixtures/font-session.test.mjsLoading diff…
fixtures/font-status.mjsLoading diff…
fixtures/fonts-gate.mjsLoading diff…
fixtures/toolbar.mjsLoading diff…
internal/docs/fontgate.goLoading diff…
internal/docs/fonts_browser_test.goLoading diff…
internal/docs/render.goLoading diff…
internal/docs/static/editor.46336512a20874d7.jsLoading diff…
internal/docs/static/editor.b266d764c5ad91c1.jsLoading diff…
internal/docs/static/fontsgate.4b08e336e60c4a71.jsLoading diff…
internal/docs/static/fontsgate.c5a7dd05de721ce2.jsLoading diff…
internal/docs/views/show.htmlLoading diff…