Skip to content

feat(ui): add formatBytes and formatPercent formatters#680

Open
Ayush7614 wants to merge 2 commits into
repowise-dev:mainfrom
Ayush7614:feat/ui-format-bytes
Open

feat(ui): add formatBytes and formatPercent formatters#680
Ayush7614 wants to merge 2 commits into
repowise-dev:mainfrom
Ayush7614:feat/ui-format-bytes

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add formatBytes and formatPercent helpers to the shared UI format library
  • Cover common byte-size and ratio display cases with unit tests

Test plan

  • packages/ui/tests/lib/format.test.ts covers byte and percent formatting
  • npm run test --workspace=@repowise-dev/ui

Add shared byte-size and ratio formatters to the UI format library with
unit tests so dashboard surfaces can display storage and coverage values
consistently.
@RaghavChamadiya

Copy link
Copy Markdown
Member

Code and tests look solid, formatBytes matches the Python version in 681 exactly. One thing holding me back: nothing in the tree imports formatBytes or formatPercent yet, so this is a helper with no caller. We try to avoid landing utility surface ahead of its first use. Can you either bring these in alongside the first consumer (a web storage card would be the natural fit, mirroring 681), or hold this until that lands? Happy to merge the moment there's something calling it.

Add IndexStorageMini to the repo overview rail, expose index_storage_bytes
from overview-summary, and use formatBytes/formatPercent for display so the
formatters ship with their first consumer.
@repowise-bot

repowise-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Health: 7.7 (unchanged)
1 file moved · 4 hotspots · 5 hidden couplings · 4 with fix history · 1 dead-code finding

⚠️ Change risk: moderate (riskier than 39% of this repo's commits · raw 8.3/10)
This change's risk is driven by:

  • more lines added than baseline
  • more scattered than baseline

🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)

File Score Δ Why
.../server/test_overview_sync.py 9.6 → 9.4 ▼ -0.1 ✅ resolved dry violation
🔥 Hotspots touched (4)
  • .../overview/page.tsx — 16 commits/90d, 1 dependents · primary owner: Swati Ahuja (67%)
  • .../routers/overview.py — 3 commits/90d, 0 dependents · primary owner: Swati Ahuja (95%)
  • .../src/overview.ts — 3 commits/90d, 7 dependents · primary owner: Swati Ahuja (86%)
1 more
  • .../server/test_overview_sync.py — 1 commits/90d, 1 dependents · primary owner: Raghav Chamadiya (100%)
🔗 Hidden coupling (1 file)
  • .../overview/page.tsx co-changes with these files (not in this PR):
    • .../layout/sidebar.tsx (6× — 🟢 routine)
    • .../app/page.tsx (3× — 🟢 routine)
    • .../layout/mobile-nav.tsx (3× — 🟢 routine)
    • packages/ui/package.json (3× — 🟢 routine)
    • .../decisions/decision-detail.tsx (3× — 🟢 routine)
💀 Dead code (1 finding)
  • 💀 .../routers/overview.py (file-level) (confidence 0.40)

📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-05 07:30 UTC
Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot

@Ayush7614

Copy link
Copy Markdown
Contributor Author

Thanks for the review — pushed a follow-up that wires formatBytes/formatPercent into their first consumer:

Should be ready for another look.

@Ayush7614

Copy link
Copy Markdown
Contributor Author

cc: @RaghavChamadiya

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants