Skip to content

fix(admin): use theme-aware grid color for health gauge background track - #945

Closed
De-pitcher wants to merge 1 commit into
libredb:mainfrom
De-pitcher:fix/admin-health-gauge-theme-aware-track
Closed

De-pitcher wants to merge 1 commit into
libredb:mainfrom
De-pitcher:fix/admin-health-gauge-theme-aware-track

Conversation

@De-pitcher

Copy link
Copy Markdown
Contributor

Description

Fixes #856 by replacing hardcoded low-opacity white gauge tracks in OverviewTab with the theme-aware palette grid color from chartTheme(useEffectiveTheme()).grid.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Test addition or update

Related Issue

Closes #856

Changes Made

  • Imported chartTheme from @/lib/charts/palette in src/components/admin/tabs/OverviewTab.tsx.
  • Updated HeroStatusBanner and MetricGauge to resolve the current effective theme via useEffectiveTheme() and use chartTheme(theme).grid for the RadialBar background track fill.
  • Updated tests/helpers/mock-monaco.ts to surface background.fill on mock RadialBar elements via data-bg.
  • Added unit tests in tests/components/admin/OverviewTab.test.tsx verifying that health and metric gauge tracks use #222222 in dark mode and #e4e4e7 in light mode.

Testing

  • I have tested this locally
  • I have added/updated tests
  • All existing tests pass

Test Environment

  • OS: Windows 11
  • Node.js/Bun Version: Bun 1.3.11

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@De-pitcher

Copy link
Copy Markdown
Contributor Author

Closing in favor of PR #946 for issue #862 per maintainer recommendation.

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.

Admin health gauges use a hardcoded white track that vanishes in the light theme

1 participant