Never a flash, on every path the review found
Branch review (Astra, #83) found eight problems; this commit fixes seven
(the eighth, vendoring, is the previous commit). Paul's ruling, restated
after the review: "No flashing, ever!" Each fix has a browser check,
through the production middleware with fonts, scripts or the editor
slowed or blocked. Each check failed on the reviewed head first.
No web face without the gate (findings 4 and 7). The stylesheet's own
rules are now the system faces. The web faces apply only under
<html data-docs-faces="web">, which the gate sets once they have loaded.
The hold is no longer rendered by the server, and there is no noscript
style. fixtures/fonts-hold.js, a blocking script in <head>, sets the hold
before the first paint and arms a 6 s fail-safe.
- No JavaScript, or a hold script that never arrives: the page is never
held, and stays in its system faces for the visit, with nothing to
fetch for it, hold or swap.
- A gate that never arrives: the editor shows the page itself once it
has paginated, or the fail-safe does.
The first reveal is the final layout (finding 3). Pages are measured
only in the final faces. A paged editor that has not paginated by 3.5 s
freezes the layout for the visit (data-docs-layout="frozen"), so it adds
no pages under a reader.
A face on screen never changes (finding 2). A family is committed to its
fallback only if it is not on screen yet. A Bold that cannot load leaves
the document unchanged and says so ("That font could not be loaded, so
nothing was changed").
Every way in waits for its faces (finding 1). The editor is not editable
until every face of every family in use has settled, so typing and the
input rules reach only final faces. Collaborators' changes and pastes
wait for every family in use, the default's and code's, plus any they
name. Code and bold name no font, so the byte scan alone missed them.
The editor mounts once exactly the faces its log is set in have loaded.
The latest pick wins, where it was made (finding 5). An earlier font
request that finishes later is dropped. fixtures/targets.mjs maps a
waiting edit's selection through every change, so a pick, a command or a
paste lands where it was asked for.
The closed picker follows the caret (finding 6). When sync changes the
font select, ui/select.js redraws its box through its own change path,
which brings the option's data-rst-class and name with it. The event is
marked so the toolbar's handlers do not apply formatting.
The previews have their own state and never hold the paper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 files changed,
+1,227
−360
.amadan/ci.d/10-gate+5 −0AGENTS.md+46 −17fixtures/build-bundles.mjs+4 −2fixtures/editor-entry.js+142 −41fixtures/font-session.mjs+235 −128fixtures/font-session.test.mjs+99 −52fixtures/fonts-gate.mjs+64 −46fixtures/fonts-hold.js+29 −0fixtures/generate-fragment.mjs+35 −1fixtures/targets.mjs+55 −0fixtures/targets.test.mjs+47 −0fixtures/toolbar.mjs+37 −4fixtures/vectors/fragment/long.binbinaryfixtures/vectors/fragment/remote-bold.binbinaryfixtures/vectors/fragment/remote-code.binbinaryinternal/docs/assets.go+5 −1internal/docs/assets_test.go+1 −0internal/docs/export_test.go+3 −3internal/docs/fontgate.go+9 −7internal/docs/fontgate_test.go+13 −4internal/docs/fonts_browser_test.go+320 −3internal/docs/static/{editor.573b8290475e672d.js => editor.4219d9105bad1f40.js}+13 −13internal/docs/static/{fontsgate.f961e5091eb86fd1.js => fontsgate.9a16ac7a9212a75b.js}+1 −1internal/docs/static/fontshold.1a1f5ca5b87eb00d.js+1 −0internal/docs/views/show.html+12 −11internal/fonts/fonts.go+31 −24internal/fonts/fonts_test.go+20 −2
CI passed — run details
Intent
.amadan/ci.d/10-gateLoading diff…
AGENTS.mdLoading diff…
fixtures/build-bundles.mjsLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/font-session.mjsLoading diff…
fixtures/font-session.test.mjsLoading diff…
fixtures/fonts-gate.mjsLoading diff…
fixtures/fonts-hold.jsLoading diff…
fixtures/generate-fragment.mjsLoading diff…
fixtures/targets.mjsLoading diff…
fixtures/targets.test.mjsLoading diff…
fixtures/toolbar.mjsLoading diff…
fixtures/vectors/fragment/long.binLoading diff…
fixtures/vectors/fragment/remote-bold.binLoading diff…
fixtures/vectors/fragment/remote-code.binLoading diff…
internal/docs/assets.goLoading diff…
internal/docs/assets_test.goLoading diff…
internal/docs/export_test.goLoading diff…
internal/docs/fontgate.goLoading diff…
internal/docs/fontgate_test.goLoading diff…
internal/docs/fonts_browser_test.goLoading diff…
internal/docs/static/{editor.573b8290475e672d.js => editor.4219d9105bad1f40.js}Loading diff…
internal/docs/static/{fontsgate.f961e5091eb86fd1.js => fontsgate.9a16ac7a9212a75b.js}Loading diff…
internal/docs/static/fontshold.1a1f5ca5b87eb00d.jsLoading diff…
internal/docs/views/show.htmlLoading diff…
internal/fonts/fonts.goLoading diff…
internal/fonts/fonts_test.goLoading diff…