Skip to content

Fix illegible 2D panel text after closing the 3D temporal view#47

Merged
IanMayo merged 1 commit into
mainfrom
claude/compassionate-maxwell-mvRaE
Jun 6, 2026
Merged

Fix illegible 2D panel text after closing the 3D temporal view#47
IanMayo merged 1 commit into
mainfrom
claude/compassionate-maxwell-mvRaE

Conversation

@IanMayo

@IanMayo IanMayo commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Open the 3D temporal view, then close it: the text on the 2D map's side panels turns near-white and becomes illegible.

Root cause

TemporalView is lazy-loaded (App.tsx) and imports temporal.css. Vite injects that stylesheet into the document <head> the first time the view opens — and never removes it on unmount (this is how ESM/Vite CSS imports behave; the <style>/<link> lives for the page's lifetime).

temporal.css contained a global rule:

body {
  background: #0b0e14;
  color: #e6edf3;   /* near-white */
  font: 13px/1.45 system-ui, ...;
}

The 2D app (app.css) sets its text colour only on :root (color: var(--ink)), which is an inherited value. The leaked body { color: #e6edf3 } sets the colour directly on <body>, overriding the inherited dark colour for every panel element that doesn't declare its own → illegible near-white text.

Fix

Move the dark theme (background / color / font) off the global body selector onto .temporal-root:

  • .temporal-root is position: fixed; inset: 0, so it fills the viewport exactly as before — the in-app and standalone (temporal3d.html) views look identical.
  • Every temporal control (panel, time-wheel, close button) is a descendant of .temporal-root, so they still inherit the light text colour.
  • .temporal-root only exists while the view is mounted, so closing it removes the styling entirely — nothing leaks into the 2D app.

The standalone temporal3d.html gets its own page-local body background so it keeps its dark chrome (and avoids a load flash); being a separate HTML entry, it can't leak into the 2D app.

Verification

npm run typecheck, npm run lint, npm run test:run (139 passed) and npm run build all pass.

https://claude.ai/code/session_01RW3REtky9hbgJRDwSVw1h3


Generated by Claude Code

The lazily-loaded TemporalView imports temporal.css, which Vite injects
globally on first open and never removes on unmount. Its `body { color:
#e6edf3 }` rule therefore persisted after the 3D view was closed, and —
since the 2D app sets its text colour only on :root (inherited) — the
near-white body colour overrode it, turning the side-panel text illegible.

Move the dark background/colour/font onto `.temporal-root` (fixed, inset:0,
and the ancestor of every temporal control), so the theme only applies while
the view is mounted and disappears with it. The standalone temporal3d.html
gets its own body background so it keeps its dark chrome with no flash.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-06 15:22 UTC

@IanMayo IanMayo merged commit 6189792 into main Jun 6, 2026
4 checks passed
@IanMayo IanMayo deleted the claude/compassionate-maxwell-mvRaE branch June 6, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants