Skip to content

fix: show JSON and CSV formatter sizes just under 1 MB as MB - #429

Merged
anurag629 merged 1 commit into
codercops:developfrom
prakashNalla:fix/422-statsbar-bytes
Oct 30, 2026
Merged

anurag629 merged 1 commit into
codercops:developfrom
prakashNalla:fix/422-statsbar-bytes

Conversation

@prakashNalla

Copy link
Copy Markdown
Collaborator

What and why

The stats bars under the JSON Formatter and CSV Formatter each had their own copy of the size formatter, with the same rounding as #421, so sizes from 1048525 to 1048575 bytes showed as 1024.0 KB. Both now import formatBytes from lib/base64-utils.ts, which #423 fixed and which already has the boundary tests, and the local copies are gone.

Closes #422

How I tested this

  • No new tests: the formatting is covered by the formatBytes cases in lib/__tests__/base64-utils.test.ts, and the two components only call it now.
  • npm run lint: 0 errors, the same 11 warnings as on develop.
  • npm run test: 65 files, 2456 tests pass.
  • npm run build: passes.

AI assistance

Claude helped me w/ understand the issue

Type of change

  • Bug fix

Checklist

  • I was assigned the linked issue
  • npm run lint && npm run test && npm run build passes locally
  • Logic changes live in lib/ and have a test in lib/__tests__/
  • For a bug fix: the new test fails without my change
  • No analytics, trackers, or calls that send user data off-device
  • Works in both light and dark themes (if UI changed)
  • Inputs have labels and it works with the keyboard alone (if UI changed)
  • New tool: registry entry, page.tsx, client component, opengraph-image.tsx, and the bug report dropdown are all done

@anurag629 anurag629 added the hacktoberfest-accepted PR counts for Hacktoberfest label Oct 30, 2026
@anurag629
anurag629 merged commit a2d7037 into codercops:develop Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted PR counts for Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON and CSV Formatter: sizes just under 1 MB show as "1024.0 KB"

2 participants