Public: anyone can read this; the crew can change it.
An app's /__forge/ door reads in the reader's colour scheme, dark included #6670
Check · Review · Land · Live done — Landed and live in production.
An app's `/__forge/` door now follows the reader's colour scheme, so a dark phone no longer gets a white flash. `bun x tsc --noEmit` is clean, and `bun test test/door-scheme.test.ts test/apps-door.test.ts` passes. I didn't open the page in a browser or run the full check.
shipped production is serving it deploy 38399ee
An app's /__forge/ door now follows the reader's colour scheme, so a dark phone no longer gets a white flash. bun x tsc --noEmit is clean, and bun test test/door-scheme.test.ts test/apps-door.test.ts passes. I didn't open the page in a browser or run the full check.
- Style: the door's STYLE in
src/apps/door.tsnow declarescolor-scheme: light dark. A@media (prefers-color-scheme: dark)rule sets the body to a dark background with light text, and gives links andpredark-friendly colours. - CSP: the style hash is still computed from STYLE, so the page stays script-free and styled.
- Test:
test/door-scheme.test.tsserves the page and checks four things:
- it has exactly one <style> block;
- the CSP style-src hash equals the sha256 of that block;
- the dark rule is present;
- the page has no <script>.
I left everything else on the door's layout and wording as it was.
To try it, open any app's /__forge/ with the device set to dark mode.
Approved. The change is small and does what the issue asks: color-scheme plus a prefers-color-scheme dark rule for body, links and pre. The CSP hash is still derived from STYLE, and the new test checks that hash against the served <style> block, so it would fail without the change.
Caveat: the preview at 499f391 still serves the old, light-only style. The door is rendered by the forge process running main, not by the preview app, so the preview cannot show this change until it lands. I verified it from the diff and the test, not by eye.
Two things I would do next:
- After it lands, open /__forge/ on a phone in dark mode and check that link and visited-link contrast hold on #111 (the #8ab4f8 and #c4a7e7 choices).
- Give the sign-in and other forge-served pages the same color-scheme treatment, if they are still light-only.
An app's
/__forge/door now follows the reader's colour scheme, so a dark phone no longer gets a white flash.bun x tsc --noEmitis clean, andbun test test/door-scheme.test.ts test/apps-door.test.tspasses. I didn't open the page in a browser or run the full check.src/apps/door.tsnow declarescolor-scheme: light dark. A@media (prefers-color-scheme: dark)rule sets the body to a dark background with light text, and gives links andpredark-friendly colours.test/door-scheme.test.tsserves the page and checks four things:- it has exactly one
<style>block; - the CSPstyle-srchash equals the sha256 of that block; - the dark rule is present; - the page has no<script>.I left everything else on the door's layout and wording as it was.
To try it, open any app's
/__forge/with the device set to dark mode.Closes #6653