Commit81201ccunknown_key
ui: kill deploy-pill flash + flip default theme to light (professional)
ui: kill deploy-pill flash + flip default theme to light (professional) Two visible-from-the-nav fixes user flagged today. ## Deploy pill no longer flashes "No deploys yet" `src/views/layout.tsx` — the placeholder state was the flash. Every admin page load rendered "No deploys yet" in the nav and the SSE reconnect/onmessage cycle re-painted it, producing the looping symptom even after the exponential-backoff fix landed. New behaviour: the pill stays `display:none` until a real deploy event arrives. No placeholder, no flash. The pill reveals itself the moment the first real status fires from /admin/deploys/latest.json or the platform:deploys SSE topic. ## Default theme is now light, not dark `src/views/layout.tsx`, `src/routes/pwa.ts` — operator feedback was the dark default felt gamer-ish, not what platform engineers expect from a tool they'd evaluate alongside Vercel / Linear / Stripe. SSR default + pre-paint script + /offline.html all flipped from "dark" to "light". Users with the explicit `theme=dark` cookie keep their preference; only un-cookied visitors see the new default. The light-theme tokens were already shipped (BLOCK U/U2) and look correct against the existing component CSS — no other style changes needed. Test suite: 1994 pass / 0 fail / 2 skip. push.test offline assertion updated to match the new default. https://claude.ai/code/session_01QFLWDxWw65DX6enMcS5Lwe
3 files changed+16−981201cc45e3cf3780c98bb1cf6da14bb38667420
3 changed files+16−9
Modifiedsrc/__tests__/push.test.ts+1−1View fileUnifiedSplit
@@ -470,6 +470,6 @@ describe("/offline.html", () => {
470470 expect(res.headers.get("content-type") || "").toContain("text/html");
471471 const body = await res.text();
472472 expect(body).toContain("You're offline");
473 expect(body).toContain('data-theme="dark"');
473 expect(body).toContain('data-theme="light"');
474474 });
475475});
Modifiedsrc/routes/pwa.ts+1−1View fileUnifiedSplit
@@ -311,7 +311,7 @@ pwa.get("/sw-push.js", (c) => {
311311
312312/** Offline fallback — minimal, theme-consistent. */
313313export const OFFLINE_HTML = `<!doctype html>
314<html lang="en" data-theme="dark">
314<html lang="en" data-theme="light">
315315<head>
316316<meta charset="utf-8" />
317317<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Modifiedsrc/views/layout.tsx+14−7View fileUnifiedSplit
@@ -39,7 +39,11 @@ export const Layout: FC<
3939 siteBannerText,
4040 siteBannerLevel,
4141}) => {
42 const initialTheme = theme === "light" ? "light" : "dark";
42 // Default to "light" — feedback from operators was the dark default
43 // felt too gamer-ish and not what senior platform engineers expect from
44 // a tool they'd evaluate alongside Vercel / Linear / Stripe. Users who
45 // explicitly want dark can flip via the theme toggle (cookie persists).
46 const initialTheme = theme === "dark" ? "dark" : "light";
4347 const build = getBuildInfo();
4448 // L10 — when `fullTitle` is provided, use it verbatim (no " — gluecron"
4549 // suffix); otherwise fall back to the existing `title` + suffix behaviour.
@@ -413,10 +417,12 @@ export const deployPillScript = `
413417 function render(){
414418 if (!pill || !text || !dot) return;
415419 var d = state.latest;
420 // When there's no deploy event yet, keep the pill HIDDEN. Showing
421 // "No deploys yet" was visible noise on every admin page load and
422 // flashed during reconnect cycles — admins don't need a placeholder.
423 // The pill reveals itself the first time a real deploy fires.
416424 if (!d) {
417 pill.className = 'nav-deploy-pill deploy-pill-empty';
418 text.textContent = 'No deploys yet';
419 pill.style.display = 'inline-flex';
425 pill.style.display = 'none';
420426 return;
421427 }
422428 pill.style.display = 'inline-flex';
@@ -515,13 +521,14 @@ export const deployPillScript = `
515521`;
516522
517523// Runs before paint — reads the theme cookie and flips data-theme so there's
518// no dark-to-light flash on load. SSR default is dark.
524// no light-to-dark flash on load. SSR default is "light"; cookie-set "dark"
525// is honoured for users who explicitly opted in.
519526const themeInitScript = `
520527 (function(){
521528 try {
522529 var m = document.cookie.match(/(?:^|; )theme=([^;]+)/);
523 var t = m ? decodeURIComponent(m[1]) : 'dark';
524 if (t !== 'light' && t !== 'dark') t = 'dark';
530 var t = m ? decodeURIComponent(m[1]) : 'light';
531 if (t !== 'light' && t !== 'dark') t = 'light';
525532 document.documentElement.setAttribute('data-theme', t);
526533 } catch(_){}
527534 })();
528535