From e62ea29839ea3190d7a5591c6bf25cf0fbe76c68 Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Mon, 14 Sep 2026 12:03:53 -0400 Subject: [PATCH] fix(site)!: keep the landing page's tuning panel out of published builds Moves the panel into TunePanel.astro, which index.astro renders and wires up only under `import.meta.env.DEV`, so its markup, styles, slider descriptions and the readout naming this repository's cargo test floor are all absent from a production build. check-dev-surface.mjs is the check. Change-Id: Ia5af2e10da4dec13ccd5a9c8abfd3795710fe5a4 --- site/README.md | 16 ++- site/package.json | 2 +- site/src/components/TunePanel.astro | 143 ++++++++++++++++++++++++++ site/src/pages/index.astro | 150 +++------------------------- site/tests/check-dev-surface.mjs | 37 +++++++ 5 files changed, 207 insertions(+), 141 deletions(-) create mode 100644 site/src/components/TunePanel.astro create mode 100644 site/tests/check-dev-surface.mjs diff --git a/site/README.md b/site/README.md index 04fb9189..d91c53b2 100644 --- a/site/README.md +++ b/site/README.md @@ -91,8 +91,8 @@ across languages: *scroll-space* position, mesh/caption timing, the free-run threshold — is page composition, not physics, and lives in `src/config/anim.ts`. -**To try a new value:** open the page with `?tune=1` (e.g. -`http://localhost:4321/?tune=1`) for a dev-only panel with a slider per +**To try a new value:** open the page with `?tune=1` on the dev server (e.g. +`http://localhost:4321/?tune=1`) for a panel with a slider per schedule parameter (plus reveal timing, easing, and the free-run threshold), each with a one-sentence description of what it visibly changes, its own reset-to-default button, and a live "crystallisation agreement" readout (the @@ -103,6 +103,12 @@ turn it into an edit to `anim.ts` (the non-schedule numbers) or shipped default; re-run `cargo test -p didbot-site-anim` afterward — see "the crystallisation threshold" below). +The panel lives in `src/components/TunePanel.astro`, and `index.astro` +renders it and wires it up only under `import.meta.env.DEV` — so `?tune=1` +is a dev-server address, and neither the panel nor its readouts are in the +tree `scripts/publish-site.sh` uploads. `site/tests/check-dev-surface.mjs` +is the check that keeps it that way. + **The crystallisation threshold.** `the_lattice_reliably_crystallises_into_did_bot` (in `anneal.rs`) requires the anneal's final state to agree with the did.bot mask on at least 93% of lattice sites, for every one of twelve @@ -435,9 +441,9 @@ anyone said. Pages under `/docs/` and `/api/` carry no filler at all: they render real, already-reviewed content from elsewhere in the repository. Neither does the -landing page's dev-only `?tune=1` panel, whose per-slider descriptions are -developer documentation for whoever is tuning the simulation rather than -anything a visitor sees. +landing page's `?tune=1` panel, whose per-slider descriptions are developer +documentation for whoever is tuning the simulation and which a production +build leaves out entirely. ### What a link card shows diff --git a/site/package.json b/site/package.json index 7855aa08..f192d664 100644 --- a/site/package.json +++ b/site/package.json @@ -12,7 +12,7 @@ "build": "astro build", "preview": "astro preview", "astro": "astro", - "test": "node tests/check-docs-coverage.mjs && node tests/check-links.mjs && node tests/check-serving.mjs && node tests/check-required-pages.mjs && node tests/check-html.mjs && node tests/check-meta.mjs && node tests/check-wasm.mjs && node tests/check-csp.mjs && node tests/check-build-stamp.mjs" + "test": "node tests/check-docs-coverage.mjs && node tests/check-links.mjs && node tests/check-serving.mjs && node tests/check-required-pages.mjs && node tests/check-html.mjs && node tests/check-meta.mjs && node tests/check-wasm.mjs && node tests/check-csp.mjs && node tests/check-build-stamp.mjs && node tests/check-dev-surface.mjs" }, "dependencies": { "astro": "7.2.9", diff --git a/site/src/components/TunePanel.astro b/site/src/components/TunePanel.astro new file mode 100644 index 00000000..d44acb6e --- /dev/null +++ b/site/src/components/TunePanel.astro @@ -0,0 +1,143 @@ +--- +// The landing page's tuning panel: eleven sliders over the Ising +// simulation's schedule and the page's reveal timing, plus a copyable +// settings line for reporting a value back as an edit to +// src/config/anim.ts or crates/didbot-site-anim/src/anneal.rs. See +// site/README.md for how the owner uses it. +// +// index.astro renders this only under `import.meta.env.DEV`, so it is part +// of the dev server and not of the tree scripts/publish-site.sh uploads. +// `?tune=1` opens it; the same guard gates its wiring in index.astro's +// script. +--- +
+

tuning (dev only)

+
+
start temperature + + +
+ +

How hot the lattice starts, before any cooling begins — higher makes the opening noise look more scrambled and less clustered.

+
+
+
cooling floor temperature + + +
+ +

The coolest the lattice gets on its way down, before the hold and the reveal — lower gives tighter, calmer clusters more time to settle during the dwell.

+
+
+
hold length (before reveal) + + +
+ +

How much of the anneal passes at a steady, held temperature before the wordmark starts pulling itself together. This is when the field turns on in the underlying physics, not just a visual cue — reveal start/width below only make sense relative to it.

+
+
+
field ramp width + + +
+ +

How gradually the letterform's pull strengthens after hold length above ends — small snaps to full strength almost immediately, large lets it build slowly across more of the remaining anneal.

+
+
+
field strength + + +
+ +

How hard the field pulls lattice cells into the wordmark's shape once it's active — higher makes the letters assert themselves faster and more forcefully over whatever pattern already formed.

+
+
+
annealing plateau temperature + + +
+ +

How much thermal noise remains once the field is pulling cells into letters — higher keeps the reveal looking lively and textured instead of freezing into flat, static shapes.

+
+
+
sweeps per scroll (total sweeps) + + +
+ +

How many simulation steps the whole scroll covers — more steps means each point of scroll shows a finer-grained slice of the process, including the reveal itself.

+
+
+
reveal band start (scroll) + + +
+ +

Where in the scroll (0 = top, 1 = bottom) the reveal band begins — together with reveal band width below, this sets the stretch of scrolling during which the wordmark actually appears.

+
+
+
reveal band width (scroll) + + +
+ +

How much scroll distance the reveal band spans, starting at reveal band start above — narrow snaps the wordmark into place quickly, wide spreads it into a slower, more gradual materialization.

+
+
+
final segment easing power + + +
+ +

How sharply the very last bit of scroll decelerates into its final position — 1 is a straight line with no easing; higher values slow down more as they approach the end.

+
+
+
free-run threshold (scroll) + + +
+ +

How far down the scroll before the simulation stops replaying deterministically and starts free-running instead (continuing to sweep at the final temperature and field, so pixels keep churning while the letters hold). Scrolling back up above this line returns to deterministic replay.

+
+
crystallisation agreement: computing…
+ + + +
+ + diff --git a/site/src/pages/index.astro b/site/src/pages/index.astro index b03edce1..38fb3bc2 100644 --- a/site/src/pages/index.astro +++ b/site/src/pages/index.astro @@ -34,6 +34,7 @@ // `scrolling_back_up_out_of_free_run_reproduces_the_identical_deterministic_frame` // and `drifting_from_a_mid_scroll_sweep_moves_without_disturbing_the_replay`). import PageHead from "../components/PageHead.astro"; +import TunePanel from "../components/TunePanel.astro"; import { headerNav, footerNav, navAttrs } from "../config/nav"; import { landingBeats } from "../data/landing-beats"; import { siteDescription, siteName } from "../data/meta"; @@ -190,36 +191,6 @@ const scrollerHeightVh = scrollBeats.length * BEAT_SPACING_VH + SCROLLER_TAIL_VH display: none; } - /* Tuning panel (?tune=1 only) — see site/README.md for how the owner - uses this to find a new setting and report it back as a config.ts - edit. */ - #tune-panel { display: none; position: fixed; z-index: 8; top: 0; right: 0; - bottom: 0; width: min(320px, 90vw); overflow-y: auto; background: rgba(5,16,10,0.96); - border-left: 2px solid var(--accent); padding: 14px 16px 24px; font-size: 11.5px; } - body.tune-mode #tune-panel { display: block; } - #tune-panel h2 { font-size: 12px; margin: 0 0 10px; color: var(--accent); - text-transform: uppercase; letter-spacing: 0.06em; } - #tune-panel .field { margin-bottom: 14px; } - #tune-panel .field-label { display: flex; justify-content: space-between; gap: 8px; - color: var(--dim); margin-bottom: 2px; } - #tune-panel .field-label .val-group { display: inline-flex; align-items: center; gap: 4px; } - #tune-panel .field-label .val { color: var(--ink); font-variant-numeric: tabular-nums; } - #tune-panel input[type="range"] { width: 100%; } - #tune-panel .desc { margin: 4px 0 0; color: var(--dim); font-size: 10.5px; - line-height: 1.4; } - #tune-panel .slider-reset { background: transparent; border: none; - color: var(--dim); font-size: 13px; line-height: 1; cursor: pointer; - opacity: 0.25; padding: 0 1px; } - #tune-panel .slider-reset:hover { color: var(--ink); opacity: 1; } - #tune-panel .slider-reset.changed { opacity: 1; color: var(--accent); } - #tune-panel .agreement { margin: 14px 0; padding: 8px 10px; border: 1px solid var(--dim); } - #tune-panel .agreement.warn { border-color: var(--warn); color: var(--warn); } - #tune-panel .settings-line { width: 100%; font: 10.5px/1.4 ui-monospace, monospace; - background: var(--ground); color: var(--ink); border: 1px solid var(--dim); - padding: 6px; resize: vertical; } - #tune-panel button { margin-top: 8px; background: transparent; color: var(--ink); - border: 1px solid var(--dim); padding: 5px 10px; font: inherit; cursor: pointer; } - #tune-panel button:hover { border-color: var(--accent); color: var(--accent); } @@ -285,104 +256,7 @@ const scrollerHeightVh = scrollBeats.length * BEAT_SPACING_VH + SCROLLER_TAIL_VH -
-

tuning (dev only)

-
-
start temperature - - -
- -

How hot the lattice starts, before any cooling begins — higher makes the opening noise look more scrambled and less clustered.

-
-
-
cooling floor temperature - - -
- -

The coolest the lattice gets on its way down, before the hold and the reveal — lower gives tighter, calmer clusters more time to settle during the dwell.

-
-
-
hold length (before reveal) - - -
- -

How much of the anneal passes at a steady, held temperature before the wordmark starts pulling itself together. This is when the field turns on in the underlying physics, not just a visual cue — reveal start/width below only make sense relative to it.

-
-
-
field ramp width - - -
- -

How gradually the letterform's pull strengthens after hold length above ends — small snaps to full strength almost immediately, large lets it build slowly across more of the remaining anneal.

-
-
-
field strength - - -
- -

How hard the field pulls lattice cells into the wordmark's shape once it's active — higher makes the letters assert themselves faster and more forcefully over whatever pattern already formed.

-
-
-
annealing plateau temperature - - -
- -

How much thermal noise remains once the field is pulling cells into letters — higher keeps the reveal looking lively and textured instead of freezing into flat, static shapes.

-
-
-
sweeps per scroll (total sweeps) - - -
- -

How many simulation steps the whole scroll covers — more steps means each point of scroll shows a finer-grained slice of the process, including the reveal itself.

-
-
-
reveal band start (scroll) - - -
- -

Where in the scroll (0 = top, 1 = bottom) the reveal band begins — together with reveal band width below, this sets the stretch of scrolling during which the wordmark actually appears.

-
-
-
reveal band width (scroll) - - -
- -

How much scroll distance the reveal band spans, starting at reveal band start above — narrow snaps the wordmark into place quickly, wide spreads it into a slower, more gradual materialization.

-
-
-
final segment easing power - - -
- -

How sharply the very last bit of scroll decelerates into its final position — 1 is a straight line with no easing; higher values slow down more as they approach the end.

-
-
-
free-run threshold (scroll) - - -
- -

How far down the scroll before the simulation stops replaying deterministically and starts free-running instead (continuing to sweep at the final temperature and field, so pixels keep churning while the letters hold). Scrolling back up above this line returns to deterministic replay.

-
-
crystallisation agreement: computing…
- - - -
+ {import.meta.env.DEV && }