From c115ea10797419170cf01feaeaa1d9bc618858e5 Mon Sep 17 00:00:00 2001 From: Alec Ondo Date: Mon, 9 Nov 2026 16:39:26 -0500 Subject: [PATCH 1/6] =?UTF-8?q?feat(web):=20the=20page=20fades=20in=20once?= =?UTF-8?q?=20on=20arrival=20=E2=80=94=20main=20and=20footer,=20opacity=20?= =?UTF-8?q?only,=20500=20ms=20on=20--ease-out=20under=20a=20still=20top=20?= =?UTF-8?q?bar,=20one=20theme=20rule=20for=20all=20eleven=20surfaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `main, footer { animation: arrive 500ms var(--ease-out) both }` in the theme, copied to the five apps and linked by the static pages. Every surface renders one `main` and one `footer`, so the one rule is the whole site's arrival; in an app it plays when React mounts `main`, which is the first moment there is anything to see. A tab or view changing inside a page does not replay it, because `main` stays mounted. - Opacity only: the chip stays the one thing that moves on load. Under reduced motion the same fade is kept, restated by name, as the gentler variant rather than nothing. - `web/DESIGN.md`: "Nothing moves on load" becomes "nothing moves on load; the page fades in once", the arrival joins the allowlist, and the duration rule names it. - `tests/test_ui_standard.py`: `main` enters EXPLANATORY for running past 300 ms; `test_the_page_fades_in_once_on_arrival` holds its shape (one-shot, the ease-out token, a keyframe that moves nothing, kept under reduced motion); the allowlist's selector boundary is now two-sided, so `main` does not exempt `.split-main`. - Checked in Chrome on the homepage, Rules and the built rung 0 app: at 90 ms the content sits at 0.64 opacity under a top bar already at 1. --- tests/test_ui_standard.py | 60 ++++++++++++++++++++++++++++++++++-- web/DESIGN.md | 8 +++-- web/rung0-viz/src/theme.css | 37 +++++++++++++++++++++- web/rung1-viz/src/theme.css | 37 +++++++++++++++++++++- web/rung2-viz/src/theme.css | 37 +++++++++++++++++++++- web/rung3-viz/src/theme.css | 37 +++++++++++++++++++++- web/solver-viz/src/theme.css | 37 +++++++++++++++++++++- 7 files changed, 243 insertions(+), 10 deletions(-) diff --git a/tests/test_ui_standard.py b/tests/test_ui_standard.py index 2fd6a952..444fdeb3 100644 --- a/tests/test_ui_standard.py +++ b/tests/test_ui_standard.py @@ -55,15 +55,23 @@ # itself, a section arriving on scroll, a status pulse. Each is allowed to # exceed 300 ms, to own a curve, or to animate a layout property — and each # says why. Matched inside the rule's selector at a selector boundary, so -# `.sweep` covers `.sweep.from-you` but not `.sweeper`. An entry must still +# `.sweep` covers `.sweep.from-you` but not `.sweeper`, and `main` not `.split-main`. An entry must still # match a rule that moves; the first test below refuses a ghost. EXPLANATORY = { ".live i": "the archived Cover's live dot, a 2 s constant pulse", ".st::before": "the archived Cover's in-progress dot pulse on its ladder", ".sweep": "rungs 2 and 3's chips crossing 58 px of felt to the pot, one-shot, 400 ms", ".rungs-menu": "the old chrome's Rungs menu animates width on purpose; only the archived Cover still inlines it", + "main": "the page's content and footer fading in once on arrival, opacity only, 500 ms (`test_the_page_fades_in_once_on_arrival`)", } +# The arrival: the one entrance every page plays. Opacity only, so the chip +# stays the one thing that moves on load; one-shot; the ease-out token; and +# the same fade under reduced motion, because a fade is the gentler variant, +# not the thing to remove. +ARRIVAL = ("main", "footer") +ARRIVAL_MS = 500 + # Every pressable thing, per stylesheet. A pressable has `.x:active` with a # scale in range and `transform` in its base transition list. PRESSABLES = { @@ -145,7 +153,7 @@ def declarations(self, prop: str) -> list[str]: @property def explanatory(self) -> bool: return any( - re.search(rf"{re.escape(key)}(?![\w-])", self.selector) for key in EXPLANATORY + re.search(rf"(? list[str]: @pytest.mark.parametrize("key", sorted(EXPLANATORY)) def test_every_allowlisted_selector_names_a_rule_that_moves(key: str) -> None: """An entry that exempts nothing is a ghost, and a ghost hides the next real exception.""" - pattern = rf"{re.escape(key)}(?![\w-])" + pattern = rf"(? None: assert moving, f"EXPLANATORY names {key!r}, which matches no rule that moves; delete the entry" +# ------------------------------------------------------------- the arrival + + +def _arrival_rules(name: str, reduced: bool) -> list[Rule]: + """The rules of a sheet that name every `ARRIVAL` selector and animate.""" + return [ + r + for r in RULES[name] + if _reduced(r) is reduced + and set(ARRIVAL) <= _parts(r.selector) + and any(v.strip() != "none" for v in r.declarations("animation")) + ] + + +def test_the_page_fades_in_once_on_arrival() -> None: + """One theme rule fades `main` and `footer` in on arrival, and only fades them. + + Every surface renders one `main` under the still top bar (the generator's + shell and the five apps' `App.tsx`), so the rule reaches the whole site + from the theme. It is opacity only, so the chip stays the one thing that + *moves* on load; it is one-shot, on the ease-out token, `ARRIVAL_MS` long; + and under reduced motion the same selectors keep a fade-only keyframe + rather than going dark, because a fade is the gentler variant. + """ + frames = KEYFRAMES["theme"] + moving = "|".join(MOVING_IN_KEYFRAMES) + for reduced in (False, True): + rules = _arrival_rules("theme", reduced) + where = "under reduced motion" if reduced else "in the chrome" + assert rules, f"theme: no rule animates {ARRIVAL} {where}" + for rule in rules: + for value in rule.declarations("animation"): + keyframe, loops = _animation_name_and_loops(value) + assert not loops, f"theme: {rule!r} loops; the arrival plays once" + assert "var(--ease-out)" in value, f"theme: {rule!r} does not read var(--ease-out)" + assert _durations_ms(value) == [ARRIVAL_MS], ( + f"theme: {rule!r} runs `{value}`; the arrival is {ARRIVAL_MS} ms with no delay" + ) + body = frames.get(keyframe) + assert body is not None, f"theme: @keyframes {keyframe} is not defined in the theme" + assert "opacity" in body, f"theme: @keyframes {keyframe} does not fade" + assert not re.search(rf"(?:^|[;{{\s])({moving})\s*:", body), ( + f"theme: @keyframes {keyframe} moves something; the arrival is opacity only" + ) + + # -------------------------------------------------------------- the tokens diff --git a/web/DESIGN.md b/web/DESIGN.md index e4b1f873..a6c898c6 100644 --- a/web/DESIGN.md +++ b/web/DESIGN.md @@ -116,7 +116,7 @@ Chrome never does. screen → `--ease-in-out`. Colour under the pointer → `ease`. Constant → `linear`. 4. **How long?** Press 160 ms. Hover colour 150 ms. Popover and sheet - 150–250 ms. Nothing in the chrome over 300 ms per declaration — and the + 150–250 ms. The page's arrival 500 ms, once. Nothing else in the chrome over 300 ms per declaration — and the test reads every time in the declaration, delays included, because a 300 ms delay is a wait the user feels just as a 300 ms slide is. Exits faster than entrances. @@ -130,7 +130,7 @@ Chrome never does. | Entrances use `--ease-out`, never `ease-in` | rung 2's chips (and rung 3's) swept to the pot with `0.55s ease-in` | `.sweep`: `0.4s var(--ease-out)` | a chip pushed across felt leaves fast and settles; ease-in made it hesitate then lurch | | Chrome motion stays under 300 ms per declaration | — | the presses at 160 ms, hover colour at 150 ms, the solver's panes sheet (`.sheet`) arriving over 200 ms | a 180 ms dropdown feels more responsive than a 400 ms one, at the same frame rate | | Exits are faster than entrances; a cascade staggers 30–80 ms and never blocks | — | nothing on the site exits or staggers today; the first one added follows this | the user has decided; the page just answers | -| Nothing moves on load | the homepage's sections rose in on scroll (`.reveal`, 700 ms) | the static pages render still; the chip turning is the one thing that moves without being asked | a page that performs on arrival reads as a demo | +| Nothing moves on load; the page fades in once | the homepage's sections rose in on scroll (`.reveal`, 700 ms) | `main` and `footer` fade in from the paper under the top bar, opacity only, 500 ms on `--ease-out` (`arrive`), once per page and never again inside it; the chip turning is the one thing that moves without being asked | a page that performs on arrival reads as a demo; a page that is simply there, a beat after the chrome, reads as a page turning | | Hover transforms only where a pointer can hover | an arrow on the old front page nudged 4 px on `:hover`, which a tap leaves stuck out | no hover on the site moves anything; one that does goes inside `@media (hover: hover) and (pointer: fine)` | touch fires hover on tap and never un-fires it | | Reduced motion means fewer and gentler, not none | `* { animation: none !important; transition: none !important }` in the theme | the presses, the sweep and the sheet are quieted by name; colour transitions stay; the chip is drawn once (`mark.ts` and `chip.js` read the same query) | a state change still has to be legible to someone who turned motion off | | Reduced motion names the state's own selector, not just the base one | — | the theme quiets `.btn:active:not(:disabled)`, not `.btn:active` | `:not(:disabled)` adds specificity, so quieting the bare `:active` would leave the press in place | @@ -149,6 +149,10 @@ fails on an entry that exempts nothing): - `.sweep`: rungs 2 and 3's chips crossing 58 px of felt to the pot, one-shot, 400 ms; +- `main`: the arrival, `main` and `footer` fading in once per page, opacity + only, 500 ms (`test_the_page_fades_in_once_on_arrival` holds its shape: + one-shot, the ease-out token, a keyframe that moves nothing, the same + fade kept under reduced motion); - `.rungs-menu`, `.live i`, `.st::before`: the archived Cover's menu width, live dot and in-progress pulse, kept as they were. diff --git a/web/rung0-viz/src/theme.css b/web/rung0-viz/src/theme.css index 94a18c04..a656f3b8 100644 --- a/web/rung0-viz/src/theme.css +++ b/web/rung0-viz/src/theme.css @@ -15,7 +15,8 @@ * commands; it is never a prose or UI voice. * 3. The chip is the mark: the ASCII chip turning in the top bar, a red * chip with black indents, and again where the footer closes - * the page. Nothing else moves on load. + * the page. Nothing else moves on load: the page's content fades in + * once under the still top bar, opacity only, and that is all. * 4. Figures are titled blocks, not windows: a number, a bold title that * states the finding, a one-line sub-title naming the measure and the * run, the figure, a caption of at most two sentences, on a top hairline. @@ -303,6 +304,33 @@ main { padding-bottom: 40px; } +/* ---------- the arrival -------------------------------------------------- */ + +/* The page's content and its footer fade in once, from the paper, under a top + bar that is already there: opacity only, so the chip stays the one thing + that moves on load, 500 ms on the ease-out curve, which brings the words up + fast and lets the last of the fade settle slowly. Every surface renders one + `main` and one `footer` (the generator's shell, the five apps' App.tsx), so + this one rule is the whole site's arrival; in an app it plays when React + mounts `main`, which is the first moment there is anything to see. It runs + past the chrome's 300 ms on purpose and is allowlisted as `main` in + tests/test_ui_standard.py; a tab or view changing inside a page does not + replay it, because `main` stays mounted. */ +main, +footer { + animation: arrive 500ms var(--ease-out) both; +} + +@keyframes arrive { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + h1, h2, h3 { @@ -1220,4 +1248,11 @@ footer a:hover { .rail a:active { transform: none; } + + /* the arrival is already the gentler variant, a fade with nothing moving; + it stays, restated so the standard's test can see it was kept on purpose */ + main, + footer { + animation: arrive 500ms var(--ease-out) both; + } } diff --git a/web/rung1-viz/src/theme.css b/web/rung1-viz/src/theme.css index 94a18c04..a656f3b8 100644 --- a/web/rung1-viz/src/theme.css +++ b/web/rung1-viz/src/theme.css @@ -15,7 +15,8 @@ * commands; it is never a prose or UI voice. * 3. The chip is the mark: the ASCII chip turning in the top bar, a red * chip with black indents, and again where the footer closes - * the page. Nothing else moves on load. + * the page. Nothing else moves on load: the page's content fades in + * once under the still top bar, opacity only, and that is all. * 4. Figures are titled blocks, not windows: a number, a bold title that * states the finding, a one-line sub-title naming the measure and the * run, the figure, a caption of at most two sentences, on a top hairline. @@ -303,6 +304,33 @@ main { padding-bottom: 40px; } +/* ---------- the arrival -------------------------------------------------- */ + +/* The page's content and its footer fade in once, from the paper, under a top + bar that is already there: opacity only, so the chip stays the one thing + that moves on load, 500 ms on the ease-out curve, which brings the words up + fast and lets the last of the fade settle slowly. Every surface renders one + `main` and one `footer` (the generator's shell, the five apps' App.tsx), so + this one rule is the whole site's arrival; in an app it plays when React + mounts `main`, which is the first moment there is anything to see. It runs + past the chrome's 300 ms on purpose and is allowlisted as `main` in + tests/test_ui_standard.py; a tab or view changing inside a page does not + replay it, because `main` stays mounted. */ +main, +footer { + animation: arrive 500ms var(--ease-out) both; +} + +@keyframes arrive { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + h1, h2, h3 { @@ -1220,4 +1248,11 @@ footer a:hover { .rail a:active { transform: none; } + + /* the arrival is already the gentler variant, a fade with nothing moving; + it stays, restated so the standard's test can see it was kept on purpose */ + main, + footer { + animation: arrive 500ms var(--ease-out) both; + } } diff --git a/web/rung2-viz/src/theme.css b/web/rung2-viz/src/theme.css index 94a18c04..a656f3b8 100644 --- a/web/rung2-viz/src/theme.css +++ b/web/rung2-viz/src/theme.css @@ -15,7 +15,8 @@ * commands; it is never a prose or UI voice. * 3. The chip is the mark: the ASCII chip turning in the top bar, a red * chip with black indents, and again where the footer closes - * the page. Nothing else moves on load. + * the page. Nothing else moves on load: the page's content fades in + * once under the still top bar, opacity only, and that is all. * 4. Figures are titled blocks, not windows: a number, a bold title that * states the finding, a one-line sub-title naming the measure and the * run, the figure, a caption of at most two sentences, on a top hairline. @@ -303,6 +304,33 @@ main { padding-bottom: 40px; } +/* ---------- the arrival -------------------------------------------------- */ + +/* The page's content and its footer fade in once, from the paper, under a top + bar that is already there: opacity only, so the chip stays the one thing + that moves on load, 500 ms on the ease-out curve, which brings the words up + fast and lets the last of the fade settle slowly. Every surface renders one + `main` and one `footer` (the generator's shell, the five apps' App.tsx), so + this one rule is the whole site's arrival; in an app it plays when React + mounts `main`, which is the first moment there is anything to see. It runs + past the chrome's 300 ms on purpose and is allowlisted as `main` in + tests/test_ui_standard.py; a tab or view changing inside a page does not + replay it, because `main` stays mounted. */ +main, +footer { + animation: arrive 500ms var(--ease-out) both; +} + +@keyframes arrive { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + h1, h2, h3 { @@ -1220,4 +1248,11 @@ footer a:hover { .rail a:active { transform: none; } + + /* the arrival is already the gentler variant, a fade with nothing moving; + it stays, restated so the standard's test can see it was kept on purpose */ + main, + footer { + animation: arrive 500ms var(--ease-out) both; + } } diff --git a/web/rung3-viz/src/theme.css b/web/rung3-viz/src/theme.css index 94a18c04..a656f3b8 100644 --- a/web/rung3-viz/src/theme.css +++ b/web/rung3-viz/src/theme.css @@ -15,7 +15,8 @@ * commands; it is never a prose or UI voice. * 3. The chip is the mark: the ASCII chip turning in the top bar, a red * chip with black indents, and again where the footer closes - * the page. Nothing else moves on load. + * the page. Nothing else moves on load: the page's content fades in + * once under the still top bar, opacity only, and that is all. * 4. Figures are titled blocks, not windows: a number, a bold title that * states the finding, a one-line sub-title naming the measure and the * run, the figure, a caption of at most two sentences, on a top hairline. @@ -303,6 +304,33 @@ main { padding-bottom: 40px; } +/* ---------- the arrival -------------------------------------------------- */ + +/* The page's content and its footer fade in once, from the paper, under a top + bar that is already there: opacity only, so the chip stays the one thing + that moves on load, 500 ms on the ease-out curve, which brings the words up + fast and lets the last of the fade settle slowly. Every surface renders one + `main` and one `footer` (the generator's shell, the five apps' App.tsx), so + this one rule is the whole site's arrival; in an app it plays when React + mounts `main`, which is the first moment there is anything to see. It runs + past the chrome's 300 ms on purpose and is allowlisted as `main` in + tests/test_ui_standard.py; a tab or view changing inside a page does not + replay it, because `main` stays mounted. */ +main, +footer { + animation: arrive 500ms var(--ease-out) both; +} + +@keyframes arrive { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + h1, h2, h3 { @@ -1220,4 +1248,11 @@ footer a:hover { .rail a:active { transform: none; } + + /* the arrival is already the gentler variant, a fade with nothing moving; + it stays, restated so the standard's test can see it was kept on purpose */ + main, + footer { + animation: arrive 500ms var(--ease-out) both; + } } diff --git a/web/solver-viz/src/theme.css b/web/solver-viz/src/theme.css index 94a18c04..a656f3b8 100644 --- a/web/solver-viz/src/theme.css +++ b/web/solver-viz/src/theme.css @@ -15,7 +15,8 @@ * commands; it is never a prose or UI voice. * 3. The chip is the mark: the ASCII chip turning in the top bar, a red * chip with black indents, and again where the footer closes - * the page. Nothing else moves on load. + * the page. Nothing else moves on load: the page's content fades in + * once under the still top bar, opacity only, and that is all. * 4. Figures are titled blocks, not windows: a number, a bold title that * states the finding, a one-line sub-title naming the measure and the * run, the figure, a caption of at most two sentences, on a top hairline. @@ -303,6 +304,33 @@ main { padding-bottom: 40px; } +/* ---------- the arrival -------------------------------------------------- */ + +/* The page's content and its footer fade in once, from the paper, under a top + bar that is already there: opacity only, so the chip stays the one thing + that moves on load, 500 ms on the ease-out curve, which brings the words up + fast and lets the last of the fade settle slowly. Every surface renders one + `main` and one `footer` (the generator's shell, the five apps' App.tsx), so + this one rule is the whole site's arrival; in an app it plays when React + mounts `main`, which is the first moment there is anything to see. It runs + past the chrome's 300 ms on purpose and is allowlisted as `main` in + tests/test_ui_standard.py; a tab or view changing inside a page does not + replay it, because `main` stays mounted. */ +main, +footer { + animation: arrive 500ms var(--ease-out) both; +} + +@keyframes arrive { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + h1, h2, h3 { @@ -1220,4 +1248,11 @@ footer a:hover { .rail a:active { transform: none; } + + /* the arrival is already the gentler variant, a fade with nothing moving; + it stays, restated so the standard's test can see it was kept on purpose */ + main, + footer { + animation: arrive 500ms var(--ease-out) both; + } } From a7298bd20b0a24810b7a1b1cec12f5924f19f931 Mon Sep 17 00:00:00 2001 From: Alec Ondo Date: Mon, 9 Nov 2026 16:57:41 -0500 Subject: [PATCH 2/6] fix(web): the arrival's allowlist key is the whole `main, footer` list, so nothing under main is exempt; the fill is backwards, so the fade lets go when it ends; no sheet may quiet it and every surface renders one main and one footer Review findings on #96, in order: 1. `main` as an EXPLANATORY key reached any selector containing the word, so `main .panel { transition: opacity 600ms }` would have passed the 300 ms, easing and layout gates. A key that is itself a selector list now exempts only the rule whose selector is exactly that list; `_exempts` is the one matcher, shared by `Rule.explanatory` and the ghost test. 2. `both` held `to` after the fade; `to` is the page's own state, and an animation left filling forwards keeps a layer and a stacking context in some engines. `backwards`, and the test refuses a forwards fill. 3. A later `animation: none` on `main` or `footer` would have cut the fade without failing the arrival test: `test_no_sheet_quiets_the_arrival`, over every sheet and media block. 4. The allowlist comment re-wrapped. 5. The premise that one theme rule reaches every page is now held by `test_every_surface_renders_one_main_and_one_footer`: one `
` and one `