oficina / docs Public

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>
Paul Campbell pushed by paul@keymail.dev c159e6805e68e5b97f967c15aa9521d7a65ba1f1 parent e7a4ac3
16 files changed, +1,177 −396
  • AGENTS.md +35 −19
  • fixtures/editor-entry.js +104 −175
  • fixtures/engines/first-reveal.mjs +61 −22
  • fixtures/font-session.mjs +64 −0
  • fixtures/font-session.test.mjs +124 −1
  • fixtures/font-status.mjs +49 −0
  • fixtures/fonts-gate.mjs +35 −4
  • fixtures/toolbar.mjs +22 −29
  • internal/docs/fontgate.go +8 −2
  • internal/docs/fonts_browser_test.go +596 −98
  • internal/docs/render.go +3 −1
  • internal/docs/static/editor.46336512a20874d7.js +14 −0
  • internal/docs/static/editor.b266d764c5ad91c1.js +0 −14
  • internal/docs/static/fontsgate.4b08e336e60c4a71.js +0 −1
  • internal/docs/static/fontsgate.c5a7dd05de721ce2.js +1 −0
  • internal/docs/views/show.html +61 −30

CI passed — run details

AGENTS.md

Loading diff…

fixtures/editor-entry.js

Loading diff…

fixtures/engines/first-reveal.mjs

Loading diff…

fixtures/font-session.mjs

Loading diff…

fixtures/font-session.test.mjs

Loading diff…

fixtures/font-status.mjs

Loading diff…

fixtures/fonts-gate.mjs

Loading diff…

fixtures/toolbar.mjs

Loading diff…

internal/docs/fontgate.go

Loading diff…

internal/docs/fonts_browser_test.go

Loading diff…

internal/docs/render.go

Loading diff…

internal/docs/static/editor.46336512a20874d7.js

Loading diff…

internal/docs/static/editor.b266d764c5ad91c1.js

Loading diff…

internal/docs/static/fontsgate.4b08e336e60c4a71.js

Loading diff…

internal/docs/static/fontsgate.c5a7dd05de721ce2.js

Loading diff…

internal/docs/views/show.html

Loading diff…