Skip to content

fix(home): round Current Coverage KPI to 1 decimal place - #980

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/557-coverage-kpi-decimals
Jun 6, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/557-coverage-kpi-decimals

Conversation

@cristim

@cristim cristim commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

  • QA row 557 (Home, step 1.1): the Current Coverage KPI tile rendered the raw float from the API (e.g. 72.3456789012%), which can overflow the tile box at narrower screen widths.
  • Applied .toFixed(1) to match the 1-decimal-place format used for every other coverage percentage in the app (inventory.ts lines 388 and 438, recommendations sparklines, etc.).
  • Only display formatting is changed; the underlying data value is untouched.

Closes #978

Files changed

  • frontend/src/dashboard.ts — one-line fix on the coverageValue interpolation
  • frontend/src/__tests__/dashboard.test.ts — two regression tests: long-fractional input renders 72.3%; integer input renders 70.0%

Test plan

  • #978: Current Coverage KPI rounds to 1 decimal place — asserts 72.3456789012 renders as 72.3%
  • #978: integer Current Coverage KPI renders with one decimal place — asserts 70 renders as 70.0%
  • All 85 existing dashboard tests pass
  • npx tsc --noEmit — no type errors
  • SKIP=terraform_validate pre-commit run --all-files — all hooks pass

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/this-quarter Within the quarter impact/few Limited audience type/bug Defect labels Jun 5, 2026
@cristim

cristim commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 6 minutes and 35 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 492b67e0-5f3e-4aa3-9a0c-15660759a1cc

📥 Commits

Reviewing files that changed from the base of the PR and between 55739c2 and 76f5bb5.

📒 Files selected for processing (2)
  • frontend/src/__tests__/dashboard.test.ts
  • frontend/src/dashboard.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/557-coverage-kpi-decimals

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Raw float values (e.g. 72.3456789012%) caused the KPI tile to
overflow its box at narrower screen widths. Apply .toFixed(1) to
match the coverage formatting used throughout the app (inventory.ts
overall_coverage_pct, coverage_pct, and all other percentage KPIs).

Only display formatting is changed; the underlying data is untouched.

Adds two regression tests asserting the bounded precision.

Closes #978
@cristim
cristim force-pushed the fix/557-coverage-kpi-decimals branch from 094466d to 76f5bb5 Compare June 5, 2026 11:01
@cristim

cristim commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

Verification note: the one-decimal Current Coverage fix for #978 already landed on base via commit 92db4e7 ("fix(home/kpi): format Current Coverage / Target with one decimal (#967)"), which is this PR's merge-base. The diff here is a behavioral no-op (only comments + regression tests; the .toFixed(1) line predates the PR and appears as unchanged context). The added tests pass against already-fixed code, so they do not fail pre-PR. Suggest retitling to test(home): regression tests for one-decimal Current Coverage KPI (refs #978), or closing as superseded by #967. Leaving for a human to decide.

@cristim
cristim merged commit 3e53a66 into feat/multicloud-web-frontend Jun 6, 2026
5 checks passed
@cristim
cristim deleted the fix/557-coverage-kpi-decimals branch July 27, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/bug Defect urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant