Commit 3d613d9
authored
refactor: migrate ChoosePassword to design system components and Tailwind CSS (MetaMask#27616)
<!--
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 PR migrates the `ChoosePassword` view and its
`FoxRiveLoaderAnimation` sub-component away from legacy
StyleSheet.create()-based styling toward the `MetaMask design system and
Tailwind CSS`.
Jira Link: https://consensyssoftware.atlassian.net/browse/TO-602
## **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: migrate ChoosePassword to design system components and
Tailwind CSS
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: ChoosePassword screen — visual and functional parity after style migration
Scenario: New wallet creation with SRP backup
Given the app is freshly installed and onboarding is in progress
When the user reaches the "Create Password" screen
Then the screen renders with title, password field, confirm field, checkbox, and button
And the "Create Password" button is disabled
When the user types a password ≥ 8 characters
And types the same value in the confirm password field
And checks the "I understand" checkbox
Then the "Create Password" button becomes enabled
When the user taps "Create Password"
Then the Fox Rive loading animation appears and the form is hidden
And after completion the user is navigated to the Manual Backup step
Scenario: Password mismatch validation
Given the user is on the "Create Password" screen
When the user types different values in each password field
Then a mismatch error is displayed and the button stays disabled
Scenario: Password too short
Given the user is on the "Create Password" screen
When the user types fewer than 8 characters
Then the helper text "Must be at least 8 characters" is always visible
Scenario: OAuth (social login) flow
Given the user arrived via a social login
Then the button is enabled without checking the checkbox
And on submit the user is navigated to the Onboarding Success screen
Scenario: Dark-mode theme correctness
Given the device is in dark mode
When the user opens the "Create Password" screen
Then all text, backgrounds, and icons use correct design system colour tokens
And no hardcoded colours are visible
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/79e2215f-8874-46eb-b332-840ac271a75d
https://github.com/user-attachments/assets/70708f0b-5417-4b65-bbbe-4d765c71a379
## **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**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> UI refactor of the password creation/onboarding flow that changes
component primitives, accessibility identifiers, and loading/form
rendering, which can cause visual or E2E regressions despite largely
preserving business logic.
>
> **Overview**
> Migrates the `ChoosePassword` screen and `FoxRiveLoaderAnimation` from
legacy `StyleSheet` + internal component-library primitives to
**design-system React Native components** (`Box`, `Text`, `TextField`,
`Button`, `Checkbox`, `Icon`) styled via **Tailwind** (`useTailwind`),
deleting the old `*.styles.ts` files.
>
> Adjusts a few UI behaviors and identifiers (e.g., confirm-password eye
toggle disabled when empty, adds `accessibilityLabel`s for password
fields, updates icon color tokens) and updates snapshots/unit tests
accordingly, including refactored `ChoosePassword` tests and Detox page
object selectors to use labels on Android.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7ddefaf. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 9385d8c commit 3d613d9
10 files changed
Lines changed: 1322 additions & 1976 deletions
File tree
- app/components/Views
- ChoosePassword
- FoxRiveLoaderAnimation
- __snapshots__
- __snapshots__
- ImportFromSecretRecoveryPhrase
- tests/page-objects/Onboarding
Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 46 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
16 | 27 | | |
17 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
18 | 36 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
22 | 40 | | |
23 | 41 | | |
24 | 42 | | |
| |||
32 | 50 | | |
33 | 51 | | |
34 | 52 | | |
35 | | - | |
36 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
37 | 65 | | |
38 | 66 | | |
39 | 67 | | |
40 | | - | |
| 68 | + | |
41 | 69 | | |
42 | 70 | | |
43 | 71 | | |
44 | 72 | | |
45 | | - | |
46 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
47 | 79 | | |
48 | | - | |
49 | | - | |
| 80 | + | |
| 81 | + | |
50 | 82 | | |
51 | 83 | | |
52 | 84 | | |
| |||
Lines changed: 40 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
17 | 36 | | |
18 | 37 | | |
19 | 38 | | |
| |||
22 | 41 | | |
23 | 42 | | |
24 | 43 | | |
25 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
26 | 48 | | |
27 | 49 | | |
28 | 50 | | |
29 | 51 | | |
30 | 52 | | |
31 | 53 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
35 | 65 | | |
36 | 66 | | |
37 | 67 | | |
| |||
Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 59 | | |
70 | 60 | | |
71 | 61 | | |
| |||
0 commit comments