Skip to content

Migrate the volunteer check-in flow and remove the MUI X date picker #2275

Open

Description

@trillium

Trillium Firstmate 🤖

Overview

Convert the public check-in screens (new volunteer and returning volunteer) to Tailwind and the shared components, replace the MUI date picker with the new month/year picker, and remove @mui/x-date-pickers from the app. This is the first screen volunteers see, and it is the slice that removes the most JavaScript (about 70 kB measured in an earlier trial).

Dependencies

Action Items

  • Migrate these files to the shared components from client/src/components/ui/ and Tailwind classes. Keep the same text, props, routes and behavior:
    • client/src/components/presentational/newUserForm.jsx (25 MUI tags; the only user of @mui/x-date-pickers; has 8 .Mui… selectors in sx)
    • client/src/components/presentational/returnUserForm.jsx
    • client/src/components/presentational/upcomingEvent.jsx
    • client/src/components/presentational/CheckInButtons.jsx
    • client/src/pages/NewUser.jsx
    • client/src/pages/ReturningUser.jsx
    • client/src/pages/CheckInForm.jsx (one Box; uses moment and date-fns)
    • client/src/sass/CheckIn.scss (213 lines of global SCSS, including a bare label { width: 300px; ... } rule that leaks onto every form on the page)
  • Replace the DatePicker + LocalizationProvider + AdapterDateFns block in newUserForm.jsx with MonthYearPicker. Keep the rules: earliest month Jan 2013, latest month = current month, default = current month, and the same value passed to the submit handler.
  • Remove @mui/x-date-pickers from client/package.json. date-fns must stay as a direct dependency (it was added in the picker ticket) because CheckInForm.jsx imports it.
  • Use Input with the floating-label option for the name, email and other fields, RadioGroup for the radio question, and Button for submit, matching today's disabled/enabled behavior.
  • Record the yarn build JS size before and after in the PR.
  • Take before/after screenshots (desktop about 1280 px, phone 390 px) of each state listed in the Acceptance Criteria.
  • Add Vitest checks for newUserForm and returnUserForm: fields render by label; submit is blocked or shows the same errors as today when required fields are empty; filling the fields and submitting calls the handler with the same values; the month/year picker changes the date; the radio answer is submitted. Add one test for upcomingEvent showing the formatted event date.
  • Delete the .scss files or rules that become unused, and remove their imports.

Acceptance Criteria

  • None of the files listed above imports from @mui/* or @emotion/*, and none still contains sx= or styled(.
  • The screen looks the same as before (pixel parity). The PR shows before/after screenshots at desktop width (about 1280 px) and phone width (390 px), including each state named in the Action Items (empty, loading, error, open dialog, and so on). The PR template has sections for these.
  • New Vitest checks are included (see Action Items) and yarn test passes.
  • yarn typecheck and yarn build pass in client/.
  • Any .scss file (or part of one) that this change makes unused is deleted, and nothing outside the listed files is left depending on it.
  • Keyboard-only pass done and noted in the PR: Tab order is sensible, every control can be used without a mouse, and dialogs/menus close with Escape.
  • The behavior is unchanged: same requests, same validation messages, same routes and redirects.
  • git grep -n "x-date-pickers" finds nothing in client/.
  • States in the screenshots: new-volunteer form empty, with errors, picker open, returning-volunteer form, and the upcoming event card.
  • Each check-in route still works (/new, /returning, /checkIn/:userType, /newProfile).

Resources/Instructions

Additional Notes

  • The .scss is global: old label rules affect every component rendered on the same page. Remove those rules as part of this ticket so the new components are not affected.
  • Decided: month/year popover grid. The old year-first list and the typed MM/YYYY keyboard entry go away.
  • Decided for the whole epic: every screen keeps pixel parity with today. This is a change of tooling, not a redesign. Fonts, colors, spacing, sizes, and breakpoints must look the same after the change.
  • The temporary Tailwind important flag is on while MUI is still in the app (decided). That is what lets a Tailwind class beat MUI/emotion and the old global SCSS. It is removed in Final cleanup: remove the Tailwind 'important' flag and the old global SCSS #2288.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: Design systemmilestone: missingp-feature: Check Inrole: Front Endsize: 5pt

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions