mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-30 14:58:08 +00:00
The window around a product shot is drawn in tokens and follows the reader's
theme; the picture inside it is pixels and cannot. With one capture per room the
two ended up on opposite grounds, and which way round was an accident of when
the shutter fell. Measured, mean luminance 0–255: the chat plate on the fold was
227 — a white room glaring out of a dark page, which is what a reader reported —
and the Bots plate was 67, a dark rectangle on a light one.
So a room is photographed twice. scripts/room-shots.mjs opens each context with
`colorScheme` and writes chat-960-{light,dark}.webp and bots-1440-{light,dark};
the four now read 226/15 and 243/14. Shot takes the pair's stem and draws both,
and the .hz-shot rules in app/globals.css choose off the `light` class
next-themes stamps on <html> before the first paint — the same signal the ground
rule in app/layout.tsx reads, so the plate is settled in the first style
resolution and no frame shows the wrong one. It cannot be prefers-color-scheme:
the provider declares defaultTheme="dark", so a reader on a light desktop still
gets a dark page, and the dock in the corner overrules the system outright.
Measured with the OS set opposite the stored theme: the class wins in Chromium,
Firefox and WebKit.
ONE PLATE IS FETCHED. The one the theme did not pick has display:none and so
has no box, and a lazy image with no box is never near the viewport, which is
what starts the request. Measured at 390, 960 and 1440 in all three engines,
both ways round: one image per Shot, never the other. That costs the hero its
place in the preload scan — and the hero plate is the LCP element, measured —
which is what `eager` now pays for with fetchpriority rather than with a second
download. 99KB of plates per page either way, against 99KB before.
THE CAPTURE MEASURES WHAT IT GOT. A context whose scheme the room ignored yields
two names for one picture, and nothing downstream can tell. So each pair is read
back — light against dark, and the spread about each mean — and a plate that is
flat is a plate with nothing drawn on it. That caught two real runs: the sample
pass climbs from a test agent's name to the row it sits in while the parent holds
exactly one such name, which never turns false when there is only one in the
whole room, so it walked to <body> and hid the page. It came back a perfectly
light blank and passed every other test. The climb now stops at a quarter of the
room's text, and the room has to still be drawing what said it was ready before
the shutter falls.
Co-authored-by: Hanzo Dev <[email protected]>
64 KiB
2304x1440px
64 KiB
2304x1440px