scene: rebuild only for a different drawn sky; URL-steered night sky within the Night backdrop (+ link readability numbers) #55
Loading…
Reference in a new issue
No description provided.
Delete branch "void/sky-link-readability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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;
tscshows 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
a6364af8at local midnight,terrainDrawn('auto')lightest (8-bit step up): no URL 0.0817;?sun=60,?sun=10,?sky=noonday,?sun=2&az=250all 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), andBACKDROPS.night.lightestis 0.081642 (was 0.081705) with the constant test now covering the steered case. The recorded ratios inskyTheme.test.tsare 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: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_LIGHTESTinskyTokens.jsis the Night backdrop constant, andskyTheme.test.tsfails if the two drift. The contrast table, the plate table and the comments inskyTheme.tsandauth/styles.css.tsare updated.skyTokens.jsalready failedprettier --checkon 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