feat: update provider selection modal ui#26726
Conversation
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes are isolated to the Ramps feature and don't affect:
The SmokeRamps tag is the appropriate and only necessary tag since:
Risk is medium because while the changes are UI-focused and well-tested with unit tests, they modify the provider selection flow which is a critical part of the buy/sell crypto user journey. Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| showBackButton={hasPaymentModalInStack} | ||
| ordersProviders={ordersProviders.filter( | ||
| (id): id is string => id != null, | ||
| )} |
There was a problem hiding this comment.
Inline .filter() defeats useCallback memoization on every render
Low Severity
The ordersProviders.filter(...) call is inline in JSX, creating a new array reference on every render. This new reference is passed as the ordersProviders prop to ProviderSelection, where it's listed as a dependency of the renderItem useCallback. Since the reference changes every render, renderItem is recreated every render, causing FlatList to re-render all items unnecessarily and defeating the memoization. Wrapping the filter in useMemo keyed on ordersProviders would preserve referential stability.
Additional Locations (1)
| }); | ||
|
|
||
| it('renders providers immediately when quotes are loading', () => { | ||
| it('renders skeleton loading state when quotes are loading', () => { |
There was a problem hiding this comment.
Thanks for this change! 🙏
| "quote_unavailable": "Quote unavailable.", | ||
| "providers": "Providers", | ||
| "quotes_displayed_for": "Quotes displayed for {{paymentMethodName}}.", | ||
| "other_options": "Other options", |
There was a problem hiding this comment.
In what cases will we see other options ?



Description
Updates the Provider Selection modal UI with improved quote-driven sorting, provider tags, skeleton loading states, and a redesigned payment method banner.
Payment Method Banner
Quote-Based Provider Sorting
QuoteSortOrderreliability ranking (viaquotes.sorted), placing the most reliable provider at the top.Skeleton Loading State
Provider Tags
metadata.tags(isMostReliable,isBestRate) from the API response, andgetOrdersProvidersfrom Redux to identify previously used providers from completed order history.Conditional Back Button
Changed Files
ProviderSelection.tsx— Banner, skeleton, sorting, tags, conditional back buttonProviderSelectionModal.tsx— PassesordersProvidersfrom Redux,showBackButtonfrom navigation stateProviderSelection.test.tsx— Updated test for skeleton loading behavioren.json— Added i18n strings:other_options,previously_used,best_rate,most_reliableChangelog
CHANGELOG entry: Updates ramp provider selection modal UI
Related issues
Fixes:
https://consensyssoftware.atlassian.net/browse/TRAM-3307
https://consensyssoftware.atlassian.net/browse/TRAM-3187
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes provider ordering/visibility and quote presentation logic in the provider selection flow (sorting, skeleton states, tags, and back-button behavior), which could affect user selection and navigation in edge cases. No security- or data-sensitive logic is introduced.
Overview
Updates
ProviderSelectionto be quote-driven: providers with successful quotes are sorted by the API reliability order and shown above an “Other options” separator, while providers without quotes are pushed below and alphabetized.Replaces the prior “show providers while loading” behavior with a dedicated skeleton list, updates the payment-method header to a banner with an icon, and adds per-provider tags (Previously used, Most reliable, Best rate) derived from order history and quote metadata.
ProviderSelectionModalnow conditionally shows the back button only when the payment selection modal exists in the navigation stack and passesordersProvidersfrom Redux; tests/snapshots and i18n strings were updated accordingly.Written by Cursor Bugbot for commit 790f8c3. This will update automatically on new commits. Configure here.