Skip to content

fix(ramp): replace deposit header close button with back button#25126

Merged
wachunei merged 2 commits intomainfrom
fix/mdp-274-deposit-header-back-button
Jan 23, 2026
Merged

fix(ramp): replace deposit header close button with back button#25126
wachunei merged 2 commits intomainfrom
fix/mdp-274-deposit-header-back-button

Conversation

@wachunei
Copy link
Copy Markdown
Member

@wachunei wachunei commented Jan 23, 2026

Description

This PR addresses the first action item of MDP-274 - "Deposit: page header revisions".

Problem

The Deposit page header had incorrect and misaligned button icons:

  • Left side: Settings icon (⚙️) when showConfiguration was enabled
  • Right side: Close button (✕) to dismiss the flow

This pattern was inconsistent with standard navigation patterns and the updated design requirements.

Solution

Updated getDepositNavbarOptions in app/components/UI/Navbar/index.js to:

  • Left side: Back arrow (←) button that navigates back and optionally calls onClose callback
  • Right side: Settings/configuration icon (⚙️) when showConfiguration is enabled

Changes Made

  1. Core navbar function (Navbar/index.js):

    • Refactored getDepositNavbarOptions to show back button on left when showBack || showClose
    • Moved configuration (settings) icon to right side via closeButtonProps
    • Added new testID deposit-back-navbar-button for the back button
    • Removed old deposit-close-navbar-button testID
  2. Deposit views:

    • BuildQuote.tsx: Simplified options (removed explicit showBack: false, showClose: true)
    • DepositOrderDetails.tsx: Removed showClose: false
  3. Aggregator views (also use getDepositNavbarOptions):

    • OrderDetails.tsx: Removed showClose: false
    • SendTransaction.tsx: Removed showClose: false
  4. Test updates:

    • Updated BuildQuote.test.tsx and Quotes.test.tsx to use new testID
    • Renamed tests from "cancel button press" to "back button press"
    • Added pop: mockPop to navigation mocks
  5. Snapshot updates:

    • 11 snapshot files updated to reflect new header structure
    • Close button removed from right side
    • Back arrow with new testID on left side

Changelog

CHANGELOG entry: fix: Updated Deposit page header to use back button instead of close button

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MDP-274 (first action item)

Manual testing steps

Feature: Deposit Page Header Navigation

  Scenario: User navigates back from Deposit BuildQuote screen
    Given user is on the Deposit BuildQuote screen
    And user sees a back arrow button on the left side of the header
    And user sees a settings icon on the right side of the header

    When user taps the back arrow button
    Then user is navigated back to the previous screen

  Scenario: User opens configuration from Deposit BuildQuote screen
    Given user is on the Deposit BuildQuote screen
    And user sees a settings icon on the right side of the header

    When user taps the settings icon
    Then the configuration modal is displayed

  Scenario: User navigates back from Deposit sub-screens
    Given user is on any Deposit sub-screen (EnterEmail, BasicInfo, etc.)
    And user sees a back arrow button on the left side of the header

    When user taps the back arrow button
    Then user is navigated back to the previous screen in the flow

Screenshots/Recordings

Before

before_mdp274_1 before_mdp274_2 png before_mdp274_3 png

After

after_mdp274_1 after_mdp274_2 after_mdp274_3

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

Aligns Deposit and Aggregator headers with standard navigation.

  • Refactors getDepositNavbarOptions to show back button when showBack || showClose; settings icon now on the right via closeButtonProps
  • Adds deposit-back-navbar-button testID; removes deposit-close-navbar-button
  • Simplifies screen options in Deposit/Aggregator views (removes explicit showClose); BuildQuote keeps configuration via right-side button
  • Updates unit tests to use back button semantics and navigation pop; adjusts navigation mocks
  • Refreshes snapshots across affected screens to reflect new header structure and icons

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

- Replace settings icon + close button pattern with single back button
- Move configuration (settings) icon to right side of header
- Update testID from deposit-close-navbar-button to deposit-back-navbar-button
- Update tests to reflect new back button behavior

Fixes first action item of MDP-274
@metamaskbot metamaskbot added the team-money-movement issues related to Money Movement features label Jan 23, 2026
@wachunei wachunei marked this pull request as ready for review January 23, 2026 18:29
@wachunei wachunei requested a review from a team as a code owner January 23, 2026 18:29
@wachunei wachunei added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 23, 2026
@wachunei
Copy link
Copy Markdown
Member Author

Skipping sonar could issues from existing code

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

The changes in this PR are specifically scoped to the Ramp (on-ramp/off-ramp) feature navigation. The main code change is in app/components/UI/Navbar/index.js, specifically the getDepositNavbarOptions function which is exclusively used by Ramp-related views (BuildQuote, OrderDetails, SendTransaction, DepositOrderDetails, etc.).

Key changes:

  1. Navigation behavior modification: Changed from navigation.dangerouslyGetParent()?.pop() to navigation.pop() with onClose callback
  2. Button configuration restructuring: The back button now uses deposit-back-navbar-button testID, and the settings button is moved to closeButtonProps
  3. Removal of showClose: false from several Ramp views as the default behavior changed

All the snapshot updates and test changes are in the Ramp/Aggregator and Ramp/Deposit directories, confirming the scope is limited to the Ramps feature. The unit tests were updated to use the new testID (deposit-back-navbar-button instead of deposit-close-navbar-button).

While the Navbar component is widely used across the app, the specific function modified (getDepositNavbarOptions) is only used by Ramp-related views. This is a UI/navigation change that could affect user flows in the buy/sell crypto screens, so running SmokeRamps tests is appropriate to validate the navigation behavior still works correctly.

View GitHub Actions results

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.89%. Comparing base (c6a28b6) to head (4cba5b0).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #25126    +/-   ##
========================================
  Coverage   79.88%   79.89%            
========================================
  Files        4245     4253     +8     
  Lines      109107   109279   +172     
  Branches    22820    22871    +51     
========================================
+ Hits        87164    87307   +143     
- Misses      15891    15914    +23     
- Partials     6052     6058     +6     

☔ 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.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@wachunei wachunei added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 75a3ada Jan 23, 2026
82 of 83 checks passed
@wachunei wachunei deleted the fix/mdp-274-deposit-header-back-button branch January 23, 2026 19:58
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Jan 23, 2026
@metamaskbot metamaskbot added release-7.64.0 Issue or pull request that will be included in release 7.64.0 and removed release-7.65.0 Issue or pull request that will be included in release 7.65.0 labels Feb 3, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-7.64.0 on PR. Adding release label release-7.64.0 on PR and removing other release labels(release-7.65.0), as PR was added to branch 7.64.0 when release was cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants