Skip to content

refactor(AccountBackupStep1B): migrate to design system components#27581

Merged
tylerc-consensys merged 8 commits into
mainfrom
tylerchong/ds-migrate-account-backup-step1b
Mar 20, 2026
Merged

refactor(AccountBackupStep1B): migrate to design system components#27581
tylerc-consensys merged 8 commits into
mainfrom
tylerchong/ds-migrate-account-backup-step1b

Conversation

@tylerc-consensys

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

Copy link
Copy Markdown
Contributor

Description

Migrates AccountBackupStep1B from legacy React Native primitives to the MetaMask design system. Replaces raw View components with Box, removes StyleSheet.create() in favor of twClassName Tailwind utilities, and adds the useTailwind hook. Also fixes a precommit violation by replacing the static Dimensions.get('window') module-level call with the useWindowDimensions() hook (so layout responds to rotation/resize), removes redundant BoxFlexDirection.Column props, and replaces all arbitrary Tailwind bracket values (e.g. text-[32px], leading-[17px]) with design system scale steps.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: Account Backup Step 1B screen

  Scenario: Visual parity after design system migration
    Given the user has created a new wallet and reached the backup prompt
    When the AccountBackupStep1B screen is displayed
    Then the layout, typography, and spacing appear identical to the pre-migration design
    And the "Why is this important?" info button is tappable and opens the modal
    And the modal close button dismisses the modal
    And the "Start" CTA navigates to ManualBackupStep1
    And the SRP explanation link opens the SRP info sheet

  Scenario: Responsive layout on device rotation
    Given the user is on the AccountBackupStep1B screen
    When the device is rotated to landscape
    Then the seed phrase illustration resizes correctly without layout overflow

Screenshots/Recordings

Before After
Light
Dark

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
Low risk refactor limited to a single onboarding screen, primarily swapping UI primitives/styling; main risk is visual or interaction regressions (modal/CTA/link) across device sizes/rotation.

Overview
Migrates AccountBackupStep1B to the MetaMask React Native design system by replacing legacy View/StyleSheet/custom button usage with Box, design-system Text, Button, Icon, and Tailwind (useTailwind) styling.

Updates the seed phrase illustration sizing to use useWindowDimensions() (instead of a module-level Dimensions constant) so layout recalculates on resize/rotation, and refactors repeated body/bullet copy into small helper components (BodyXsText, BulletText) while keeping navigation and metrics wiring intact.

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

Replace View with Box, StyleSheet.create with twClassName, and add
useTailwind hook for Tailwind CSS utility support.

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 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk size-M labels Mar 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.19%. Comparing base (7329b92) to head (d3f91ee).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #27581   +/-   ##
=======================================
  Coverage   82.19%   82.19%           
=======================================
  Files        4788     4788           
  Lines      123507   123506    -1     
  Branches    27363    27363           
=======================================
+ Hits       101511   101512    +1     
+ Misses      14962    14960    -2     
  Partials     7034     7034           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 18, 2026
- Replace Dimensions.get('window') with useWindowDimensions() hook for responsive layout
- Remove redundant BoxFlexDirection.Column props (column is default in RN)
- Remove ml-0 default and simplify p-5 pt-0 pb-0 → px-5
- Replace all arbitrary Tailwind bracket values with design system scale steps:
  text-[32px]→text-4xl, leading-[44px]→leading-tight, leading-[17px]→leading-4,
  text-[15px]→text-sm, text-[16px]→text-base, rounded-[10px]→rounded-xl,
  p-[27px]→p-7, w-[26px]→w-7, p-[5px]→p-1, mt-[21px]→mt-5

Made-with: Cursor
@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 19, 2026
… alias

- Remove eslint-disable react/prop-types suppression
- Add PropTypes for navigation, route, and saveOnboardingEvent props
- Remove Text alias (DSText) — import as Text directly

Made-with: Cursor
…em Button

- Remove Button import from component-library
- Import Button, ButtonVariant, ButtonSize from @metamask/design-system-react-native
- Replace label prop with children, ButtonVariants.Primary with ButtonVariant.Primary,
  and width={ButtonWidthTypes.Full} with isFullWidth

Made-with: Cursor
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 19, 2026
…ystem Icon/ButtonIcon

- Replace react-native-vector-icons/FontAwesome with design system Icon
  (IconName.Info) and ButtonIcon (IconName.Close)
- Simplify mt-4 mb-4 to my-4

Made-with: Cursor
- Replace lock emoji style override with DisplayMd variant (exact 32px match)
- Remove all lineHeight style overrides (CARD_LINE_HEIGHT, MODAL_LINE_HEIGHT,
  MODAL_BOLD_LINE_HEIGHT) — accept DS default line heights
- Drop LOCK_ICON_STYLE constant — no longer needed with DisplayMd

Made-with: Cursor
@tylerc-consensys tylerc-consensys marked this pull request as ready for review March 20, 2026 03:09
@tylerc-consensys tylerc-consensys requested a review from a team as a code owner March 20, 2026 03:09
@tylerc-consensys tylerc-consensys self-assigned this Mar 20, 2026
@tylerc-consensys

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

…ers to reduce duplication

Extract repeated <Text variant={TextVariant.BodyXs} color={TextColor.TextDefault}> patterns
into BodyXsText and BulletText helper components to address SonarCloud duplication gate.

Made-with: Cursor
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The change is a pure UI refactoring of the AccountBackupStep1B component (the "Protect Your Wallet" screen in the SRP backup onboarding flow). It migrates from legacy StyleSheet/View/Text/FontAwesome Icon to the MetaMask design system (@metamask/design-system-react-native with Tailwind). Key observations:

  1. No logic changes: Navigation, event tracking, modal behavior, and Redux connections are all unchanged.
  2. testID preserved: The ManualBackUpStepsSelectorsIDs.PROTECT_CONTAINER testID is kept, so E2E tests relying on it won't break.
  3. No direct E2E test references: No spec files directly reference AccountBackupStep1B by name.
  4. Component is in the SRP backup onboarding flow: This screen is part of the wallet creation/backup flow, which is covered by SmokeAccounts (SRP protection flows) and SmokeWalletPlatform (multi-SRP architecture).
  5. Risk: Low - purely cosmetic/structural UI change. The main risk is visual regression or a broken import from the design system library causing the screen to not render.

Selected SmokeAccounts because it covers SRP protection flows including the backup quiz validation. Selected SmokeWalletPlatform because it covers multi-SRP wallet architecture and wallet lifecycle. These two tags provide adequate coverage for validating the backup step screen renders and functions correctly after the refactoring.

Performance Test Selection:
This is a pure UI component refactoring with no performance-sensitive changes. The switch from Dimensions.get() to useWindowDimensions() is actually a minor improvement (reactive vs static), and the design system component swaps don't introduce any new data loading, list rendering, or state management that would impact performance metrics.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

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

@sonarqubecloud

Copy link
Copy Markdown

@tylerc-consensys tylerc-consensys added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit d4a78c6 Mar 20, 2026
94 checks passed
@tylerc-consensys tylerc-consensys deleted the tylerchong/ds-migrate-account-backup-step1b branch March 20, 2026 11:35
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 20, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-low Low testing needed · Low bug introduction risk size-M team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants