Skip to content

fix(gui): theme the rotating time cursor (it rendered black) - #92

Merged
matt-pharr merged 1 commit into
developfrom
bugfix/rotating-cursor-theme
Jul 27, 2026
Merged

fix(gui): theme the rotating time cursor (it rendered black)#92
matt-pharr merged 1 commit into
developfrom
bugfix/rotating-cursor-theme

Conversation

@matt-pharr

Copy link
Copy Markdown
Collaborator

The bug

The time-scrubber cursor on the rotating spectrogram was always black, so in
dark mode it was essentially invisible against the plot.

Why

The cursor set its colour to "var(--accent)". Plotly writes shape and trace
colours straight into the SVG, and SVG doesn't resolve CSS custom
properties — so the value was invalid and the browser fell back to black. The
code comment even said "bright turquoise", which was the intent, never what
rendered.

The fix

Use the literal --accent / --good values per theme, matching how the rest
of RotatingTab.tsx already themes its plot colours (dark ? … : …).

While in there I found the same defect twice more in the same view — the
sub-interval Coherence (var(--good)) and Cross-Power (var(--accent))
traces, also rendering black in both themes. Fixed those too rather than
knowingly ship the same bug 60 lines from the one I was fixing.

Only Plotly colours were affected. The remaining var(--…) uses in this file
are on real DOM elements (<h4 style=…> etc.), where CSS variables resolve
correctly — those are left alone.

Verification

Driven in-browser with Playwright against the running app, asserting the
rendered SVG stroke (the thing that was actually wrong):

theme stroke
dark rgb(46, 230, 207) = #2ee6cf
light rgb(10, 141, 128) = #0a8d80

Never black, and it now follows the theme toggle. eslint + tsc -b + 46 vitest
tests pass.

🤖 Generated with Claude Code

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.
@matt-pharr
matt-pharr merged commit 642a091 into develop Jul 27, 2026
4 checks passed
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.

1 participant