Skip to content

fix: timezone-safe dates, next/font loading, accessible accordions, - #813

Merged
nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
Maxwell316:fix/issues-778-780-781-782
Oct 16, 2026
Merged

nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
Maxwell316:fix/issues-778-780-781-782

Conversation

@Maxwell316

Copy link
Copy Markdown

Summary

This PR fixes four issues: one date bug, one performance problem, one accessibility gap and one input validation bug.

🐛 DatePicker timezone handling (#778)

  • Store and compare dates as UTC. Date input values (YYYY-MM-DD) are parsed as UTC midnight instead of local time, so a policy's start and end dates no longer shift by a day for users ahead of UTC.
  • Show dates in the user's local timezone everywhere, using the shared helpers in src/lib/format.ts.
  • Add parse/serialize helpers for date inputs and use them in BuyPolicyModal.
  • Document how timezones are handled (in format.ts and the README).
  • Tests: run with a positive UTC offset (UTC+13, Pacific/Auckland) and check that the date the user picks is the date that gets stored.

⚡ Font loading blocks first paint (#780)

  • Move fonts to next/font in app/layout.tsx and remove the stylesheet/CDN font loading that blocks rendering.
  • Set display: 'swap' and preload the critical font weights.
  • Expose the font through a CSS variable so globals.css and Tailwind pick it up.
  • Lighthouse before and after: see the table below.

♿ Accordion keyboard and ARIA support (#781)

  • Make every accordion toggle a <button type="button"> (some are currently divs with only onClick).
  • Add aria-expanded and aria-controls, with a matching id on the content region.
  • Enter and Space now open and close sections, and the toggles show a visible focus style.
  • Tests: check that the toggle can be reached with the keyboard and that aria-expanded changes.

🐛 NumberInput accepts scientific notation (#782)

  • Amount inputs (BuyPolicyModal, DepositModal, WithdrawModal) now reject e, E, + and - as the user types and when text is pasted.
  • Check the number format again on submit with a strict decimal pattern.
  • Show a clear validation error when the format is invalid.
  • Tests: check that 1e10 is rejected and the error message appears.

Lighthouse (#780)

Metric Before After
FCP
LCP
CLS

Test plan

  • yarn test passes
  • yarn lint passes
  • Set the system timezone to UTC+13, pick a policy start date, and confirm the stored date has not shifted
  • Tab to the expandable sections and open and close them with Enter and Space
  • Type or paste 1e10 into an amount field and confirm it is rejected with an error
  • Run Lighthouse before and after and fill in the table above

Closes #778
Closes #780
Closes #781
Closes #782

@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Maxwell316 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for boisterous-sunshine-dd4c4c failed.

Name Link
🔨 Latest commit 5d03525
🔍 Latest deploy log https://app.netlify.com/projects/boisterous-sunshine-dd4c4c/deploys/6ad1f8a455b845cd21d2d899

@nonsobethel0-dev
nonsobethel0-dev merged commit 0d5813b into Parashield-Protocol:main Oct 16, 2026
0 of 4 checks passed
Wilfred007 pushed a commit to Wilfred007/parashield-frontend that referenced this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants