MPDX-9653 - Simplify From Account -> To Account behavior in Savings Fund Transfer#1812
Conversation
|
Preview branch generated at https://MPDX-9653.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 01f7baf No significant changes found |
141d84e to
05e8a55
Compare
zweatshirt
left a comment
There was a problem hiding this comment.
Multi-Agent Code Review — PR #1812
Mode: standard · Risk: LOW (3/10) · Verdict: CLEAN · Blockers: 0
Locks the From account in the Savings Fund Transfer modal (read-only, full-contrast Select with the dropdown arrow hidden) and removes the "TRANSFER TO" entry point from the balance card. Net deletion; mostly simplification. The full SavingsFundTransfer suite passes and lint:ts is clean.
Resolved since earlier iterations
The From account was briefly a disabled Select, which greyed out the must-read balance and flattened the negative-balance red. Switching to readOnly restores full contrast (and keeps the value in the tab order / a11y tree so screen-reader users can still read the source fund + balance), while the hidden arrow + read-only behavior keep it locked. Verified: clicking it opens no menu.
Suggestions (informational — severity < 5, none block)
[Suggestion] src/components/HrTools/SavingsFundTransfer/TransferModal/TransferModal.tsx — From Select reserved arrow gutter (3.5/10, UX)
With the arrow hidden via IconComponent={() => null}, MUI still reserves right-padding on .MuiSelect-select, so the From value sits with dead space vs the To field. Optional: sx={{ '& .MuiSelect-select': { pr: '14px !important' } }}.
[Suggestion] src/components/HrTools/SavingsFundTransfer/TransferModal/TransferModal.test.tsx — lock test only covers mouse (4.0/10, Testing)
The "locks the From Account" test clicks and asserts no listbox; a MUI Select can also open via Enter/ArrowDown. readOnly blocks that too, but it isn't pinned by a test. Optional: add userEvent.type(fromAccount, '{enter}') then assert no listbox.
[Suggestion] src/components/HrTools/SavingsFundTransfer/TransferModal/TransferModal.test.tsx — findBy convention (3.5/10, Testing)
The synchronous getByRole('option', { name: /staff savings/i }) after the waitFor would be marginally more idiomatic as await findByRole(...). Not flaky as-is.
[Suggestion] src/components/HrTools/SavingsFundTransfer/TransferModal/TransferModal.tsx — Note field disabled={!isNew} dropped (4.5/10, Architecture)
The Note field is now editable in edit mode, but updateRecurringTransfer has no description field, so an edit-mode note change would be silently dropped. Proven unreachable today (editable rows are always Monthly; the Note renders only for OneTime) — latent debt, not a live bug. Consider restoring disabled={!isNew} to make intent explicit.
Clean dimensions
- Financial: no money/balance/date logic changed; deficit-warning math still keys on the correct source fund.
- Standards: named exports, no orphaned imports,
lint:ci0 errors,IconComponent={() => null}trips no rule. - Architecture: net technical-debt reduction (swap + dual-direction complexity removed).
- Security / Data Integrity: not triggered (no api/auth/env/workflow or graphql/cache/schema changes).
There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: LOW (3/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.
|
@kegrimes This was a suggested change by Scott. I kind of liked the original design more, and so made the suggestion to him that we keep the original design. I'll wait for his response before merging this. I was curious what you think of this visually and whether you think it satisfies the ticket description |
kegrimes
left a comment
There was a problem hiding this comment.
I think this looks very good Zach!
Honestly, I did like the original design a lot, but I understand why he would want this change. It was really repetitive to have 6 buttons for 3 different fund types. I think that in terms of money, most people would be thinking in the direction of "transfer from --> transfer to" and not really the other way around.
| disabled={!isNew} | ||
| onChange={handleChange} | ||
| onBlur={handleBlur} | ||
| readOnly |
There was a problem hiding this comment.
Could we add something like this to make it unclickable?
| readOnly | |
| readOnly | |
| tabIndex={-1} | |
| sx={{ pointerEvents: 'none' }} |
There was a problem hiding this comment.
I am leaning toward making it clickable (hoverable) for accessibility if that's ok. Otherwise users with screen readers can't know what the from account is. At least that was the intention. With that being said, I should test what the screen reader actually produces on hover here.
Description
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions