fix: prevent NaN rendering and normalize parseInt parsing across numeric displays#254
Closed
Dexterity104 wants to merge 4 commits intoentrius:testfrom
Closed
fix: prevent NaN rendering and normalize parseInt parsing across numeric displays#254Dexterity104 wants to merge 4 commits intoentrius:testfrom
Dexterity104 wants to merge 4 commits intoentrius:testfrom
Conversation
Collaborator
|
Closing — the main NaN fixes from #253 (MinerPRsTable, TopRepositoriesTable) aren't in the diff, and the RepositoryStats change replaces |
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
Adds the missing numeric fallbacks so cells with missing or non-numeric values render as
0instead of the literal stringNaN, and brings a handful ofparseIntcall sites in line with theparseInt(value || '0', 10)pattern used elsewhere.Closes #253
Changes
src/components/miners/MinerPRsTable.tsxThree
parseFloatcalls in the score column were missing the|| '0'fallback. A missingpr.scoreorpr.collateralScorerendered asNaN. Added the fallback to all three.src/components/repositories/RepositoryStats.tsxThe "Available Rewards" and "Total Paid Out" rows rendered
NaN αwhentotalAvailable/totalPaidOutwere not parseable. Wrapped both with(parseFloat(value) || 0).toLocaleString(...), matching the guarded pattern used inIssuesList,IssueHeaderCard, andIssueStats.src/components/leaderboard/TopRepositoriesTable.tsxparseInt(searchParams.get('rows') || '', 10)returnsNaNwhen the param is absent, only accidentally rescued by downstream validation. Swapped the''fallback for'0'on both therowsandpagelines so the fallback is intentional.src/pages/PRDetailsPage.tsxAdded the
10radix to all fiveparseInt(pullRequestNumber)calls for consistency with the rest of the codebase.src/components/dashboard/CommitTrendChart.tsxAdded the
10radix toparseInt(item.linesCommitted).