feat: add estimated codebase size badge to top repositories card#2796
Open
harshitanagpal05 wants to merge 3 commits into
Open
feat: add estimated codebase size badge to top repositories card#2796harshitanagpal05 wants to merge 3 commits into
harshitanagpal05 wants to merge 3 commits into
Conversation
…iyanshu-byte-coder#2601) - Add pure utility (src/lib/codebase-size.ts) mapping total language bytes to Small (<50KB) / Medium (50-500KB) / Large (>500KB) categories - Render color-coded badge alongside language pills in TopRepos component - Include accessible aria-labels for screen readers - Non-intrusive: badge only appears when language byte data is available
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Owner
|
Thanks for contributing! We are currently in a code cleanup sprint and not accepting new features. Please see: #2651 This PR will be revisited once the sprint ends. Tests, refactors, bug fixes, and documentation are welcome in the meantime. |
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.
Description
Closes #2601
Adds a compact, non-intrusive codebase size badge (
Small Codebase/Medium Codebase/Large Codebase) to each repository entry on the Top Repositories dashboard card. The classification is derived from the total language byte count already returned by the GitHub Languages API — no additional API calls are needed.Thresholds
Small CodebaseMedium CodebaseLarge CodebaseChanges
New file:
src/lib/codebase-size.tsgetCodebaseSize(totalBytes)— maps raw byte count →"Small" | "Medium" | "Large"getCodebaseSizeFromLanguages(languages[])— convenience wrapper that sumsbytesfrom an existingRepoLanguage[]array and returns the size category (ornullwhen no language data is available)Modified:
src/components/TopRepos.tsxcodebaseSizeper repo inside theRepoItemcomponentflex flex-wrapcontainer):repo.languageshas byte data (non-intrusive)aria-labelandtitleattributes for accessibilityAcceptance Criteria
aria-labelattributes for screen readers describing repo size scaleflex-wrap)eslint)tsc --noEmit)Feature Area
Goal Tracker — Top Repositories Card