Skip to content

Conversation

@ameliav
Copy link
Contributor

@ameliav ameliav commented Dec 24, 2025

🗣 Description

Standardizes large numeric values displays across the VS Dashboard. (CRASM-3590)

💭 Motivation and context

Any numeric values in the VS Dashboard that are larger than 3 digits will now have appropriate commas with locale-aware formatting (e.g. 3071 → 3,071) for easy user display while also preserving their numeric type for calculations and comparisons elsewhere in the application.

As part of this work, existing components were lightly refactored to centralize display logic and improve accessibility, and unit tests were expanded to validate both formatting behavior and edge cases.

Unit test files added:

  1. stringUtils.test.ts
    • Refactored string utility functions in the utils folder to one file named stringUtils.ts and created unit tests
    • These utility functions are capitalize, truncateString, matchPath, and the newly created formatDisplayValue
  2. scanningSummary.test.tsx
    • Formatted numeric output
    • ARIA labels reflecting formatted values
    • Tooltip content rendering
    • Tooltip fallback behavior when content is missing
    • Edge cases such as empty scan dates and non-numeric values
    • Verified all existing tests continue to pass

🧪 Testing

📷 Screenshots (if appropriate)

Showing large numeric values now have commas with example test values

image image image

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.
  • Bump major, minor, patch, pre-release, and/or build versions as appropriate via the bump_version script if this repository is versioned and the changes in this PR warrant a version bump.
  • Create a pre-release (necessary if and only if the pre-release version was bumped).

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release (necessary if and only if the version was bumped).

@ameliav ameliav self-assigned this Dec 24, 2025
@coveralls
Copy link

coveralls commented Dec 26, 2025

Coverage Status

coverage: 34.363% (+0.3%) from 34.064%
when pulling 8611547 on format-vs-dash-values-3590
into 89236de on develop.

@ameliav ameliav marked this pull request as ready for review December 26, 2025 20:23
@ameliav ameliav changed the title DRAFT Format VS Dashboard numeric values CRASM-3590 Format VS Dashboard numeric values (CRASM-3590) Dec 26, 2025
cduhn17
cduhn17 previously approved these changes Dec 29, 2025
Copy link
Collaborator

@cduhn17 cduhn17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - no major findings

schmelz21
schmelz21 previously approved these changes Dec 29, 2025
Copy link
Contributor

@jsalinasnttdata jsalinasnttdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ameliav ameliav dismissed stale reviews from jsalinasnttdata, schmelz21, and cduhn17 via a4439ea December 29, 2025 15:03
@schmelz21 schmelz21 self-requested a review December 29, 2025 15:38
schmelz21
schmelz21 previously approved these changes Dec 29, 2025
@jsalinasnttdata jsalinasnttdata self-requested a review December 29, 2025 15:39
@ameliav ameliav dismissed stale reviews from jsalinasnttdata and schmelz21 December 29, 2025 15:50

The merge-base changed after approval.

Copy link
Collaborator

@cduhn17 cduhn17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cduhn17 cduhn17 merged commit 701cbe4 into develop Dec 29, 2025
18 checks passed
@cduhn17 cduhn17 deleted the format-vs-dash-values-3590 branch December 29, 2025 16:22
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.

6 participants