Skip to content

refactor: migrate SRPInputGrid to design system components and Tailwi…#28137

Merged
smgv merged 10 commits intomainfrom
fix/import-srp-padding
Apr 1, 2026
Merged

refactor: migrate SRPInputGrid to design system components and Tailwi…#28137
smgv merged 10 commits intomainfrom
fix/import-srp-padding

Conversation

@smgv
Copy link
Copy Markdown
Contributor

@smgv smgv commented Mar 31, 2026

…nd CSS

Description

This PR migrates the SRPInputGrid view away from legacy StyleSheet.create()-based styling toward the MetaMask design system and Tailwind CSS. Also migrated to Typescript as a functional component.

Jira Link: https://consensyssoftware.atlassian.net/browse/TO-646

Changelog

CHANGELOG entry: migrate SRPInputGrid to design system components and Tailwind CSS

Related issues

Fixes:

Manual testing steps

Feature: Import SRP

  Scenario: when the user use the existing wallet SRP
    Then validate the UI

Screenshots/Recordings

Before

After

Screen.Recording.2026-03-31.at.1.14.08.PM.mov
Screen.Recording.2026-03-31.at.1.14.39.PM.mov
Screen.Recording.2026-03-31.at.1.16.04.PM.mov
Screenshot 2026-03-31 at 1 18 04 PM Screenshot 2026-03-31 at 1 18 12 PM Screenshot 2026-03-31 at 1 18 47 PM

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

Medium Risk
UI-heavy refactor of the Secret Recovery Phrase input flow; while logic is mostly preserved, changes to component structure, styling, and input props/focus handling could introduce regressions in SRP entry/paste behavior.

Overview
Refactors SrpInputGrid to use MetaMask design-system primitives (Box, Button, design-system Text) and Tailwind-based styling, removing the legacy StyleSheet.create file and updating layout/style behavior accordingly.

Consolidates shared TextInput props into SHARED_INPUT_PROPS, moves word validation helper out of the component, and replaces the inline paste/clear Text action with a tertiary Button; Jest snapshots are updated to reflect the new rendered structure and styling.

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

@smgv smgv self-assigned this Mar 31, 2026
@smgv smgv added the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label Mar 31, 2026
@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 31, 2026
@github-actions github-actions bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 31, 2026
@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 31, 2026
@github-actions github-actions bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 31, 2026
@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 31, 2026
spellCheck: false,
importantForAutofill: 'no' as const,
showSoftInputOnFocus: true,
autoCapitalize: 'none' as const,
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.

there is no blurOnSubmit (old behavior was explicit blurOnSubmit={false} on each SrpInput).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its deprecated

@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 1, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@LeVinhGithub LeVinhGithub added QA Passed QA testing has been completed and passed and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Apr 1, 2026
LeVinhGithub
LeVinhGithub previously approved these changes Apr 1, 2026
@github-actions github-actions bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 1, 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 Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform, SmokeAccounts, SmokeIdentity
  • Selected Performance tags: @PerformanceOnboarding
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are a UI refactoring of the SrpInputGrid component - migrating from custom StyleSheet styles to the @metamask/design-system-react-native component library (Box, Button, Text) and Tailwind CSS. The styles file was deleted and replaced with inline Tailwind styles.

Key impacts:

  1. SrpInputGrid is used in two critical flows:

    • ImportFromSecretRecoveryPhrase (onboarding wallet import via SRP)
    • ImportNewSecretRecoveryPhrase (multi-SRP import flow)
  2. SmokeWalletPlatform is selected because:

    • tests/smoke/wallet/import-srp.spec.ts directly tests the multi-SRP import flow using ImportSrpView which interacts with the SrpInputGrid component
    • tests/smoke/multisrp/add-account.spec.ts tests adding accounts to SRPs
    • Analytics import wallet tests also exercise this flow
  3. SmokeAccounts is selected because:

    • Per tag description: when changes touch multi-SRP architecture, also select SmokeAccounts
    • SRP reveal and account management tests are related to the SRP input component
  4. SmokeIdentity is selected because:

    • tests/smoke/identity/account-syncing/multi-srp.spec.ts uses inputSrp() and ImportSrpView which directly interact with the changed SrpInputGrid component
    • Per tag description: when changes touch multi-SRP flows, also select SmokeIdentity

The changes are purely UI/styling (no logic changes to SRP handling), but the visual rendering of the SRP input grid changed significantly (new component library, different layout structure). This could affect E2E tests that rely on element visibility, testIDs, or interaction with the input fields. The testIDs themselves are preserved in the component, reducing risk of test breakage, but visual/layout changes warrant validation.

Performance Test Selection:
The SrpInputGrid component is used in the ImportFromSecretRecoveryPhrase onboarding flow. The refactoring from StyleSheet to Tailwind CSS and design system components could have minor performance implications during the onboarding import flow. The @PerformanceOnboarding tag covers wallet creation and SRP import flows, making it relevant to validate that the design system migration doesn't introduce rendering performance regressions.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@smgv smgv added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit d99884d Apr 1, 2026
97 checks passed
@smgv smgv deleted the fix/import-srp-padding branch April 1, 2026 11:13
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2026
@weitingsun weitingsun added release-7.73.0 Issue or pull request that will be included in release 7.73.0 and removed release-101.2.0 labels Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

QA Passed QA testing has been completed and passed release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants