Skip to content

fix: reduce rank number font size for double digits - #47

Merged
calebephrem merged 1 commit into
open-devhub:mainfrom
goldstac:fix/rank-font-size
Sep 2, 2026
Merged

calebephrem merged 1 commit into
open-devhub:mainfrom
goldstac:fix/rank-font-size

Conversation

@goldstac

@goldstac goldstac commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Reduces the rank number font size from 120px to 72px when the rank has 4+ digits (e.g., #1000) to prevent overflow.

@devhub-bot devhub-bot Bot added the fix Bug fix label Sep 2, 2026
@beetle-ai

beetle-ai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary by Beetle

This PR addresses a UI/UX issue in the rank card visualization by implementing responsive font sizing for rank numbers. When rank numbers exceed three digits (i.e., rank >= 1000), the fixed 120px font size causes the text to overflow or appear cramped. The fix dynamically adjusts the font size based on the rank number's string length, reducing it to 72px for double-digit or longer rank numbers while maintaining the original 96px size for smaller ranks.

📁 File Changes Summary (Consolidated across all commits):

File Status Changes Description
src/visuals/rankCard.ts Modified +4/-2 Implemented responsive font sizing for rank display. Added logic to calculate font size dynamically based on rank number length: 72px for ranks with 4+ character representation (e.g., "#1000"), 96px for shorter ranks. Refactored rank text into a variable for reusability.

Total Changes: 1 file changed, +4 additions, -2 deletions

🎯 Key Changes:

  • Dynamic Font Size Calculation: Introduced rankFontSize variable that checks if the rank string length exceeds 3 characters and adjusts accordingly (72px vs 96px)
  • Code Refactoring: Extracted rank text into rankStr variable (#${rank}) to avoid string duplication and improve maintainability
  • Responsive UI: Prevents text overflow and maintains visual balance for users with high rank numbers (1000+)
  • Minimal Impact: Changes are localized to the rank rendering section with no side effects on other card elements

📊 Impact Assessment:

  • Security: No security implications. This is a purely visual/UI change with no data handling or authentication modifications.
  • Performance: Negligible performance impact. The added logic is minimal (one string length check and conditional assignment) and executes only once per card render. No additional API calls or heavy computations introduced.
  • Maintainability: Improved maintainability through code refactoring. Extracting rankStr into a variable reduces duplication and makes the code more readable. The font size logic is straightforward and easy to understand. Future adjustments to font sizing thresholds would be simple to implement.
  • Testing: The change should be validated through visual regression testing to ensure:
  • Rank numbers with 1-3 digits display at 96px correctly
  • Rank numbers with 4+ digits (1000+) display at 72px without overflow
  • Text alignment and positioning remain consistent across all rank ranges
  • No visual artifacts or clipping occurs at the boundary (rank 999 vs 1000)
⚙️ Settings

Severity Threshold: Medium — Balanced feedback — medium and high severity issues only. — Change in Settings
Custom Rules: Define your own review rules — Set Custom Rules
PR Summary: Configure PR summary — Change in Settings

📖 User Guide
  • Once repos are connected, PR analysis is automatically enabled. You can disable analysis for this repo from beetleai.dev/analysis
  • Comment @beetle on any PR to start analysis manually
  • Comment @beetle stop to stop any ongoing analysis

Follow us: Beetle · X · LinkedIn

@beetle-ai

beetle-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

✅ You're good to merge this PR! No issues found. Great job!

Settings
⚙️ Settings

Severity Threshold: Medium — Balanced feedback — medium and high severity issues only. — Change in Settings
Custom Rules: Define your own review rules — Set Custom Rules
PR Summary: Configure PR summary — Change in Settings

📖 User Guide
  • Once repos are connected, PR analysis is automatically enabled. You can disable analysis for this repo from beetleai.dev/analysis
  • Comment @beetle on any PR to start analysis manually
  • Comment @beetle stop to stop any ongoing analysis

@devhub-bot

devhub-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Note

Linting checks passed successfully 🎉

All formatting and code quality checks are clean.

You're good to merge 🚀

@goldstac

goldstac commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

:3

@calebephrem

Copy link
Copy Markdown
Member
image lgtm :3

@calebephrem
calebephrem merged commit 436fe35 into open-devhub:main Sep 2, 2026
4 checks passed
@calebephrem

Copy link
Copy Markdown
Member

Thx for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants