fix(admin): make radial gauge tracks theme-aware (#856) - #889
DYNOSuprovo wants to merge 2 commits into
Conversation
cevheri
left a comment
There was a problem hiding this comment.
The fix is right and I want it in, but it needs a test before I merge.
I resolved the actual colours instead of reading the classes. In light the old track composited to exactly its own card colour, 1.000 contrast, so it was gone rather than faint. With grid it is #e4e4e7 at 1.154 to 1.247, the arc stays separate from the track in both themes, and dark gets slightly stronger rather than regressing.
Nothing would notice if this were undone, though. I reverted it, swapped the theme, swapped grid for axis, and set the track to transparent: all four leave the admin tests at 20 pass, 0 fail, coverage 100% either way.
That is partly our gap: tests/helpers/mock-monaco.ts:76 is RadialBar: () => null, so the prop never reaches the DOM, while Tooltip eight lines below re-emits contentStyle for exactly this reason. Do the same for RadialBar with background.fill, then add two cases beside the tooltip theme pair in tests/components/admin/OverviewTab.test.tsx asserting #e4e4e7 under light and #222222 under dark. I checked that shape: it fails on main, passes on your branch.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@cevheri Thanks for the pointer and the helpful breakdown of the mock surface! I've added the test coverage as suggested:
All 158 admin component tests pass locally. Ready for review! |
can you take on issue #856(just leave a comment), |
|
issue fixed for some urgent reason, sorry for that, please select another one |
Description
Make radial gauge tracks theme-aware in the admin Overview tab so the unfilled background ring remains visible in the light theme.
Type of Change
Related Issue
Closes #856
Changes Made
src/components/admin/tabs/OverviewTab.tsx, importedchartThemefrom@/lib/charts/palette.HeroStatusBanner, read the theme palette grid color withconst { grid } = chartTheme(useEffectiveTheme());and replaced hardcodedrgba(255,255,255,0.04)withbackground={{ fill: grid }}.MetricGauge, read the theme palette grid color withconst { grid } = chartTheme(useEffectiveTheme());and replaced hardcodedrgba(255,255,255,0.03)withbackground={{ fill: grid }}.Testing
Test Environment
Checklist