oficina / docs Public

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>
Paul Campbell pushed by paul@keymail.dev c6f351b71b4423eeb486b92e296019ba9025d313 parent 6cd43a4
27 files changed, +1,227 −360
  • .amadan/ci.d/10-gate +5 −0
  • AGENTS.md +46 −17
  • fixtures/build-bundles.mjs +4 −2
  • fixtures/editor-entry.js +142 −41
  • fixtures/font-session.mjs +235 −128
  • fixtures/font-session.test.mjs +99 −52
  • fixtures/fonts-gate.mjs +64 −46
  • fixtures/fonts-hold.js +29 −0
  • fixtures/generate-fragment.mjs +35 −1
  • fixtures/targets.mjs +55 −0
  • fixtures/targets.test.mjs +47 −0
  • fixtures/toolbar.mjs +37 −4
  • fixtures/vectors/fragment/long.bin binary
  • fixtures/vectors/fragment/remote-bold.bin binary
  • fixtures/vectors/fragment/remote-code.bin binary
  • internal/docs/assets.go +5 −1
  • internal/docs/assets_test.go +1 −0
  • internal/docs/export_test.go +3 −3
  • internal/docs/fontgate.go +9 −7
  • internal/docs/fontgate_test.go +13 −4
  • internal/docs/fonts_browser_test.go +320 −3
  • internal/docs/static/{editor.573b8290475e672d.js => editor.4219d9105bad1f40.js} +13 −13
  • internal/docs/static/{fontsgate.f961e5091eb86fd1.js => fontsgate.9a16ac7a9212a75b.js} +1 −1
  • internal/docs/static/fontshold.1a1f5ca5b87eb00d.js +1 −0
  • internal/docs/views/show.html +12 −11
  • internal/fonts/fonts.go +31 −24
  • internal/fonts/fonts_test.go +20 −2

CI passed — run details

.amadan/ci.d/10-gate

Loading diff…

AGENTS.md

Loading diff…

fixtures/build-bundles.mjs

Loading diff…

fixtures/editor-entry.js

Loading diff…

fixtures/font-session.mjs

Loading diff…

fixtures/font-session.test.mjs

Loading diff…

fixtures/fonts-gate.mjs

Loading diff…

fixtures/fonts-hold.js

Loading diff…

fixtures/generate-fragment.mjs

Loading diff…

fixtures/targets.mjs

Loading diff…

fixtures/targets.test.mjs

Loading diff…

fixtures/toolbar.mjs

Loading diff…

fixtures/vectors/fragment/long.bin

Loading diff…

fixtures/vectors/fragment/remote-bold.bin

Loading diff…

fixtures/vectors/fragment/remote-code.bin

Loading diff…

internal/docs/assets.go

Loading diff…

internal/docs/assets_test.go

Loading diff…

internal/docs/export_test.go

Loading diff…

internal/docs/fontgate.go

Loading diff…

internal/docs/fontgate_test.go

Loading diff…

internal/docs/fonts_browser_test.go

Loading 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.js

Loading diff…

internal/docs/views/show.html

Loading diff…

internal/fonts/fonts.go

Loading diff…

internal/fonts/fonts_test.go

Loading diff…