Skip to content

fix: allow SRP button text to wrap on OnboardingSheet#27330

Merged
tylerc-consensys merged 2 commits into
refactor/onboarding-tailwind-migration-part1from
fix/onboarding-srp-button-multiline
Mar 16, 2026
Merged

fix: allow SRP button text to wrap on OnboardingSheet#27330
tylerc-consensys merged 2 commits into
refactor/onboarding-tailwind-migration-part1from
fix/onboarding-srp-button-multiline

Conversation

@tylerc-consensys

@tylerc-consensys tylerc-consensys commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Description

Users who set their system font size to maximum scale experience button text clipping on the Onboarding and OnboardingSheet screens. The design system ButtonPrimary and ButtonSecondary both hardcode numberOfLines: 1 with ellipsizeMode: 'clip', and ButtonBase uses a fixed height (h-12 for Lg, h-10 for Md). This means longer strings like "Import using Secret Recovery Phrase" and "I have an existing wallet" get cut off instead of wrapping.

This fix overrides the button containers to use min-h h-auto py-3 and sets numberOfLines: 0 so buttons expand to fit their content at any font scale.

Depends on #26673 being merged first — this branch is based on refactor/onboarding-tailwind-migration-part1.

Screens fixed

Screen Buttons
Onboarding/index.tsx "Create a new wallet", "I have an existing wallet"
OnboardingSheet/index.tsx "Import using Secret Recovery Phrase" / "Continue with Secret Recovery Phrase"

Root cause

Two constraints in @metamask/design-system-react-native:

  1. ButtonPrimary and ButtonSecondary both pass numberOfLines: 1, ellipsizeMode: 'clip' to ButtonBase text props
  2. ButtonBase applies a fixed height class (h-12 for Lg, h-10 for Md) via TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION

Both are overridable from the consumer side via textProps and twClassName.

Changelog

CHANGELOG entry: null

Related issues

Depends on: #26673

Manual testing steps

Feature: Onboarding button text wrapping at max font scale

  Scenario: user views onboarding with system font set to maximum
    Given app is freshly installed
    And user's system font size is set to largest/maximum

    When user reaches the onboarding screen
    Then "Create a new wallet" and "I have an existing wallet" buttons display full text without clipping

  Scenario: user views onboarding sheet with large font
    Given user taps "Create a new wallet" or "I already have a wallet"

    When the onboarding sheet appears
    Then the "Import using Secret Recovery Phrase" button text wraps to multiple lines instead of being clipped

Screenshots/Recordings

Before

Button text is clipped to one line on devices with max font scale:

Screenshot_1773224200 Screenshot_1773222833

After

Buttons expand to fit the full text:

Screenshot_1773224472 Screenshot_1773222827

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.

The design system ButtonSecondary hardcodes numberOfLines: 1 and
ButtonBase uses a fixed h-12, so long strings like "Import using
Secret Recovery Phrase" get clipped on narrower devices.

Override with min-h-12 h-auto py-3 and numberOfLines: 0 so the
button expands to fit its content.

Made-with: Cursor
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-onboarding Onboarding team label Mar 11, 2026
@tylerc-consensys tylerc-consensys added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Mar 11, 2026
@tylerc-consensys tylerc-consensys self-assigned this Mar 11, 2026
Same numberOfLines: 1 and fixed-height issue as OnboardingSheet.
Apply min-h h-auto py-3 and numberOfLines: 0 to both "Create a
new wallet" and "I have an existing wallet" buttons.

Made-with: Cursor
@tylerc-consensys tylerc-consensys requested a review from a team as a code owner March 11, 2026 10:19
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: refactor/onboarding-tailwind-migration-part1)

All E2E tests pre-selected.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
9 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

Comment thread app/components/Views/Onboarding/index.tsx

@smgv smgv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tylerc-consensys tylerc-consensys merged commit 7775d2b into refactor/onboarding-tailwind-migration-part1 Mar 16, 2026
110 checks passed
@tylerc-consensys tylerc-consensys deleted the fix/onboarding-srp-button-multiline branch March 16, 2026 10:34
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-XS team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants