[pull] main from MetaMask:main#407
Merged
Merged
Conversation
<!-- 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** The badge (dot) on the card icon button was displayed using a different color than the notification bell icon's badge, creating visual inconsistency. Per the issue requirements, this PR removes the badge from the card icon entirely to resolve the UX discrepancy. **Changes:** - Removed BadgeWrapper and BadgeStatus from CardButton component - Removed hasViewedCardButton state dependency from the component (metrics tracking still works) - Cleaned up related unit tests and snapshots - Removed badge getter from e2e page object and e2e test assertions - Removed unused CARD_BUTTON_BADGE selector ## **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: Removed the notification badge from the card icon button ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MDP-203 ## **Manual testing steps** ```gherkin Feature: Card button without badge Scenario: user views wallet header Given user is on the wallet home screen When user looks at the card icon button in the navbar Then no badge/dot is displayed on the card icon ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="391" height="823" alt="Screenshot 2025-12-12 at 15 41 42" src="https://github.com/user-attachments/assets/badf48df-78dc-4d18-93a1-878273729438" /> <!-- [screenshots/recordings] --> ### **After** <img width="391" height="833" alt="Screenshot 2025-12-12 at 16 21 33" src="https://github.com/user-attachments/assets/06628914-50de-490f-b0a5-4050c918cf46" /> <!-- [screenshots/recordings] --> ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Removes the badge from the navbar Card button and eliminates related state, selectors, and tests while keeping metrics tracking intact. > > - **UI** > - `CardButton`: remove `BadgeWrapper`/`BadgeStatus` and Redux `hasViewedCardButton` logic; call `onPress` directly; continue tracking `CARD_BUTTON_VIEWED` on mount. > - **Tests** > - Unit: simplify to render + `onPress` assertion; drop badge/state checks; update snapshot. > - E2E: remove badge assertions and getter; test taps `CARD_BUTTON` and verifies Card Home. > - **Selectors** > - Remove `WalletViewSelectorsIDs.CARD_BUTTON_BADGE`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 46dbfff. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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 fixes an issue that caused Swap button to be blocked even though a quote was available. ## **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: Fixed a bug that caused Swap button to be blocked even though a quote was available ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3559 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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/4e38deb6-61d9-4b39-aaa0-ecf31906b5af ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adjusts `isSubmitDisabled` so the confirm button remains enabled during loading when an `activeQuote` exists. > > - **Bridge UI (`app/components/UI/Bridge/Views/BridgeView/index.tsx`)**: > - Refines `isSubmitDisabled` to `(isLoading && !activeQuote)` instead of `isLoading`, allowing confirm when a quote is already available. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5754e63. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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? --> Fixes a bug in `MultipleAlertModal` where closing the modal while viewing one alert and reopening it by clicking a different alert would cause a mismatch between the alert content and styling. **Root cause:** The `selectedIndex` state (used for styling/severity) was not syncing with the `alertKey` (used for content) when the modal was reopened. This caused scenarios where a Warning alert's yellow styling would display with a Danger alert's red content, or vice versa. **Solution:** Added a `useEffect` that syncs `selectedIndex` with `alertKey` whenever the alertKey changes, ensuring the correct styling is always applied. ## **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: Fixed a bug where alert modal styling would not update correctly when switching between different severity alerts. ## **Related issues** Fixes: #23841 ## **Manual testing steps** ```gherkin Feature: Multiple alert modal styling synchronization Scenario: user closes and reopens alert modal with different alert Given the user is on a transaction confirmation screen with multiple alerts of different severities (e.g., a Warning alert on "Network fee" and a Danger alert on "You receive") When user clicks on the Warning alert to open the modal And user navigates to the Danger alert using the arrow And user closes the modal by tapping outside And user clicks on the Warning alert again Then the modal displays the Warning alert with correct yellow/warning styling Scenario: user switches between danger and warning alerts Given the user is on a transaction confirmation screen with a Danger alert and a Warning alert When user clicks on the Danger alert to open the modal And user closes the modal by tapping outside And user clicks on the Warning alert Then the modal displays the Warning alert with correct yellow/warning styling (not red/danger styling)## ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/81a6f432-fc08-4f27-8bce-6287ce5e330c ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/2afa4cfd-95ce-4d35-9886-fac5e6cfcf03 ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Syncs `selectedIndex` with `alertKey` in `MultipleAlertModal` to keep styling/content aligned and adds a test for this behavior. > > - **Confirmations UI**: > - `multiple-alert-modal.tsx`: Add `useEffect` to sync `selectedIndex` with `alertKey`, ensuring correct styling when switching/reopening alerts. > - Update imports to include `useEffect`. > - **Tests**: > - `multiple-alert-modal.test.tsx`: Add test validating `selectedIndex` updates when `alertKey` changes; minor setup adjustments. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eacd2ad. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )