Skip to content

Conversation

georgeweiler
Copy link
Contributor

@georgeweiler georgeweiler commented Sep 29, 2025

Description

This PR refactors the ramp aggregator region modal to use the new bottom sheet navigation pattern.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

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

Before

After

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

Replaces inline region modal with a bottom-sheet RegionSelectorModal, updates BuildQuote to navigate to it and react to region changes, adds routing, and updates tests and deposit modal list rendering.

  • Ramp Aggregator:
    • Replace RegionModal with bottom-sheet RegionSelectorModal (components/RegionSelectorModal/*).
    • BuildQuote: navigate to region selector via createRegionSelectorModalNavigationDetails; remove local region modal state/handlers.
      • Add effects to reset amount on selectedRegion change and to auto-switch fiat currency to region default when applicable.
  • Navigation/Routes:
    • Add Routes.RAMP.MODALS.REGION_SELECTOR and register screen in routes/index.tsx.
  • Deposit:
    • Deposit/RegionSelectorModal: switch to ListItemSelect, simplify styles, and remove extra scrolling flags.
  • Tests/Snapshots:
    • Update BuildQuote.test.tsx to assert navigation to RampRegionSelectorModal instead of directly setting region.
    • Refresh related snapshots to reflect new modal structure.

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

Copy link
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-ramp issues related to Ramp features label Sep 29, 2025
@georgeweiler georgeweiler added QA Passed QA testing has been completed and passed Run Smoke E2E Requires smoke E2E testing no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Sep 29, 2025
@georgeweiler georgeweiler marked this pull request as ready for review September 30, 2025 02:52
@georgeweiler georgeweiler requested a review from a team as a code owner September 30, 2025 02:52
cursor[bot]

This comment was marked as outdated.

queryDefaultFiatCurrency,
selectedPaymentMethodId,
setSelectedFiatCurrencyId,
]);
Copy link

Choose a reason for hiding this comment

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

Bug: Infinite Loop in useEffect Dependencies

The useEffect (lines 229-258) includes selectedFiatCurrencyId in its dependencies and updates it, which can lead to an infinite loop or redundant executions. This also introduces a race condition with queryDefaultFiatCurrency and triggers fiat currency updates on mount or other dependency changes, unlike the previous explicit region selection.

Fix in Cursor Fix in Web

trackEvent('RAMP_REGION_SELECTED', {
country_id: region.id,
location: 'Amount to Buy Screen',
});
Copy link

Choose a reason for hiding this comment

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

Bug: Modal Analytics Location Property Misconfigured

The RegionSelectorModal hard-codes the analytics location property to 'Amount to Buy Screen'. This results in incorrect analytics data when the modal is used in a sell flow, as the location should dynamically reflect whether it's a buy or sell transaction.

Fix in Cursor Fix in Web

@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed QA Passed QA testing has been completed and passed Run Smoke E2E Requires smoke E2E testing size-M team-ramp issues related to Ramp features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants