Commit 6dc66fb
authored
refactor(ManualBackupStep2): migrate to design system components (#27577)
# PR Title
refactor(ManualBackupStep2): migrate to design system components
---
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This refactor migrates `ManualBackupStep2` (SRP verification quiz) to
design system primitives and Tailwind utilities to align with current
mobile UI standards and reduce legacy styling patterns.
The screen now uses `Box`/design-system layout patterns and
`useTailwind`-based styling instead of `View` + `StyleSheet.create`,
while preserving the SRP placement flow and analytics behavior. Minor
safety improvements were included in interaction logic (e.g., radix-safe
`parseInt`, defensive array cloning before `sort`) to avoid
mutation-related edge cases.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: Secret Recovery Phrase verification screen refactor
Scenario: user completes SRP word verification in onboarding flow
Given the user creates a new wallet and reaches the SRP backup flow
And the app is on ManualBackupStep2
When user taps missing words in the correct order and fills all empty slots
Then the Continue button becomes enabled
And user can continue to the next backup step without visual/layout regressions
Scenario: user changes a previously selected SRP word
Given the app is on ManualBackupStep2 with at least one filled slot
When user taps a filled slot or taps an already-used word
Then the previously assigned word is removed from that position
And the slot selection/focus updates correctly for the next word tap
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
| Theme | Before | After |
| --- | --- | --- |
| Light | <img width="220" alt="Before light"
src="https://github.com/user-attachments/assets/ba5ebd94-e1b3-403e-86d3-b9c4b7331eb7"
/> | <img width="220" alt="After light"
src="https://github.com/user-attachments/assets/2464cf3b-2eb0-4be8-bf6f-516cdeacc19c"
/> |
| Dark | <img width="220" alt="Before dark"
src="https://github.com/user-attachments/assets/3a880168-3630-4f6b-a1b8-a9af33a357c5"
/> | <img width="220" alt="After dark"
src="https://github.com/user-attachments/assets/562e3dc8-af1b-442c-90f9-f0b5f1ea3155"
/> |
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/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.
<!-- Generated with the help of the pr-description AI skill -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Mostly a UI/styling refactor of the SRP verification screen, but it
touches a critical onboarding flow and slightly adjusts slot/word
selection logic (sorting and index parsing), so regressions could block
SRP confirmation.
>
> **Overview**
> Refactors `ManualBackupStep2` (SRP verification) to use design-system
primitives (`Box`, `Text`, `Icon`) and Tailwind-based styling, replacing
the legacy `StyleSheet` implementation and removing `styles.ts`.
>
> Makes small safety/behavior tweaks in the word-placement logic (avoid
in-place `sort` mutation, use radix-safe `parseInt`, and update layout
sizing via `useWindowDimensions`/platform-specific spacing) while
keeping navigation, analytics, and success/error handling flows intact.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5b562a6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 34182c0 commit 6dc66fb
2 files changed
Lines changed: 107 additions & 257 deletions
0 commit comments