refactor(leaderboard): replace hardcoded colors with theme tokens#256
Merged
anderdc merged 1 commit intoentrius:testfrom Apr 15, 2026
Merged
Conversation
12398f2 to
d49253f
Compare
Contributor
Author
|
@anderdc I refactored code following your previous PR feedback(#262 (review)). would you appreciate your feedback. thanks |
anderdc
requested changes
Apr 15, 2026
Collaborator
anderdc
left a comment
There was a problem hiding this comment.
Two things to fix:
getRepositoryOwnerAvatarBackgroundis duplicated — identical function in bothTopPRsTable.tsxandTopRepositoriesTable.tsx. Extract it to a shared spot (e.g.types.tsor a small util in the leaderboard folder).STATUS_COLORS.openreplacingrgba(255,255,255,0.6)intypes.tsis a visual change.#8b949e(solid gray) looks different from white at 60% opacity on dark backgrounds. Usealpha(UI_COLORS.white, 0.6)to preserve the original appearance, or pick the closest existing token.
Replace all hardcoded color values (hex, rgba) in leaderboard components with centralized theme tokens and alpha() utility. Extract shared getRepositoryOwnerAvatarBackground helper to types.ts and add REPO_OWNER_AVATAR_BACKGROUNDS constant to theme.ts. Files changed: TopPRsTable.tsx, TopRepositoriesTable.tsx, SectionCard.tsx, RankIcon.tsx, types.ts, theme.ts Made-with: Cursor
bbdcfa1 to
35281a3
Compare
Contributor
Author
|
@anderdc I updated all. Pls check again. |
12 tasks
anderdc
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace all hardcoded color values (hex, rgba) in leaderboard components with centralized theme tokens and
alpha()utility. AddREPO_OWNER_AVATAR_BACKGROUNDSconstant totheme.tsfor owner avatar background colors.Files changed:
TopPRsTable.tsx,TopRepositoriesTable.tsx,SectionCard.tsx,RankIcon.tsx,types.ts,theme.tsWhat was replaced:
#ffffff/#fff→theme.palette.text.primaryrgba(255,255,255,0.1/0.2/0.05)→theme.palette.border.light/medium/subtlergba(255,255,255,0.02/0.05)→theme.palette.surface.subtle/light#000000→theme.palette.background.defaultalpha(common.white, TEXT_OPACITY.*)#ffffff/#F7931A→REPO_OWNER_AVATAR_BACKGROUNDS.*alpha()with existing palette valuesNo visual changes. Pure refactor.
Related Issues
Type of Change
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses