Skip to content

feat(web): static-first home with layer stack and plugin graph, faster load - #512

Merged
gitfromwildan merged 8 commits into
mainfrom
feat/web-home-motion-and-perf
Nov 9, 2026
Merged

gitfromwildan merged 8 commits into
mainfrom
feat/web-home-motion-and-perf

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

Home page rework for @docubook/web: new section visuals, and a load path where every component renders at rest (no layout shift) and animates only once the reader scrolls.

  • Playground (MarkdownPlayground, MarkdownDemo): the "docubook / playground" header is gone; the traffic lights sit in the editor tab in macOS colours. The server render is the finished page, the typing replays once per load when the demo reaches mid-viewport, and React hydrates only as the demo nears that line.
  • Load path: page CSS is inlined (no render-blocking request); metric-matched fallback faces for Inter and IBM Plex Mono make the font swap shift-free, with the latin cuts preloaded; Ask AI is a plain button that loads DocSearch and its styles on first hover, focus or click, so the page ships no React or DocSearch up front.
  • Mascot: sprite sheets move to src/assets and astro:assets builds 1x/2x/3x WebP per drawn size (navbar sheet 195 KB → 10–49 KB); cells are picked by translating an <img> (compositor only), aiming is batched per frame (no forced layout), and only the footer mascot carries the lazily loaded reactions sheet.
  • Demos start on scroll: [data-animate] demos (terminal, search, GitHub mark, output folder, and the plugins page's search and card previews) show their finished frame on load; the layout starts them on the first scroll and each loops only near the viewport. Repo stats are rendered at build time and refreshed only when the card is near the viewport.
  • "A file. A compiler. The whole web.": the step cards become an isometric layer stack (index.md → Flame → static host → your-docs.com). A file drops through the layers as md → compile → html → publish while the matching step lights up.
  • Plugins: the home and plugins-page step cards become a pipeline graph: plugins wire into the stages of Flame's build (a dark core that is never patched) and their outputs land on the right. Steps.astro is removed.
  • Flame docs branding: icon.svg, favicon.ico and the default og.png now use the site panda; og.png is a 1200×630 Takumi render of the new home.

Verification

Measured on a production build served by nginx with gzip; Lighthouse 13.6 run locally (the shared PageSpeed Insights API key was over its daily quota).

Before After
Lighthouse mobile / desktop 100 / 100 100 / 100
LCP mobile 0.9 s 0.8 s
CLS desktop 0.008 (h1 shift on font swap) 0
Requests on load 13 (594 KB) 6 (123 KB)
  • CLS stays 0 with the web fonts delayed by 2.5 s: every section keeps its height when the swap lands.
  • No looping animation runs on load on /, /features or /plugins; scrolling through each page totals CLS 0.0004–0.0005.
  • While the layer stack and the plugin graph animate: 0 layouts over 8 s, about 1% main-thread time.
  • Reduced motion shows every demo static; no horizontal scroll at 390 px and 820 px.
  • Combined Flame + Astro build behind Vercel-like nginx (clean URLs, 404, production CSP): all pages and /docs load with no console or CSP errors; the 41 generated docs cards render the new panda logo.
  • Pre-push hooks passed: turbo lint, turbo build, commitlint. pages typecheck and tests pass.

Notes

  • astro build needs Node ≥ 22.23.4; the local hooks ran on 22.23.4.
  • The build now calls the GitHub API for the repo stats (5 s timeout, uses GITHUB_TOKEN when set); offline or rate-limited builds keep the placeholders and the browser fills them in.
  • og.png keeps its URL, which vercel.json caches for a year; social platforms may need a re-scrape to pick up the new card.
  • The Flame scaffold template's logo and favicon (packages/flame/template) are unchanged. No changeset: @docubook/web is private and Flame's docs/ is not part of the npm package.

- Drop the "docubook / playground" header bar; the traffic lights move into
  the editor tab, beside index.md, in macOS red, yellow and green.
- The server render is the finished page, so audits and no-JS visitors see
  the result. The typing replays once per page load, starting when the demo
  has scrolled halfway up the viewport, and no longer loops.
- The editor keeps its finished height while the text regrows, so the page
  below does not jump on narrow screens.
- React hydrates only as the demo nears its start line, not on page load.
…k AI

- Inline the page stylesheet so no CSS request blocks the first paint.
- Metric-matched "Inter Fallback" and "IBM Plex Mono Fallback" faces (Arial
  and Courier New, or their Liberation twins) take the same space as the web
  fonts, so the swap moves nothing; the latin cuts are preloaded.
- Ask AI is a plain button with a small script: DocSearch's side panel and
  its styles load on the first hover, focus or click, and its CSS no longer
  ships inside the page stylesheet.
- Read scrollY in the first frame instead of at load, avoiding a forced
  layout.
- The sprite sheets move to src/assets and astro:assets builds 1x/2x/3x
  WebP for the size each mascot is drawn at: the navbar sheet drops from
  195 KB to 10-49 KB, the footer's from 195 + 214 KB to 33-88 + 37-100 KB.
- Each sheet is an <img> three times the mascot's size; a cell is picked
  by translating it, a compositor-only change instead of a repaint.
- Only the boopable footer mascot carries the reactions sheet, and it
  loads lazily with its directions sheet.
- Pointer and scroll updates run once per frame, reading every rect before
  writing any cell, so aiming never forces a layout.
- [data-animate] demos (terminal, search, GitHub mark, output folder, the
  plugins page's search and social card previews) render their finished
  frame on load, so audits and the first paint see complete, readable
  content. The layout starts them on the first scroll and each loops only
  while within 120px of the viewport.
- The repo stats are fetched at build time and rendered into the page; the
  browser refresh waits until the card is near the viewport, keeping the
  GitHub API call off the page load.
"A file. A compiler. The whole web." replaces its four step cards with an
exploded stack of 3D plates: index.md, the Flame compiler, the static host
and your-docs.com. A file drops through the layers and changes at each one
(md, compile, html, publish) while the matching step lights up in the list
beside it.

The markup is the resting frame, every plate and step readable; the stack
opens and loops only while [data-playing], on transform and opacity alone.
Reduced motion keeps the static stack.
The plugin sections on the home and plugins pages trade their step cards
for a graph: plugins on the left wire into the stages of Flame's build (a
dark core that is never patched), and what each adds lands on the right.
One 8s cycle plays the four steps: plugins light up, wires connect to their
stages, the build pulse runs down the core and branches out to each output,
then each plugin's source (npm, local, options) lights.

Like the layer stack it renders at rest and animates only while
[data-playing]. Steps.astro has no users left and is removed.
- icon.svg is the mascot's resting cell (the same panda the Astro site
  animates), embedded as a palette PNG so the logo matches it pixel for
  pixel. The plugins page's card mockup uses the same file.
- favicon.ico carries the same panda at 16, 24, 32, 48, 64 and 256 px.
- og.png, the default social card the Astro pages point to, is a 1200x630
  render of the new home made with Takumi, replacing the old Flame home
  screenshot.
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Preview Nov 9, 2026 10:08am UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. One minor suggestion inline.

Reviewed changes

This review covers all 7 commits of the @docubook/web home rework (mode: standard, since this is a private marketing site and not a flame build or CSP path), plus the Flame docs logo, favicon and OG swap.

  • Static-first load path: page CSS is now inlined, the latin Inter and Plex Mono cuts are preloaded, and metric-matched local() fallback faces remove the shift when the web fonts swap in. The Vercel CSP already allows style-src 'unsafe-inline', so inlining is safe.
  • Ask AI without React: islands/AskAiButton.tsx is replaced by shared/AskAiButton.astro. DocSearch's JS and its two stylesheets (?url) load on the first hover, focus or click of any [data-ask-ai-trigger].
  • Demos start on scroll: every [data-animate] demo renders its finished frame. Site.astro attaches a data-playing IntersectionObserver on the first scroll, and each loop is gated on [data-playing] with !important reduced-motion overrides.
  • One-shot playground: MarkdownPlayground server-renders the full source, so hydration matches the server render. It replays the typing once at mid-viewport and holds minHeight while the text regrows.
  • Repo stats at build time: OpenSource.astro fetches GitHub stats during the build (5 s timeout, optional GITHUB_TOKEN). The client refresh now waits until the card is near the viewport.
  • Mascot via astro:assets: per-size 1x/2x/3x WebP sheets. A cell is picked with translate on an <img>. Aiming is batched per rAF with all reads before writes. The reactions sheet ships only for the boopable footer mascot (lazy).
  • Layer stack and plugin graph: Steps.astro is removed. Pipeline.astro becomes an isometric layer stack, and the new PluginFlow.astro is shared by the home and plugins pages.

Assessment: READY WITH MINOR FIXES. Top priorities:

  1. Keep the localStorage cache from overwriting the newer build-time repo stats (inline).

No other admissible findings. I checked that nothing still references the removed public/mascots/*, Steps.astro or the React Ask AI island, and that __ASK_AI__ is still typed in src/env.d.ts.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

…bers

The page now records when its stats were fetched (data-built-at). The
localStorage entry only replaces them when it is newer than the build, and
while the build-time numbers are younger than the 7-day TTL the browser
skips the GitHub API call entirely.
@gitfromwildan gitfromwildan self-assigned this Nov 9, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. The repo-stats cache fix works for every case.

Reviewed changes

This re-review covers the one commit since the last review (mode: standard). It fixes the earlier finding that the browser cache could override newer build-time stats.

  • Build-time stamp on the stats card: OpenSource.astro sets data-built-at on [data-repo] to the time the build fetched the stats. It sets 0 when the build kept the placeholders.
  • Cache defers to the build: stats() uses a localStorage entry only when it is newer than the build and less than 7 days old. It skips the GitHub API while the build-time numbers are under 7 days old. It fetches in two cases: the build kept placeholders (builtAt = 0, so the age check always fails) or the build is older than the TTL. The null return leaves the server-rendered text in place.

Assessment: READY. The prior thread is resolved and no Pullfrog threads remain open.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan
gitfromwildan merged commit c888ac8 into main Nov 9, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the feat/web-home-motion-and-perf branch November 9, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant