The home page shows at once

It was blank until every module had loaded and the page's examples had
been run, a fuzzer's report among them (about a second of work): first
paint came 1.3 seconds into a repeat visit and about 3 into a first one.

- The assembler draws the home page once, in Node, with the app's own
  homeView, and puts it inside #app. The browser paints it with the
  HTML and the stylesheet.
- When the app has loaded it draws the page again, with its controls,
  and puts it in the prerendered one's place; the fuzzer's reports and
  the proof's counts are copied from the prerendered page, not worked
  out again.
- The prerendered page shows only on the home address: the page's first
  inline script marks it before the first paint, and without the mark it
  stays hidden, so an embed or a problem's address never shows it. That
  script changed, and its hash in docs/Caddyfile with it.

Served locally, first paint is at 0.1 to 0.2 seconds and the page with
its controls at 0.2 to 0.3; both were at 1.2 to 1.4.
This commit is contained in:
alexm committed 2026-11-13 07:28:38 -05:00
1 parent 7000662539
commit 5202c96318
12 files changed
+154 -19

No files matched your search

+7
View File
@@ -4343,6 +4343,13 @@ button.asm-src:hover {
.compile-input-note { max-width: 70ch; }
.compile-send-note { max-width: 70ch; }
/* index.html's note for a page whose scripts never ran (opened as a file, scripts blocked, offline on first load) */
/* the home page as the assembler drew it (src/ui/prerender.ts): shown at once on the home address (the inline script
of index.html says so before the first paint), and never on another address or where that script did not run */
.home-prerendered { display: none; }
html[data-home] .home-prerendered { display: block; }
/* with it on screen the note waits longer (the page is there, and its scripts may still be on their way) and takes
no room above the page: it comes up as a bar at the foot of the window */
html[data-home] #app:has(> .home-prerendered) .boot-note { animation-delay: 15s; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; margin: 0 auto; padding: 10px 14px; border-radius: var(--r); background: var(--warn-bg); pointer-events: none; }
.boot-note { max-width: 640px; margin: 64px auto; padding: 0 16px; color: var(--ink-2); font: 16px/1.5 var(--sans); opacity: 0; animation: boot-note-show 0s 4s forwards; }
@keyframes boot-note-show { to { opacity: 1; } }