MPDX-9763 - NSO Questionnaire: Improve text field designs (while still honoring Figma design) - #1850
Conversation
Bundle sizes [mpdx-react]Compared against b969697 No significant changes found |
|
Preview branch generated at https://improve-questionnaire-readability.d3dytjb8adxkk5.amplifyapp.com |
4c72cb3 to
4d2ee1c
Compare
zweatshirt
left a comment
There was a problem hiding this comment.
🤖 Multi-Agent Code Review — Verdict: ✅ APPROVED WITH SUGGESTIONS
Risk: 2/10 (LOW) · 5 agents (Architecture, Testing, Standards, UX, Financial) + dependency analysis · standard mode
No blockers. This is a clean styling/refactor PR: NumberQuestion moves from a hand-wired FormControl+OutlinedInput to a single MUI TextField (net debt reduction), and field widths become responsive. The prior review's one Important finding (non-responsive width: '50%') is resolved via width: '100%' + maxWidth: theme.spacing(60). Accessibility is a net improvement (real <label>, auto aria-describedby, aria-invalid); no breaking changes (props interface unchanged, 3 consumers safe); Standards clean; no financial code.
Findings (all non-blocking)
| # | Sev | File | Issue |
|---|---|---|---|
| 1 | 6.0 Medium | MinistryDetails.tsx:108 | Location field still uses placeholder only, no label — the exact bug this PR fixes elsewhere |
| 2 | 6.5 Medium | MinistryDetails.tsx:122 (+NsoDetails) | Longest labels still truncate at 480px — mitigated, not fully resolved |
| 3 | 5.0 Medium | NumberQuestion.tsx:39 (+3 sites) | Repeated width sx; a third width value in the tree — consider a shared token |
| 4 | 4.0 Suggestion | NumberQuestion.test.tsx:54 | New label test doesn't assert placeholder absence |
See inline comments for detail.
Findings on Related Files (Not in This PR)
These were surfaced on files related to the change but not modified in this PR, so they can't be posted as line comments. Informational only.
[Suggestion] src/components/HrTools/NsoMpdQuestionnaire/FinancialInformation/FinancialDetails.tsx:100 — Adorned vs non-adorned label-shrink inconsistency
- Severity: 3.5/10 · Flagged by: UX
- The debt fields pass a
startAdornmenticon, which makes MUI shrink theNumberQuestionlabel immediately, while theNsoDetailsfields (no adornment) rest the label full-size until focus/fill — two visual states for the same component. Optional: setInputLabelProps={{ shrink: true }}onNumberQuestionto unify.
[Medium] src/components/HrTools/NsoMpdQuestionnaire/NsoInformation/NsoDetails.tsx:67-69 — Long-label truncation (companion to inline finding #2)
- Severity: 6.5/10 · Flagged by: UX
- "How much special needs support have you already received for NSO?" (~65 chars) still clips at 480px. Structural fix (follow-up): render long questions as a
Typographyabove the field with a shortlabel— the patternRadioQuestionandContactInformationalready use in this tree.
|
|
||
| <TextField | ||
| placeholder={t('What is your expected ministry assignment location?')} | ||
| sx={{ width: '100%', maxWidth: theme.spacing(60) }} |
There was a problem hiding this comment.
<TextField
label={t('What is your expected ministry assignment location?')}
sx={{ width: '100%', maxWidth: theme.spacing(60) }}
size="small"
{...locationProps}
/>(This surfaces the same long-label truncation tradeoff as the city field, but resolves the disappearing-question + a11y gap.)
| label={t( | ||
| 'Is your ministry assignment location within 50 miles of one of these cities?', | ||
| )} | ||
| sx={{ width: '100%', maxWidth: theme.spacing(60) }} |
There was a problem hiding this comment.
| label={question} | ||
| helperText={error ? errorText : helperText} | ||
| error={error} | ||
| sx={{ width: '100%', maxWidth: theme.spacing(60) }} |
There was a problem hiding this comment.
|
|
||
| it('links the input to its helper text via aria-describedby', () => { | ||
| const { getByRole, getByText } = render(<TestComponent />); | ||
| it('renders the question as a persistent label', () => { |
There was a problem hiding this comment.
expect(queryByPlaceholderText('How many?')).not.toBeInTheDocument();There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: LOW (2/10)
Verdict: APPROVED_WITH_SUGGESTIONS (suggestions posted, no blockers)
This PR was auto-approved because:
- The multi-agent AI review determined it is low risk
- No blocking issues were found
- All suggestions have been posted as review comments for the developer to consider
If you believe this PR needs human review, dismiss this approval and request a review manually.
4d2ee1c to
fc28e1f
Compare
edc89c5 to
76d5518
Compare
Description
Future considerations:
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions