Commit b2dc4a2
authored
fix: fixes recipient modal long text overflow (#38454)
## **Description**
The destination account picker modal was experiencing horizontal
overflow when account names were long (e.g., external addresses used as
names). This created a poor UX with horizontal scrolling.
The fix adds proper overflow handling to the account name container:
- Added `overflow: hidden`, `flex: 1`, and `minWidth: 0` to the Column
containing the name (the `minWidth: 0` is key for flex children to allow
shrinking below content size)
- Added `overflow: hidden` to the Row
- Added explicit `textOverflow: ellipsis` to the Text component
- Added `flexShrink: 0` to the checkmark icon so it doesn't get squished
Now long account names are properly truncated with an ellipsis instead
of causing overflow.
[](https://codespaces.new/MetaMask/metamask-extension/pull/38454?quickstart=1)
## **Changelog**
CHANGELOG entry: Fixed recipient modal overflow when account names are
long
## **Related issues**
Fixes: #38107
## **Manual testing steps**
1. Create or import an account with a very long name (or use an external
address as an account name)
2. Go to the Bridge page
3. Select a non-EVM chain (Bitcoin or Solana) as the destination
4. Open the destination account picker modal
5. Verify that long account names are truncated with an ellipsis instead
of causing horizontal overflow
6. Verify the modal layout looks clean without horizontal scrolling
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Prevents horizontal overflow in the destination account picker by
constraining flex children and adding ellipsis truncation; updates
snapshots accordingly.
>
> - **UI (Destination account picker)**:
> - In
`ui/pages/bridge/prepare/components/destination-account-list-item.tsx`:
> - Add `style={{ overflow: 'hidden', flex: 1, minWidth: 0 }}` to
`Column` wrapping the name.
> - Set `Row` to `style={{ overflow: 'hidden' }}` and `Text` to
`style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}` with
`ellipsis` prop.
> - Prevent check icon from shrinking via `style={{ flexShrink: 0 }}`.
> - **Tests**:
> - Update snapshots in
`__snapshots__/destination-account-picker-modal.test.tsx.snap` to
reflect new overflow, flex, and ellipsis styles.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
17f58cd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 1c19782 commit b2dc4a2
File tree
2 files changed
+27
-8
lines changed- ui/pages/bridge/prepare/components
- __snapshots__
2 files changed
+27
-8
lines changedLines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
| 249 | + | |
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
| 253 | + | |
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
| 257 | + | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
| |||
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
| 349 | + | |
344 | 350 | | |
345 | 351 | | |
346 | 352 | | |
347 | | - | |
| 353 | + | |
348 | 354 | | |
349 | 355 | | |
350 | 356 | | |
| 357 | + | |
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
| |||
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
| 541 | + | |
534 | 542 | | |
535 | 543 | | |
536 | 544 | | |
537 | | - | |
| 545 | + | |
538 | 546 | | |
539 | 547 | | |
540 | 548 | | |
| 549 | + | |
541 | 550 | | |
542 | 551 | | |
543 | 552 | | |
| |||
629 | 638 | | |
630 | 639 | | |
631 | 640 | | |
| 641 | + | |
632 | 642 | | |
633 | 643 | | |
634 | 644 | | |
635 | | - | |
| 645 | + | |
636 | 646 | | |
637 | 647 | | |
638 | 648 | | |
| 649 | + | |
639 | 650 | | |
640 | 651 | | |
641 | 652 | | |
| |||
727 | 738 | | |
728 | 739 | | |
729 | 740 | | |
| 741 | + | |
730 | 742 | | |
731 | 743 | | |
732 | 744 | | |
733 | | - | |
| 745 | + | |
734 | 746 | | |
735 | 747 | | |
736 | 748 | | |
| 749 | + | |
737 | 750 | | |
738 | 751 | | |
739 | 752 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | | - | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
0 commit comments