fonts: block the input, not the transaction
Review 6 (#83). A user action that would put text in a family whose faces have not all loaded is cancelled before anything changes; the editor goes non-editable with the selection kept, the toolbar and menus go inert, the family loads, and the same action runs again at the then-current selection. Keys, pastes and drops that arrive meanwhile are queued and replayed in order after it. Past 650 ms a floating "Loading the font…" note says so; a family that fails cancels the action and says that. Nothing blocks during an IME composition. Undo and redo of text in a cold family wait the same way. Remote updates are still checked before they reach Yjs, FIFO, and wait for a blocked local action to finish. The transaction hold-and-rebase machinery and targets.mjs are gone; font picks are a plain command through the same check. The font notes float, so showing one moves nothing on the page. Tests, failing first on bb02b67: typing, a replaced selection, two pastes, a collaborator's edit, undo and a code toggle during a blocked paste lose nothing and land in order; an IME composition during a load. Undo grouping and a composition in a loaded family are guarded and mutation-checked. The engines check gives each scenario its own document, reads unquoted family names in its probe, has a probe control in each engine, and requires the wait to be announced. The generator checks node and mark coverage on the documents it wrote.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 files changed,
+534
−348
.amadan/ci.d/10-gate+0 −5AGENTS.md+21 −13fixtures/editor-entry.js+176 −51fixtures/engines/first-reveal.mjs+37 −7fixtures/font-session.mjs+1 −32fixtures/font-session.test.mjs+1 −44fixtures/generate-random-docs.mjs+32 −11fixtures/targets.mjs+0 −55fixtures/targets.test.mjs+0 −47fixtures/toolbar.mjs+29 −52internal/docs/fontgate.go+2 −0internal/docs/fonts_browser_test.go+190 −7internal/docs/fonts_engines_browser_test.go+14 −8internal/docs/render.go+1 −0internal/docs/static/editor.1abdb58cba7929f1.js+0 −14internal/docs/static/editor.b266d764c5ad91c1.js+14 −0internal/docs/static/{fontsgate.81c2a1963b36cad4.js => fontsgate.4b08e336e60c4a71.js}+1 −1internal/docs/views/show.html+15 −1
CI passed — run details
Intent
.amadan/ci.d/10-gateLoading diff…
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/generate-random-docs.mjsLoading diff…
fixtures/targets.mjsLoading diff…
fixtures/targets.test.mjsLoading diff…
fixtures/toolbar.mjsLoading diff…
internal/docs/fontgate.goLoading diff…
internal/docs/fonts_browser_test.goLoading diff…
internal/docs/fonts_engines_browser_test.goLoading diff…
internal/docs/render.goLoading diff…
internal/docs/static/editor.1abdb58cba7929f1.jsLoading diff…
internal/docs/static/editor.b266d764c5ad91c1.jsLoading diff…
internal/docs/static/{fontsgate.81c2a1963b36cad4.js => fontsgate.4b08e336e60c4a71.js}Loading diff…
internal/docs/views/show.htmlLoading diff…