mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 05:30:46 +08:00
Switch topology canvas and left chrome to a dark theme.
Align the default canvas background, region list, and canvas name styles with the dark ops shell, and migrate the old light canvas default. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2de8786f85
commit
2a650ca09b
2 changed files with 90 additions and 58 deletions
|
|
@ -452,12 +452,18 @@ const DISCOVER_AUTO_ADD_KEY = "netx.topology.discoverAutoAddUnmatched";
|
|||
const DISCOVER_PROJECT_NEIGHBORS_KEY = "netx.topology.discoverProjectNeighbors";
|
||||
const SCALE_BUNDLE_WIDTH_KEY = "netx.topology.scaleBundleWidth";
|
||||
const CANVAS_BG_KEY = "netx.topology.canvasBg";
|
||||
const DEFAULT_CANVAS_BG = "#dbeafe";
|
||||
const DEFAULT_CANVAS_BG = "#0f172a";
|
||||
/** Previous light default — migrate so existing sessions pick up dark canvas. */
|
||||
const LEGACY_CANVAS_BG = "#dbeafe";
|
||||
|
||||
function loadCanvasBg(): string {
|
||||
try {
|
||||
const raw = String(localStorage.getItem(CANVAS_BG_KEY) || "").trim();
|
||||
if (/^#[0-9a-fA-F]{6}$/.test(raw)) return raw.toLowerCase();
|
||||
const raw = String(localStorage.getItem(CANVAS_BG_KEY) || "").trim().toLowerCase();
|
||||
if (raw === LEGACY_CANVAS_BG) {
|
||||
persistCanvasBg(DEFAULT_CANVAS_BG);
|
||||
return DEFAULT_CANVAS_BG;
|
||||
}
|
||||
if (/^#[0-9a-fA-F]{6}$/i.test(raw)) return raw;
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue