fix(motifs): readable motif graph in dark mode (#5) #48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/v6.1-graph-dark-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #5 (v6.1).
Problem
The motif graph (
MotifGraph, ReactFlow) was illegible in dark mode: node backgrounds/borders and the background dots were hardcoded light values, and ReactFlow's own chrome (Controls, MiniMap, edges, attribution) had no dark theme, so it rendered as bright elements on the dark page.Fix
colorModefrom the app theme — this applies the library's built-in dark styling to Controls, MiniMap, edges, and the canvas.background/color/borderand theBackgrounddot color for dark.useIsDarkMode()hook that tracks thedarkclass on<html>via aMutationObserver. ReactFlow'scolorModeprop needs a resolved boolean — it can't read Tailwind'sdark:classes — and the hook updates live when the theme is toggled.Test
useIsDarkMode.test.ts— mount state (class absent/present) and live reaction to toggling thedarkclass. (The graph render itself isn't unit-tested — ReactFlow needs real layout measurement that jsdom doesn't provide.)Verification
tsc+vite buildclean ✅ · full app suite green (48 tests) ✅Second of three v6.1 issues (after #47 for #3). Export-all-motifs (#4) next.
🤖 Generated with Claude Code