scene: rebuild only for a different drawn sky; URL-steered night sky within the Night backdrop (+ link readability numbers) #55

Merged
void merged 2 commits from void/sky-link-readability into dev 2026-11-10 01:32:04 +00:00
Member

Two low items from #54, the Night link token, and the measured numbers for the Dusk link question. Nothing here was seen rendered; no vite production build was run. Checked with vitest (586/586 over the whole unit suite), prettier, eslint; tsc shows one error in the touched test file that is on dev as well (skyForState.test.ts(31,27)).

1. A rebuild is for a different drawn sky (index.ts)

The rebuild key was choice:resolved, so picking Day while the clock says day, or Auto to the state it resolves to, tore the scene down and rebuilt it with identical sky options. The key is now the options the scene is built from (terrainSkyFor / ridgeSkyFor). The page URL steers only 'auto', so with a URL the options differ and it still rebuilds. If the skyForState chunk fails to load there is no key and every change rebuilds (as before). The old test that required a rebuild for auto -> night at midnight now says it does not; the dispose test now says a rebuild disposed before it starts builds nothing. Not covered by a test: a URL-steered terrain scene rebuilding on Auto -> explicit (the index tests mock the ridge scene only).

2. A URL-steered sky at night no lighter than the Night backdrop (skyBand.ts, skyState.ts)

Measured on dev a6364af8 at local midnight, terrainDrawn('auto') lightest (8-bit step up): no URL 0.0817; ?sun=60, ?sun=10, ?sky=noonday, ?sun=2&az=250 all 0.0890. The Night constant the text was checked against is 0.081705, so a steered sky was lighter than the sky behind the recorded ratios (still under the 0.0931 text bound: text 4.63 at 0.0890). The Night band ceiling was 0.085; it is now 0.077394 (the grey whose one-step-up reading equals the baked night's own lightest). After: every steered case reads 0.0816 or less, the explicit night sky is unchanged in look (clip under 1e-4), and BACKDROPS.night.lightest is 0.081642 (was 0.081705) with the constant test now covering the steered case. The recorded ratios in skyTheme.test.ts are unchanged at two decimals.

Midnight Sky's link was #609385 (luminance 0.2505), 2.28:1 on the lightest Night sky. It is now brightened in its own hue (163 degrees, as before) until its luminance is at least AA * (0.081642 + 0.05) - 0.05 = 0.5424: #8ad1bd, luminance 0.5468. Only the link changes in baked.ts (npm run bake:sky); user colours are unchanged. Ratios of the new link, WCAG:

backdrop luminance old #609385 new #8ad1bd
Night band, lightest (constant, incl. URL-steered) 0.081642 2.28 4.53
Night band, darkest 0.059870 2.73 5.43
sign-in card / plate fill #0a090e 0.0029 5.68 11.28

The Night link clears AA across the full Night band (0.0599..0.0816); the margin at the lightest end is 0.03. NIGHT_SKY_LIGHTEST in skyTokens.js is the Night backdrop constant, and skyTheme.test.ts fails if the two drift. The contrast table, the plate table and the comments in skyTheme.ts and auth/styles.css.ts are updated. skyTokens.js already failed prettier --check on dev (the ${ n} spacing, lines I did not touch); my lines pass.

4. Dusk: untouched, numbers

Dusk link #2a4f27 is 3.17:1 at the darkest dusk sky (0.306); it needs a backdrop of at least 0.4554. Dusk 0.306..0.965 in the 0-3 degree band and 0.306..0.704 in the 15-18 band, the dark side being the floor-lifted anti-sun side at every elevation. A blur plus tint would need about 90% of a light tint to lift 0.306 to 0.455, i.e. an opaque slab, so the proposed fix is a Dusk floor near 0.475 (0.4554 plus the 8-bit and dither margin), which is Nibu's to rule; not in this PR. Day: link 4.55:1 at the darkest day sky 0.461, passes. Text clears 4.5 in all three states.

Nothing here was seen rendered and no vite production build was run.

🤖 Generated with Claude Code

Two low items from #54, the Night link token, and the measured numbers for the Dusk link question. Nothing here was seen rendered; no vite production build was run. Checked with vitest (586/586 over the whole unit suite), prettier, eslint; `tsc` shows one error in the touched test file that is on dev as well (`skyForState.test.ts(31,27)`). ## 1. A rebuild is for a different drawn sky (`index.ts`) The rebuild key was `choice:resolved`, so picking Day while the clock says day, or Auto to the state it resolves to, tore the scene down and rebuilt it with identical sky options. The key is now the options the scene is built from (`terrainSkyFor` / `ridgeSkyFor`). The page URL steers only 'auto', so with a URL the options differ and it still rebuilds. If the skyForState chunk fails to load there is no key and every change rebuilds (as before). The old test that required a rebuild for auto -> night at midnight now says it does not; the dispose test now says a rebuild disposed before it starts builds nothing. Not covered by a test: a URL-steered terrain scene rebuilding on Auto -> explicit (the index tests mock the ridge scene only). ## 2. A URL-steered sky at night no lighter than the Night backdrop (`skyBand.ts`, `skyState.ts`) Measured on dev a6364af8 at local midnight, `terrainDrawn('auto')` lightest (8-bit step up): no URL 0.0817; `?sun=60`, `?sun=10`, `?sky=noonday`, `?sun=2&az=250` all 0.0890. The Night constant the text was checked against is 0.081705, so a steered sky was lighter than the sky behind the recorded ratios (still under the 0.0931 text bound: text 4.63 at 0.0890). The Night band ceiling was 0.085; it is now 0.077394 (the grey whose one-step-up reading equals the baked night's own lightest). After: every steered case reads 0.0816 or less, the explicit night sky is unchanged in look (clip under 1e-4), and `BACKDROPS.night.lightest` is 0.081642 (was 0.081705) with the constant test now covering the steered case. The recorded ratios in `skyTheme.test.ts` are unchanged at two decimals. ## 3. Night link token (`src/sky/skyTokens.js`, `baked.ts`) Midnight Sky's link was #609385 (luminance 0.2505), 2.28:1 on the lightest Night sky. It is now brightened in its own hue (163 degrees, as before) until its luminance is at least AA * (0.081642 + 0.05) - 0.05 = 0.5424: **#8ad1bd, luminance 0.5468**. Only the link changes in `baked.ts` (`npm run bake:sky`); user colours are unchanged. Ratios of the new link, WCAG: | backdrop | luminance | old #609385 | new #8ad1bd | |---|---|---|---| | Night band, lightest (constant, incl. URL-steered) | 0.081642 | 2.28 | **4.53** | | Night band, darkest | 0.059870 | 2.73 | **5.43** | | sign-in card / plate fill #0a090e | 0.0029 | 5.68 | 11.28 | The Night link clears AA across the full Night band (0.0599..0.0816); the margin at the lightest end is 0.03. `NIGHT_SKY_LIGHTEST` in `skyTokens.js` is the Night backdrop constant, and `skyTheme.test.ts` fails if the two drift. The contrast table, the plate table and the comments in `skyTheme.ts` and `auth/styles.css.ts` are updated. `skyTokens.js` already failed `prettier --check` on dev (the `${ n}` spacing, lines I did not touch); my lines pass. ## 4. Dusk: untouched, numbers Dusk link #2a4f27 is 3.17:1 at the darkest dusk sky (0.306); it needs a backdrop of at least 0.4554. Dusk 0.306..0.965 in the 0-3 degree band and 0.306..0.704 in the 15-18 band, the dark side being the floor-lifted anti-sun side at every elevation. A blur plus tint would need about 90% of a light tint to lift 0.306 to 0.455, i.e. an opaque slab, so the proposed fix is a Dusk floor near 0.475 (0.4554 plus the 8-bit and dither margin), which is Nibu's to rule; not in this PR. Day: link 4.55:1 at the darkest day sky 0.461, passes. Text clears 4.5 in all three states. Nothing here was seen rendered and no vite production build was run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
scene: a rebuild is for a different drawn sky; a URL-steered night sky stays within the Night backdrop
Some checks failed
Build pull request / Build pull request (pull_request) Has been cancelled
7bc28f9256
Rebuild key: the sky options the scene is built from (terrainSkyFor / ridgeSkyFor), not the pair of choice and
resolved state, so picking Day while the clock says day, or Auto to the state it resolves to, no longer tears down
and rebuilds the scene. A URL steers only 'auto', so there the options differ and it still rebuilds.

Night: the band ceiling 0.085 let a sky the page URL steers (?sun=, ?sky=) show up to 0.0890, lighter than the
Night constant 0.081705 the text was checked against. The ceiling is now 0.077394, the luma at which one 8-bit
step up reads the baked night's own lightest, and the constant (0.081642) covers the steered case; a test pins it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sky: Midnight Sky's link is fitted to clear AA on the lightest Night sky
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m16s
2c271c6ded
The dark theme's link was #609385 (luminance 0.2505), 2.28:1 on the lightest Night sky (0.081642). It is now
brightened in its own hue until its luminance is at least AA * (0.081642 + 0.05) - 0.05 = 0.5424: #8ad1bd (0.5468,
hue 163 degrees as before), 4.53:1 on the lightest Night sky, 5.43:1 on the darkest, 11.28:1 on the sign-in card
(was 5.68). Only the link changes in baked.ts; the user colours are unchanged. NIGHT_SKY_LIGHTEST is the Night backdrop
constant, and a test fails if the two drift. Dusk is untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
void merged commit afae8a13c9 into dev 2026-11-10 01:32:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Ratatoskr!55
No description provided.