Skip to content

fix: prevent NaN rendering and normalize parseInt parsing across numeric displays#254

Closed
Dexterity104 wants to merge 4 commits intoentrius:testfrom
Dexterity104:fix/data-rendering-correctness
Closed

fix: prevent NaN rendering and normalize parseInt parsing across numeric displays#254
Dexterity104 wants to merge 4 commits intoentrius:testfrom
Dexterity104:fix/data-rendering-correctness

Conversation

@Dexterity104
Copy link
Copy Markdown
Contributor

Summary

Adds the missing numeric fallbacks so cells with missing or non-numeric values render as 0 instead of the literal string NaN, and brings a handful of parseInt call sites in line with the parseInt(value || '0', 10) pattern used elsewhere.

Closes #253

Changes

src/components/miners/MinerPRsTable.tsx

Three parseFloat calls in the score column were missing the || '0' fallback. A missing pr.score or pr.collateralScore rendered as NaN. Added the fallback to all three.

src/components/repositories/RepositoryStats.tsx

The "Available Rewards" and "Total Paid Out" rows rendered NaN α when totalAvailable / totalPaidOut were not parseable. Wrapped both with (parseFloat(value) || 0).toLocaleString(...), matching the guarded pattern used in IssuesList, IssueHeaderCard, and IssueStats.

src/components/leaderboard/TopRepositoriesTable.tsx

parseInt(searchParams.get('rows') || '', 10) returns NaN when the param is absent, only accidentally rescued by downstream validation. Swapped the '' fallback for '0' on both the rows and page lines so the fallback is intentional.

src/pages/PRDetailsPage.tsx

Added the 10 radix to all five parseInt(pullRequestNumber) calls for consistency with the rest of the codebase.

src/components/dashboard/CommitTrendChart.tsx

Added the 10 radix to parseInt(item.linesCommitted).

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Closing — the main NaN fixes from #253 (MinerPRsTable, TopRepositoriesTable) aren't in the diff, and the RepositoryStats change replaces formatTokenAmount (which already handles null/NaN) with a worse inline version. The remaining radix additions are harmless but not worth a PR on their own.

@anderdc anderdc closed this Apr 15, 2026
@anderdc anderdc added the bug Something isn't working label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NaN rendered in numeric cells and inconsistent parseInt parsing across URL params

2 participants