Skip to content

Commit ffba304

Browse files
committed
fix(gui): theme the rotating time cursor (it rendered black)
The cursor line and two sub-interval traces set their colour to "var(--accent)" / "var(--good)". Plotly writes shape and trace colours straight into the SVG, and SVG presentation attributes do NOT resolve CSS custom properties — so the value was invalid and fell back to black, leaving the time cursor near-invisible against the dark spectrogram. Use the literal --accent/--good values per theme, matching how the rest of this file already themes its plot colours (`dark ? … : …`). Also fixes the same defect in the sub-interval Coherence and Cross-Power traces, which are the same bug 60 lines away and were equally black. Only the Plotly colours were affected; the remaining var(--…) uses in this file are on real DOM elements, where CSS variables resolve correctly. Verified in-browser: the cursor's rendered stroke is rgb(46,230,207) in dark and rgb(10,141,128) in light — never black, and it follows the theme.
1 parent 8dc2b26 commit ffba304

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

gui/web/src/components/tabs/RotatingTab.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,11 @@ export default function RotatingTab({ machine }: { machine: string }) {
799799
x1: cursorMs,
800800
y1: 1,
801801
line: {
802-
color: "var(--accent)", // bright turquoise
802+
// Plotly writes this straight into the SVG `stroke`, which does NOT
803+
// resolve CSS custom properties — "var(--accent)" was invalid there and
804+
// fell back to black, leaving the cursor near-invisible in dark mode.
805+
// Use the literal --accent value for each theme.
806+
color: dark ? "#2ee6cf" : "#0a8d80",
803807
width: 2,
804808
dash: "dash" as const,
805809
},
@@ -848,7 +852,7 @@ export default function RotatingTab({ machine }: { machine: string }) {
848852
mode: "lines" as const,
849853
x: freqs,
850854
y: coh,
851-
line: { color: "var(--good)", width: 1.5 },
855+
line: { color: dark ? "#54e08a" : "#1f9d57", width: 1.5 }, // --good, literal (see above)
852856
name: "Coherence",
853857
xaxis: "x",
854858
yaxis: "y",
@@ -872,7 +876,7 @@ export default function RotatingTab({ machine }: { machine: string }) {
872876
mode: "lines" as const,
873877
x: freqs,
874878
y: power,
875-
line: { color: "var(--accent)", width: 1.5 },
879+
line: { color: dark ? "#2ee6cf" : "#0a8d80", width: 1.5 }, // --accent, literal (see above)
876880
name: "Cross-Power",
877881
xaxis: "x",
878882
yaxis: "y3",

0 commit comments

Comments
 (0)