Skip to content

spaces: procedural covers for the home page and gallery cards - #448

Open
nyblnet wants to merge 1 commit into
mainfrom
spaces-visual
Open

spaces: procedural covers for the home page and gallery cards#448
nyblnet wants to merge 1 commit into
mainfrom
spaces-visual

Conversation

@nyblnet

@nyblnet nyblnet commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Procedural covers (bento/spaces)

A page with no cover gets a generated one where the cover would go — a gradient plus one of six geometric figures (orbs, bands, dot lattice, rings, facets, waves), seeded from the page id in the new spaces/src/procedural.ts. Render-time only: nothing is written to the document, cover absent stays absent, an older build sees no cover, a saved file does not grow.

Where it draws: the home page (doc.home) and every coverless gallery card. Not every page — a cover is a 150–320px full-bleed band that lifts the icon into a disc, and on a space of two hundred plain notes that is two hundred posters. The gallery already tinted bare cards on an id-derived hue; this is that tint with a figure on it. Never on paper, never in the file-manager thumbnail (both pass printing: true).

Rules: same id → same SVG (byte for byte); a real cover always wins; a removed cover gets the procedural one back; a remote cover (already refused by coverSrc) counts as none.

Measured on rasterised pixels over each theme's ground, 400 ids × all 8 hues × all 6 figures:

light dark
gallery mark (34px bold) worst case 4.29:1 3.28:1
… with the plain tint main draws today 6.55:1 4.13:1
home-page icon glyph on its disc 9.94:1 9.30:1
disc edge vs cover (not chased to 3:1 — see DECISIONS) 1.33–2.31 1.91–3.53

Shell: 277,769 → 279,181 B (+1,412), built side by side with origin/main.

Rig: scripts/test-spaces-model.ts gains 15 checks on the generator and the decision function (949/949). Each gate was sabotaged in turn and failed exactly its own assertion: Math.random seed, constant seed, real-cover gate, home-only gate, printing gate, page-vs-card strength.

Not verified here: phone width (the browser pane ignored resize_window; the procedural cover shares .sp-cover's geometry with a real cover, which was verified on phones when covers shipped) and an actual print dialog (the gate is asserted in the rig, not observed on paper).

Theme presets — deliberately not built

Asked for in the same brief. In this app doc.theme.background/color/accent/fontFamily are painted by nothing in the live app — only preview.ts reads the colours; only measure/dir reach the reading column. That is the 2026-08-22 ruling (theme follows the reader; "if it ever changes it changes with the FORMAT"), and the cross-app dark-mode mechanism is an open maintainer question on the board. A "Dark" preset would change the thumbnail and nothing a reader can see; painting doc.theme onto the column is a ruling reversal, not a zone change. Written up in docs/DECISIONS.md with what an honest smaller version would be (typography presets).

A page with no cover gets a generated one where the cover would go: a
gradient plus one of six geometric figures, seeded from the page id in
the new spaces/src/procedural.ts, drawn at render time and never written
to the document. Only the home page and coverless gallery cards draw it —
two hundred notes are not two hundred posters — and nothing procedural
reaches paper or the file-manager thumbnail. A real cover always wins; a
removed cover gets the procedural one back.

The decision is one pure function so the model rig pins every branch;
contrast was measured on rasterised pixels across 400 ids in both themes
(card mark >= 4.29:1 light / 3.28:1 dark, disc glyph 9.94 / 9.30).

Theme presets were asked for alongside this and are deliberately not
built: doc.theme's colours are painted by nothing in the live app (ruled
2026-08-22), so a preset would change only the thumbnail. Recorded in
docs/DECISIONS.md.
@github-actions

Copy link
Copy Markdown

Build size

main (0100083) → spaces-visual (c9c21b8)

app base PR change
bento/slides 677.9 KiB 677.9 KiB 0.0 KiB (0.00%)
bento/spaces 271.3 KiB 272.6 KiB +1.4 KiB (+0.51%)
bento/dash 424.1 KiB 424.1 KiB 0.0 KiB (0.00%)

Updated: 2026-09-12T00:23:22Z

nyblnet added a commit that referenced this pull request Sep 12, 2026
Merges spaces-starter-merged (the PM and visual passes reconciled into one
starter by a dedicated agent rather than by both-sides resolution, which had
duplicated content) and spaces-visual (#448, procedural covers). Three append
conflicts, no seams this time.

A preview for testing, never a merge candidate.
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