Skip to content

Error doc inflation#141

Merged
jenbreese merged 2 commits into
devfrom
error-doc-inflation
Jun 29, 2026
Merged

Error doc inflation#141
jenbreese merged 2 commits into
devfrom
error-doc-inflation

Conversation

@jenbreese

@jenbreese jenbreese commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

READY FOR REVIEW

Notes: I added the errors in the error doc. I also updated some of the UI to match the new styles we are doing. I brought up some of the consistency issues.

Summary

Inflation Impact Calculator -- validation, formatting, and accessibility

Validation

  • Added empty field error: blocks calculation and shows "Enter an initial amount to see the impact of inflation over time."
  • Added range error for values outside $0.01 and $1,000,000,000: blocks calculation and shows "Enter an amount between $0.01 and $1,000,000,000."
  • Results panel shows "—" when the field is empty or out of range
  • Sliders retain their existing enforced ranges; no changes needed there

Formatting

  • Initial price input now displays comma-formatted values (e.g. 1,000,000)
  • Input strips commas on focus for clean editing and re-applies them on blur
  • Results panel uses formatCurrency via Intl.NumberFormat for consistent USD output, matching the PV calculator pattern

Accessibility

  • Error message <p> is always rendered and referenced via aria-describedby; hidden with sr-only when no error is active, visible when one is
  • aria-invalid set on the input when an error is present
  • Results panel wrapped in aria-live="polite" aria-atomic="true" so screen readers announce updates
  • Both sliders have aria-label, aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext
  • Time period display span has aria-live="polite" so the year count is announced as the slider moves
  • Slider min/max label spans marked aria-hidden="true" since the range is already conveyed via ARIA attributes
  • $ symbol positioned with top-1/2 -translate-y-1/2 replacing the non-standard top-8.5

@majimmy88 majimmy88 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@jenbreese jenbreese merged commit 5193e1f into dev Jun 29, 2026
@jenbreese jenbreese mentioned this pull request Jul 10, 2026
14 tasks
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