Skip to content

fix(ramps): filter activity tab's transfer details for selected account -> cp-7.71.0#27830

Merged
imyugioh merged 2 commits into
mainfrom
fix/ramps-3361-filter-orders-in-activity
Mar 24, 2026
Merged

fix(ramps): filter activity tab's transfer details for selected account -> cp-7.71.0#27830
imyugioh merged 2 commits into
mainfrom
fix/ramps-3361-filter-orders-in-activity

Conversation

@imyugioh

@imyugioh imyugioh commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Description

Activity — on-ramp orders scoped to the selected account

The Activity Orders tab merges legacy fiat orders with V2 RampsController orders. Legacy rows were already limited to the selected account group via getOrders. V2 orders were not filtered, so purchase history from other wallets could appear.

This change adds selectRampsOrdersForSelectedAccountGroup, which keeps only orders whose walletAddress matches any formatted address in the selected account group (same semantics as legacy, using areAddressesEqual for EVM vs non-EVM). Hook and modal consumers that should reflect “current wallet context” now use this selector instead of the raw controller list.

Transak — preserve user-entered fiat amount on Build Quote (in-app)

After additional verification, opening the KYC/payment webview called navigateToKycWebview with quote.fiatAmount, and the stack reset rewrote RampAmountInput params with that value. The quote total can differ from what the user typed (e.g. fees), so Build Quote could show 27.37 after the user entered 25, and that value persisted after closing the sheet or going back.

Change: routeAfterAuthentication(..., amount) already carried the typed fiat; navigateToAdditionalVerificationCallback now puts the same amount on both RampAmountInput and RampAdditionalVerification route params. V2 Additional Verification reads that param and passes only it into navigateToKycWebview (no quote.fiatAmount for this purpose).

Out of scope: Order detail screens and stored order payloads are unchanged. The Transak payment webview URL is unchanged (no fiatAmount override in widget params); only in-app Build Quote / stack state matches the user’s input.

Changelog

CHANGELOG entry: Fixed Activity on-ramp (Orders) list showing V2 purchases from wallets other than the selected account group; fixed Transak unified buy flow so the fiat amount on Build Quote after additional verification matches the user-entered amount on the amount screen (in-app stack), without changing Transak’s payment widget totals.

Tests

  • selectRampsOrdersForSelectedAccountGroup and ramp hook consumers (selector + hook unit tests).
  • useTransakRouting: IDPROOF / additional verification navigation with user amount set and omitted.
  • V2 AdditionalVerification: continue passes route amount into navigateToKycWebview.

Related issues

Refs: TRAM-3361

Manual testing steps

Feature: Activity on-ramp orders and Transak amount (TRAM-3361)

  Scenario: Orders tab shows only selected account group’s V2 on-ramp orders
    Given the user has two wallets (or account groups) with separate on-ramp purchase history
    And unified ramps V2 orders exist for more than one wallet address

    When the user selects account group A and opens Activity → Orders
    Then only on-ramp orders whose destination wallet belongs to account group A are listed

    When the user switches to account group B
    Then the Orders tab lists only orders for account group B

  Scenario: Custom fiat amount survives Transak additional verification on Build Quote
    Given the user is in unified Buy with Transak (native) as provider
    And the user enters a custom fiat amount (e.g. 25) on the amount screen

    When the user continues through flows that require additional verification
    And the user taps Continue on the additional verification screen
    Then Build Quote under the KYC/payment sheet still shows the entered amount (e.g. 25), not only the quote total

    When the user closes the webview or goes back from the flow
    Then the amount screen still shows the same entered amount (e.g. 25)

Screenshots/Recordings

Before

ScreenRecording_03-18-2026.21-26-36_1.MP4

After

Recording.2026-03-23.200201.mp4
Recording.2026-03-23.200613.mp4

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

Medium Risk
Moderate UX/data-scoping change: filters which on-ramp orders appear based on multichain account selection and adjusts Transak navigation params, which could hide expected history or affect flow state if account/address resolution is off.

Overview
Fixes unified ramp UI to scope V2 RampsController orders to the selected account group, preventing purchases from other wallets from showing up in Activity-derived surfaces. This introduces selectRampsOrdersForSelectedAccountGroup (address-matched via areAddressesEqual) and switches key consumers (useRampsOrders, useRampsProviders, useRampsButtonClickData, ProviderSelectionModal) from the unfiltered selector.

Updates the Transak additional-verification flow to preserve the user-entered fiat amount through stack resets: useTransakRouting now carries amount into RampAdditionalVerification params, and AdditionalVerification uses that param (not quote.fiatAmount) when opening the KYC webview. Selector and routing behavior are covered with expanded unit tests.

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

@imyugioh imyugioh self-assigned this Mar 23, 2026
@imyugioh imyugioh added the team-money-movement issues related to Money Movement features label Mar 23, 2026
@github-actions

Copy link
Copy Markdown
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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.47%. Comparing base (c56e9d0) to head (fdb1a5d).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
app/components/UI/Ramp/hooks/useTransakRouting.ts 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27830      +/-   ##
==========================================
+ Coverage   82.46%   82.47%   +0.01%     
==========================================
  Files        4801     4803       +2     
  Lines      123807   123916     +109     
  Branches    27602    27621      +19     
==========================================
+ Hits       102101   102205     +104     
- Misses      14634    14635       +1     
- Partials     7072     7076       +4     

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

@imyugioh imyugioh force-pushed the fix/ramps-3361-filter-orders-in-activity branch from fdb1a5d to 4d78cb8 Compare March 24, 2026 01:38
@imyugioh imyugioh marked this pull request as ready for review March 24, 2026 01:41
@imyugioh imyugioh requested a review from a team as a code owner March 24, 2026 01:41
@imyugioh imyugioh force-pushed the fix/ramps-3361-filter-orders-in-activity branch from 4d78cb8 to 39d5861 Compare March 24, 2026 01:42
@imyugioh imyugioh changed the title fix: filter activity for selected accounts fix(ramps): filter activity tab's transfer details for selected account -> cp-7.71.0 Mar 24, 2026
@github-actions github-actions Bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 11 changed files are exclusively within the Ramps feature domain:

  1. Selector scoping (selectRampsOrdersForSelectedAccountGroup): A new selector filters ramp orders by the currently selected account group's wallet addresses. This is a behavioral change - previously all orders were shown regardless of which account group was active; now only orders belonging to the active account group are shown. This affects order history display, provider selection preference logic, and routing decisions.

  2. Hook updates (useRampsOrders, useRampsProviders, useRampsButtonClickData): All three hooks now use the scoped selector, meaning the ramp UI will only show orders relevant to the current account group. This is a correctness fix for multi-SRP/multi-account scenarios.

  3. ProviderSelectionModal: Uses the scoped selector for determining preferred providers based on past orders.

  4. AdditionalVerification + useTransakRouting: Bug fix where the user-entered fiat amount is now correctly passed through the navigation stack to the KYC webview, instead of using quote.fiatAmount which could differ from what the user typed.

  5. Test files: Unit tests updated to cover the new behavior.

Tag selection rationale:

  • SmokeRamps is the direct and primary tag - all changes are within the buy/sell fiat on-ramp/off-ramp feature. The changes affect order filtering, provider selection, and the Transak KYC flow.
  • No other tags are needed: changes don't touch confirmations, wallet platform, accounts, networks, or any shared components.

Performance tests: No performance impact expected - the new selector uses createDeepEqualSelector (memoized), and the changes are scoped to ramp order filtering logic with no UI rendering performance implications.

Performance Test Selection:
No performance impact expected. The changes are scoped to ramp order filtering logic using a memoized selector (createDeepEqualSelector). No UI rendering changes, no list rendering changes, no app startup or initialization changes, and no critical user flow performance paths are affected.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

@imyugioh imyugioh added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit 4661cdb Mar 24, 2026
99 of 102 checks passed
@imyugioh imyugioh deleted the fix/ramps-3361-filter-orders-in-activity branch March 24, 2026 13:13
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants