oficina / docs Public

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>
Paul Campbell pushed by paul@keymail.dev e7a4ac3ebc829672e1edaf8301dd67d62c0320a7 parent bb02b67
18 files changed, +534 −348
  • .amadan/ci.d/10-gate +0 −5
  • AGENTS.md +21 −13
  • fixtures/editor-entry.js +176 −51
  • fixtures/engines/first-reveal.mjs +37 −7
  • fixtures/font-session.mjs +1 −32
  • fixtures/font-session.test.mjs +1 −44
  • fixtures/generate-random-docs.mjs +32 −11
  • fixtures/targets.mjs +0 −55
  • fixtures/targets.test.mjs +0 −47
  • fixtures/toolbar.mjs +29 −52
  • internal/docs/fontgate.go +2 −0
  • internal/docs/fonts_browser_test.go +190 −7
  • internal/docs/fonts_engines_browser_test.go +14 −8
  • internal/docs/render.go +1 −0
  • internal/docs/static/editor.1abdb58cba7929f1.js +0 −14
  • internal/docs/static/editor.b266d764c5ad91c1.js +14 −0
  • internal/docs/static/{fontsgate.81c2a1963b36cad4.js => fontsgate.4b08e336e60c4a71.js} +1 −1
  • internal/docs/views/show.html +15 −1

CI passed — run details

.amadan/ci.d/10-gate

Loading diff…

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/generate-random-docs.mjs

Loading diff…

fixtures/targets.mjs

Loading diff…

fixtures/targets.test.mjs

Loading diff…

fixtures/toolbar.mjs

Loading diff…

internal/docs/fontgate.go

Loading diff…

internal/docs/fonts_browser_test.go

Loading diff…

internal/docs/fonts_engines_browser_test.go

Loading diff…

internal/docs/render.go

Loading diff…

internal/docs/static/editor.1abdb58cba7929f1.js

Loading diff…

internal/docs/static/editor.b266d764c5ad91c1.js

Loading diff…

internal/docs/static/{fontsgate.81c2a1963b36cad4.js => fontsgate.4b08e336e60c4a71.js}

Loading diff…

internal/docs/views/show.html

Loading diff…