Skip to content

fix(frontend): minimap/controls white background (dark colorMode)#13

Merged
assert-not-singularity merged 6 commits into
mainfrom
fix/minimap-dark-theme
Jul 3, 2026
Merged

fix(frontend): minimap/controls white background (dark colorMode)#13
assert-not-singularity merged 6 commits into
mainfrom
fix/minimap-dark-theme

Conversation

@assert-not-singularity

Copy link
Copy Markdown
Owner

Fix: minimap/controls white background

Spotted during M3 wrap-up: the MiniMap panel renders with a white background,
and the zoom Controls buttons default to #fefefe — both stick out against
gnode's dark canvas.

Root cause

We never told React Flow the canvas is dark, so its built-in MiniMap and
Controls components fall back to their light-theme CSS variables
(--xy-minimap-background-color-default: #fff, --xy-controls-button-background-color-default: #fefefe),
regardless of gnode's own dark app chrome.

Fix

Set colorMode="dark" on <ReactFlow>. This is React Flow's officially
supported theming mechanism (adds a .dark class that supplies a full set of
dark-mode CSS variables) — fixes the minimap background, the controls'
background/border/hover colors, and the selection-box outline, all in one
line, with no hand-rolled CSS overrides needed.

Verified live in-browser

Before: .react-flow__minimap computed background-color: rgb(255, 255, 255);
.react-flow__controls-button computed rgb(254, 254, 254).
After: minimap rgb(20, 20, 20) (#141414), controls button
rgb(43, 43, 43) (#2b2b2b) — both match the dark theme. Confirmed visually
via screenshot too.

Gate green: biome check + tsc -b + vite build.

🤖 Generated with Claude Code

assert-not-singularity and others added 6 commits July 2, 2026 01:46
The editor is now runnable: it debounces the canvas graph to POST /api/evaluate
and shows a live preview on each node.

- toGnodeGraph converts the ReactFlow canvas to a .gnode payload.
- Debounced evaluate (keyed on a position-independent graph signature) with all
  nodes as targets; a persistent-cache-friendly loop.
- GlitchNode shows a live thumbnail + error border, read from a PreviewContext
  (kept out of the node state that triggers evaluation).
- Toolbar: global seed (+ reroll), output size, and evaluate status
  (evaluating / ready / node error / invalid).
- ConfigPanel image_id field: editable id + "upload…" (POST /api/images).
- Validation/error bar for invalid-graph (400) messages; cleaner API error text.

Verified live in-browser: a Load node with an uploaded image renders its
thumbnail from the backend and the toolbar shows "ready".
Gate green: biome check, tsc -b, vite build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- App: guard the debounced evaluate against a stale in-flight response
  overwriting newer previews (only the latest effect commits).
- ConfigPanel: reset the file input after upload so re-picking the same
  image still fires onChange.
- api/client: fall back to `HTTP <status>` when statusText/detail is empty,
  so errors never surface with an empty message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The MiniMap and zoom Controls used React Flow's light-mode defaults (a white
minimap panel, #fefefe control buttons) since we never told React Flow the
canvas is dark. Setting colorMode="dark" switches to its built-in dark theme,
which also fixes the zoom Controls' background/border/hover colors and the
selection-box outline color — all without hand-rolled CSS overrides.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes React Flow’s built-in MiniMap and Controls rendering with light-theme backgrounds on gnode’s dark canvas by enabling React Flow’s official dark theming mode.

Changes:

  • Set colorMode="dark" on <ReactFlow> so React Flow applies its .dark theme variables (MiniMap, Controls, selection box, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@assert-not-singularity assert-not-singularity merged commit bc0813b into main Jul 3, 2026
1 check passed
@assert-not-singularity assert-not-singularity deleted the fix/minimap-dark-theme branch July 3, 2026 17: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