MPDX-9813 - NSO MPD Questionnaire Spouse Phone Number input#1879
Conversation
Bundle sizes [mpdx-react]Compared against 837d6e6 No significant changes found |
|
Preview branch generated at https://MPDX-9813.d3dytjb8adxkk5.amplifyapp.com |
zweatshirt
left a comment
There was a problem hiding this comment.
Multi-Agent Code Review — Verdict: CLEAN
6 specialized agents (Architecture, Testing, Standards, UX, Data Integrity, Financial Reporting) plus a focused delta pass on the new test. 0 blockers. The change reduces technical debt (centralized getHasSpouse, extracted a reusable PhoneNumberField, and converted a pre-existing sx-callback to useTheme()).
The one Medium finding from the initial pass — the untested single-staff stepCompletion branch — is resolved by stepCompletion.test.ts (verified: genuinely typed fixture, exercises both single→100% and married 75%→100%).
Everything remaining is an optional suggestion (severity < 5), posted inline. None block merge and none require /dismiss.
Risk: MEDIUM. The repo's flat per-file scoring mechanically rated this higher, but this is a shallow, fully-tested, single-feature addition with no auth / data-model / money / migration surface; the GraphQL change is a single scalar added to an existing fragment (id intact).
| Severity | Count |
|---|---|
| Blockers (>= 8) | 0 |
| Important (7–7.9) | 0 |
| Medium (5–6.9) | 0 |
| Suggestions (< 5) | 8 |
| schema, | ||
| }); | ||
| const userName = firstName ?? t('You'); | ||
| const spouseColumnName = spouseFirstName ?? t('Spouse'); |
There was a problem hiding this comment.
| ? t('Please provide a cell phone number for each person below.') | ||
| : t('Please provide your cell phone number.')} | ||
| </Typography> | ||
| <Table size="small" sx={{ maxWidth: theme.spacing(90) }}> |
There was a problem hiding this comment.
| <TableCell scope="col" sx={{ color: theme.palette.mpdxBlue.main }}> | ||
| {userName} | ||
| </TableCell> | ||
| {hasSpouse && ( |
There was a problem hiding this comment.
| label: t('Spouse name'), | ||
| value: formatText(spouseFirstName), | ||
| value: | ||
| [spouseFirstName, lastName].filter(Boolean).join(' ') || |
There was a problem hiding this comment.
There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: MEDIUM (5/10)
Verdict: CLEAN (no issues found)
This PR was auto-approved because:
- The multi-agent AI review determined it is medium risk
- No blocking issues were found
If you believe this PR needs human review, dismiss this approval and request a review manually.
Extract the marital-status check into a shared getHasSpouse helper and expose hasSpouse from NsoMpdQuestionnaireContext, so consumers stop recomputing it. StaffInformation now reads hasSpouse from context.
Add spousePhoneNumber to the questionnaire fragment and a reusable PhoneNumberField, and render a per-person phone column in ContactInformation (user + spouse) with person-scoped labels for screen readers. Require the spouse phone for step completion when married, and show it in the Summary.
zweatshirt
left a comment
There was a problem hiding this comment.
Multi-Agent Code Review — Verdict: CLEAN
Re-review after the per-person-label change. Fresh UX, Testing, and Standards agents. 0 blockers.
This change resolves both Medium findings from the prior review:
- Duplicate accessible name → resolved. Each phone input now has a distinct, person-scoped accessible name equal to its visible label ("John's cell phone number" / "Jane's cell phone number"). WCAG 2.5.3 satisfied (no
aria-labeloverride), matches the SalaryCalculator per-person-label convention, and the required asterisk is preserved. - Vacuous test → resolved. Tests now query each field by its distinct name (
getByRole/findByRole), which throw if a field is missing — the "two fields exist" guarantee is genuinely restored.
Standards: i18n interpolation keys are correct (variable form, static keys, double-quote-wrapped possessives — extraction-verified against existing en-locale precedent); no any, named exports, test conventions upheld.
| Severity | Count |
|---|---|
| Blockers (>= 8) | 0 |
| Important (7–7.9) | 0 |
| Medium (5–6.9) | 0 |
| Suggestions (< 5) | 2 |
Both remaining items are optional suggestions (severity < 5), posted inline — neither blocks merge.
Risk: MEDIUM — a shallow, fully-tested, single-feature change with no auth / data-model / money / migration surface.
| fieldName: 'phoneNumber', | ||
| schema, | ||
| }); | ||
| const userLabel = firstName |
There was a problem hiding this comment.
| {t('Cell Phone Number')} | ||
| </TableCell> | ||
| <TableCell> | ||
| <PhoneNumberField fieldName="phoneNumber" label={userLabel} /> |
There was a problem hiding this comment.
There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: MEDIUM (5/10)
Verdict: CLEAN (no issues found)
This PR was auto-approved because:
- The multi-agent AI review determined it is medium risk
- No blocking issues were found
If you believe this PR needs human review, dismiss this approval and request a review manually.
Description
hasSpouselogic a shared function and variable in the context.Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions