Skip to content

refactor(dashboard): replace hardcoded colors with theme tokens#252

Merged
anderdc merged 2 commits intoentrius:testfrom
claytonlin1110:refactor/dashboard-theme-color-tokens
Apr 15, 2026
Merged

refactor(dashboard): replace hardcoded colors with theme tokens#252
anderdc merged 2 commits intoentrius:testfrom
claytonlin1110:refactor/dashboard-theme-color-tokens

Conversation

@claytonlin1110
Copy link
Copy Markdown
Contributor

Summary

  • Refactors dashboard components to remove hardcoded color values and route styling through src/theme.ts.
  • Replaces inline #... and rgba(...) usage with theme.palette, TEXT_OPACITY, and alpha(...)-based theme values.
  • Adds reusable theme constants for shared dashboard visuals:
    • CONTRIBUTION_HEATMAP_SCALE
    • REPO_OWNER_AVATAR_BACKGROUNDS

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Scope

  • src/components/dashboard/CommitTrendChart.tsx
  • src/components/dashboard/ContributionHeatmap.tsx
  • src/components/dashboard/GlobalActivity.tsx
  • src/components/dashboard/KpiCard.tsx
  • src/components/dashboard/LeaderboardCharts.tsx
  • src/components/dashboard/LiveCommitLog.tsx
  • src/components/dashboard/PRStatusChart.tsx
  • src/components/dashboard/RepositoriesTable.tsx
  • src/theme.ts

Why

  • Improves consistency and maintainability of dashboard styling.
  • Ensures color behavior is centrally controlled via theme tokens.
  • Makes future design updates safer and faster by avoiding scattered hardcoded values.

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

@claytonlin1110
Copy link
Copy Markdown
Contributor Author

@anderdc @LandynDev
Currently there are too many hard coded color value usages in the entire codebase, I'm starting to refactoring to get rid of hard coded values.
As literally all the files have hard coded values, I'm starting to refactor dashboard pages & components...
Would you please review this?

@claytonlin1110 claytonlin1110 force-pushed the refactor/dashboard-theme-color-tokens branch from 3582902 to 57662cd Compare April 14, 2026 23:35
@claytonlin1110 claytonlin1110 force-pushed the refactor/dashboard-theme-color-tokens branch from 57662cd to 9093df0 Compare April 15, 2026 08:21
@anderdc anderdc merged commit 16c39ea into entrius:test Apr 15, 2026
2 checks passed
@anderdc anderdc added the refactor Code restructuring without behavior change label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants