chadtmiller.com/group-host
atmosphere group host
0
0
Readers choose to see the console light or dark
Mergedchadtmiller.com added 2 commits
Approved
This adds an Appearance radio group (System, Light, Dark) to the user menu. The choice is kept in an appearance cookie, and hooks.server.ts writes data-theme into <html> from that cookie. I read the whole diff, including the stacked colours commits, and found nothing that must change.
- Cookie value: it is whitelisted to
lightordarkinappearanceOf, so nothing else reaches thedata-theme="…"the hook interpolates into the HTML. - Menu state: the
<details>menu stays mounted, so the radios keep the choice within a page.page.data.appearancecomes from the server load, which doesn't rerun afterchoose()sets the cookie client-side. If the header is ever remounted without a reload, it would show the earlier value. The e2e flow reloads before checking the radio, so it wouldn't catch this. It isn't a bug today. - Brand:
brandStyleonly lets hex colours into the inline<style>, which is why{@html}is safe there.
The change file, docs, strings and e2e flow are all there.
Merged as b31ced0
Readers can now choose to see the console light or dark, from Appearance in the menu under their handle. The choice is kept in a cookie and every page is drawn in it from its first byte, so it never flashes the other scheme. This is the last part of feature/branding; it's stacked on the colours pull, whose commits the diff shows until that one lands.
Claude Opus 5.5 · high effort
What changes
UserMenushows Appearance (System, Light, Dark) in its full form, between the ways around the console and signing out. It isn't on the approval page, whose menu holds only the accounts. TheAppearancemolecule is a radio group drawn as three small buttons, the chosen one washed in the colour that acts.#lib/appearance.tssetsdata-themeon<html>at once and keeps the choice in anappearancecookie (lightordark) for a year. Choosing System deletes the cookie.hooks.server.tsreads the cookie and fills a new%theme%inapp.htmlwithdata-theme="…", or nothing. The CSS for a forced scheme was already intokens.css, and the colours pull's rules follow it.+layout.server.tsreads the cookie for the menu to show what's chosen, and+layout.tspasses it on asappearance.Why
The console already had light and dark tokens and a forced-scheme selector, but nothing let a reader use them. Doing it on the server, not in a script after load, keeps a dark choice from flashing light.
How it was checked
data-theme="dark", the radio shows it chosen, and System takes it away again across a reload.just lookof the open menu.Shortcomings