-
Notifications
You must be signed in to change notification settings - Fork 24
Replace "k" notation with full digits and thin space separators on leaderboards #3607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
elisescu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude run prettier and format the code npm run format
| /** | ||
| * Format a number for leaderboard display with thin space thousands separators. | ||
| * Never uses "k" notation - always shows full digits with thin space separators. | ||
| * Uses thin space (U+2009) per BIPM standards for thousands separators. | ||
| * | ||
| * @param val - The number to format | ||
| * @param decimals - Number of decimal places (default: 0 for integers) | ||
| * @returns Formatted string with thin space separators | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude remove these comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @elisescu's task —— View job
Tasks
- Read the file to identify comments at line 132
- Remove the comments
- Commit and push changes
Summary
I've removed the JSDoc comments from the formatLeaderboardNumber function in front_end/src/utils/formatters/number.ts and pushed the changes.
Note: I wasn't able to run npm run format as npm commands require approval (they're not in my allowed tools list). You can run the formatter manually with:
npm run formatIf formatting changes are needed, I can commit those as well once the command is run.
--- |
|
Claude finished @elisescu's task —— View job Tasks
StatusI've successfully removed the JSDoc comments from Action needed: Please approve the Alternatively, if you update my allowed tools to include npm/npx commands, I can complete this task automatically in the future. |
Code Review for PR #3607SummaryThis PR successfully addresses issue #3583 by replacing abbreviated k notation with full digit display using thin space separators on leaderboards. The implementation is clean and well-documented. Strengths
Code Quality Observationsfront_end/src/utils/formatters/number.ts:133-159
Issues and Suggestions
This check works but could be clearer. Consider using a regex check like /[1-9]/.test(decimalPart) or add a comment explaining the intent.
SecurityNo security concerns identified. PerformanceNo performance concerns. The regex operation is efficient for the expected input sizes. Minor Suggestions
RecommendationApprove with changes requested. The implementation is solid, but missing test coverage is a significant gap for a utility function. Once tests are added and the decimal logic is clarified, this should be good to merge. Great work on improving the UX for close leaderboard races! |
Code ReviewOverviewThis PR successfully addresses issue #3583 by replacing abbreviated "k" notation with full digits and thin space separators on leaderboards. The implementation is clean and follows BIPM standards. ✅ Strengths
🐛 Potential Issues1. Negative number handling (front_end/src/utils/formatters/number.ts:142)The regex 2. Decimal grouping (front_end/src/utils/formatters/number.ts:145-147)The function only adds thin spaces to the integer part but uses a regular period for decimals. This follows BIPM standards correctly (decimals are not grouped). ✓
|
|
@claude, the code doesn't build. Fix the build error |
|
Claude finished @elisescu's task —— View job Build error fixed ✅Tasks
Issue FoundTypeScript error at Fix AppliedChanged the array destructuring to add a fallback value for TypeScript's strict type checking: // Before (causing TypeScript error)
const [integerPart, decimalPart] = fixed.split(".");
// After (TypeScript safe)
const parts = fixed.split(".");
const integerPart = parts[0] || "0";
const decimalPart = parts[1];The issue occurred because TypeScript's strict mode couldn't guarantee that Summary✅ Build now passes successfully --- | |
53aba58 to
4b3247c
Compare
|
@claude, before you submit, run the formater and the rest of the tools that check the code and fix any issues they report. |
|
Claude finished @elisescu's task —— View job Code checks completed successfully ✅Tasks
SummaryAll code quality checks have been completed successfully: Formatter (
Linters (
Build (
Changes committed:
The PR is now ready for review with all code quality checks passing! --- | |
…aderboards - Add formatLeaderboardNumber() function using thin space (U+2009) per BIPM standards - Update global leaderboard, project leaderboard, and contributions tables - Replace abbreviatedNumber() with formatLeaderboardNumber() for score display - Scores now show as "10 008" instead of "10k" for better precision Fixes #3583 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Co-authored-by: Elis Popescu <[email protected]>
Co-authored-by: Elis Popescu <[email protected]>
Add fallback value for integerPart to satisfy TypeScript's strict null checking. The toFixed() method always returns a string, so parts[0] will always exist, but TypeScript needs explicit handling for potentially undefined array access. Co-authored-by: Elis Popescu <[email protected]>
- Format long lines for better readability - Update formatLeaderboardNumber function formatting - Update project leaderboard table row formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Elis Popescu <[email protected]>
fd377aa to
b909067
Compare
|
Fixed by Cemre |
Fixes #3583
This PR removes the "k" notation from all leaderboards and displays full digits with thin space separators per BIPM standards.
Changes
formatLeaderboardNumber()function using thin space (U+2009) per BIPM standardsabbreviatedNumber()withformatLeaderboardNumber()for score displayResult
Scores now show as "10 008" instead of "10k" for better precision in close races.
🤖 Generated with Claude Code