Skip to content

fix: truncate long account names in Deposit AccountSelector#25715

Merged
wachunei merged 3 commits intomainfrom
fix/deposit-account-selector-long-name-truncation
Feb 6, 2026
Merged

fix: truncate long account names in Deposit AccountSelector#25715
wachunei merged 3 commits intomainfrom
fix/deposit-account-selector-long-name-truncation

Conversation

@wachunei
Copy link
Copy Markdown
Member

@wachunei wachunei commented Feb 5, 2026

Description

The Deposit AccountSelector component does not properly truncate long account names, causing text to overflow horizontally and get cut off at screen edges. This differs from the Aggregator AccountSelector which correctly truncates with middle ellipsis.

Root Cause

The Deposit AccountSelector was missing flexShrink: 1 on both the container and text elements. Without this property:

  • numberOfLines={1} and ellipsizeMode="middle" cannot work because the text width is unconstrained
  • The parent container grows indefinitely, causing overflow instead of truncation

Solution

Added flexShrink: 1 to match the Aggregator AccountSelector pattern:

  1. Added flexShrink: 1 to the selector style
  2. Created new accountText style with flexShrink: 1
  3. Applied accountText style to the Text component

Changelog

CHANGELOG entry: Fixed long account names overflowing in the Deposit Buy screen by enabling proper text truncation

Related issues

Refs: N/A (discovered during UI review)

Manual testing steps

Feature: Deposit AccountSelector long name truncation

  Scenario: User sees truncated account name with middle ellipsis
    Given the user has an account with a very long name (e.g., "Account 4 - This is a very long account name for testing purposes")
    And the user navigates to the Deposit/Buy flow

    When user views the BuildQuote screen
    Then the account name should be truncated with ellipsis in the middle (e.g., "Account 4 - T...ting purposes")
    And the account selector pill should not overflow the screen
    And the region selector should remain visible on the right side

Screenshots/Recordings

Before

image

After

image

Pre-merge author checklist

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.

Note

Low Risk
Small, isolated styling change to a UI component; primary risk is minor layout regression across devices/themes.

Overview
Fixes an overflow issue in the Deposit ramp AccountSelector where long account names could push the selector pill beyond screen bounds instead of truncating.

Adds flexShrink: 1 to the selector container and applies a new accountText style (also flexShrink: 1) to enable numberOfLines={1} + middle ellipsis to work reliably; updates the BuildQuote snapshot accordingly.

Written by Cursor Bugbot for commit f13c5a1. This will update automatically on new commits. Configure here.

Add flexShrink to AccountSelector container and text to enable proper
middle ellipsis truncation for long account names, matching the behavior
of the Aggregator AccountSelector component.
@wachunei wachunei added the team-money-movement issues related to Money Movement features label Feb 5, 2026
@wachunei wachunei self-assigned this Feb 5, 2026
@wachunei wachunei marked this pull request as ready for review February 5, 2026 15:49
@wachunei wachunei requested a review from a team as a code owner February 5, 2026 15:49
@wachunei wachunei added this pull request to the merge queue Feb 5, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2026
@wachunei wachunei enabled auto-merge February 5, 2026 20:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 6, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are purely cosmetic CSS styling fixes to the Ramp Deposit AccountSelector component:

  1. AccountSelector.styles.ts: Added flexShrink: 1 to the container style and created a new accountText style with flexShrink: 1
  2. AccountSelector.tsx: Applied the new accountText style to the Text component
  3. BuildQuote.test.tsx.snap: Snapshot updates reflecting the flexShrink: 1 style change

This is a minor layout fix to prevent text overflow in the account selector within the Ramp Deposit BuildQuote view. The changes:

  • Are purely visual/CSS (no logic changes)
  • Are localized to the Ramp Deposit feature only
  • Have corresponding snapshot test updates
  • Don't affect any other components or flows

SmokeRamps is the appropriate tag as it covers fiat on-ramp (buy crypto) features, which includes the Deposit flow where this AccountSelector component is used.

Performance Test Selection:
The changes are purely CSS styling fixes (adding flexShrink: 1 property) to a single component in the Ramp Deposit flow. These minor styling adjustments do not impact rendering performance, data loading, or any critical user flows. No performance tests are needed for this cosmetic change.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 6, 2026

@wachunei wachunei added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit 40e5e1d Feb 6, 2026
85 checks passed
@wachunei wachunei deleted the fix/deposit-account-selector-long-name-truncation branch February 6, 2026 14:06
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
@metamaskbot metamaskbot added the release-7.66.0 Issue or pull request that will be included in release 7.66.0 label Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.66.0 Issue or pull request that will be included in release 7.66.0 size-XS team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants