No-Jira - PDS Goal refactors: Fix long title name stretching goal cards#1759
Conversation
|
Preview branch generated at https://pds-refactors.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 44ff7b2 No significant changes found |
zweatshirt
left a comment
There was a problem hiding this comment.
Multi-Agent Code Review — PR #1759
Verdict: CLEAN — No blockers, no important issues. All findings are pure suggestions (severity < 5.0).
Risk: 1/10 (LOW) — 13 source lines + 38 test lines, single component, no shared infrastructure.
Agents: Architecture, Testing, Standards, UX (4 specialized reviewers)
What this PR does well
- Resolves the long-title card-stretching issue with a clear truncation strategy (fixed width +
noWrap+ tooltip fallback) - Tooltip and visible text now share the same
?? t('Unnamed Goal')fallback, so the tooltip-on-hover invariant is durable across future refactors - Two new tests cover both the named and unnamed-goal hover paths; both pass
- All Standards Checklist items pass: named exports, alphabetical imports, typed
GqlMockedProvider,findBy*for async, noany, nonew Date()
Suggestions (informational, do not block)
PdsGoalCard.tsx:28 — width: 350 (was minWidth: 350) hard-caps card width on viewports narrower than 350px. Adding maxWidth: '100%' lets the card shrink below 350px on small mobile screens while still capping it above. (UX 4.5)
PdsGoalCard.tsx:132 — goal.name?.trim() || t('Unnamed Goal') is more defensive than ?? because it also catches empty strings and whitespace-only names. Likely covered by server-side validation, but cheap to harden. (UX/Testing 4.0)
PdsGoalCard.test.tsx — Edge cases not exercised: name: '' and name: ' '. Optional addition since the server probably rejects these. (Testing 4.0)
Sibling drift — src/components/HrTools/GoalCalculator/GoalCard/GoalCard.tsx is now visually divergent (no truncation, minWidth: 350). The shared-component extraction was deferred per prior discussion; flagging for awareness only. (Architecture 3.0)
Pre-existing (codebase-wide) — Tooltip on a non-focusable Typography is keyboard-inaccessible. The same pattern exists in MPGAIncomeExpensesReport, SavingsFundTransfer, and others. Worth a separate codebase-wide a11y ticket; not a regression. (UX, pre-existing)
Review Summary
| Agent | Critical | High | Important | Medium | Suggestions | Confidence |
|---|---|---|---|---|---|---|
| Architecture | 0 | 0 | 0 | 0 | 4 | High |
| Testing | 0 | 0 | 0 | 0 | 2 | High |
| Standards | 0 | 0 | 0 | 0 | 0 | High |
| UX | 0 | 0 | 0 | 0 | 4 | High |
| Total | 0 | 0 | 0 | 0 | 10 | High |
|
|
||
| const StyledCard = styled(Card)(({ theme }) => ({ | ||
| minWidth: 350, | ||
| width: 350, |
There was a problem hiding this comment.
const StyledCard = styled(Card)(({ theme }) => ({
width: 350,
maxWidth: '100%',
borderRadius: theme.shape.borderRadius,
}));| <Typography data-testid="goal-name" variant="h6"> | ||
| {goal.name ?? t('Unnamed Goal')} | ||
| </Typography> | ||
| <Tooltip title={goal.name ?? t('Unnamed Goal')}> |
There was a problem hiding this comment.
<Tooltip title={goal.name?.trim() || t('Unnamed Goal')}>
<Typography ...>
{goal.name?.trim() || t('Unnamed Goal')}
</Typography>
</Tooltip>There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: LOW (1/10)
Verdict: CLEAN (no issues found)
This PR was auto-approved because:
- The multi-agent AI review determined it is low risk
- No blocking issues were found
If you believe this PR needs human review, dismiss this approval and request a review manually.
Description
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions