Skip to content

fix(ramps): fixes 0 ETH ramps issue when order data is not yet available cp-7.71.0#27756

Merged
georgeweiler merged 9 commits into
mainfrom
ramps-empty-order-bugfix
Mar 23, 2026
Merged

fix(ramps): fixes 0 ETH ramps issue when order data is not yet available cp-7.71.0#27756
georgeweiler merged 9 commits into
mainfrom
ramps-empty-order-bugfix

Conversation

@georgeweiler
Copy link
Copy Markdown
Contributor

@georgeweiler georgeweiler commented Mar 20, 2026

Description

"0 ETH" was displayed on some order pages when the order info was not yet available. This bug fixes by adding "..." placeholder until the info arrives.

TRAM-3360

Changelog

CHANGELOG entry: Fixes small UI issue with ramps orders

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

Screenshot 2026-03-20 at 11 51 50 AM Screenshot 2026-03-20 at 11 53 40 AM

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
Adjusts order-details loading/terminal-state logic and amount formatting, which could change what users see for certain pending/failed orders; impact is limited to UI display and snapshots.

Overview
Prevents ramps order UIs from showing 0 ETH/0 amounts when data hasn’t arrived by treating 0/missing cryptoAmount (and related fiat fields) as unknown and rendering an ... placeholder in both the orders list (displayOrder) and order details (OrderContent).

Order details now distinguishes loading vs terminal statuses (e.g., Failed, Cancelled) so terminal orders without amounts render placeholders instead of skeleton loaders, and fiat fees/total formatting is switched to formatWithThreshold currency formatting (snapshot updates included).

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

@georgeweiler georgeweiler requested a review from a team as a code owner March 20, 2026 17:31
@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.

@github-actions github-actions Bot added size-S risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderContent.test.tsx Outdated
@github-actions github-actions Bot added size-M risk-low Low testing needed · Low bug introduction risk and removed size-S risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
Comment thread app/components/UI/Ramp/utils/displayOrder.ts
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@georgeweiler georgeweiler added the team-money-movement issues related to Money Movement features label Mar 20, 2026
@georgeweiler
Copy link
Copy Markdown
Contributor Author

@cursoragent please fix the orderslist test app/components/UI/Ramp/Aggregator/Views/OrdersList/OrdersList.test.tsx

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Mar 20, 2026

Perfect! I've successfully fixed the OrdersList test. Here's what I did:

Summary

Fixed the failing OrdersList test snapshots

The test was failing because the PR changes now display "—" (em dash placeholder) instead of 0 when crypto amounts are missing or zero. This is the correct behavior for the bug fix.

Changes Made:

  • Updated 3 test snapshots in OrdersList.test.tsx.snap to reflect the new placeholder behavior
  • All 10 tests now pass successfully
  • Committed and pushed the changes to ramps-empty-order-bugfix branch

Test Results:

All tests passed:

  • ✓ renders correctly
  • ✓ renders buy only correctly when pressing buy filter
  • ✓ renders sell only correctly when pressing sell filter
  • ✓ renders empty sell message
  • ✓ renders empty buy message
  • ✓ resets filter to all after other filter was set
  • ✓ navigates when pressing item
  • ✓ navigates to ramps order details when pressing RAMPS_V2 order item
  • ✓ navigates to deposit order details when pressing deposit order item
  • ✓ navigates to deposit flow when pressing created deposit order item

The snapshot updates are now live on the PR and align with the bug fix behavior.

Open in Web Open in Cursor 

Co-authored-by: George Weiler <georgejweiler@gmail.com>
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@amitabh94
Copy link
Copy Markdown
Contributor

Can we use ... instead of - ?

Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderContent.tsx
Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderContent.tsx Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderContent.tsx
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 23, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 23, 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: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are entirely contained within the Ramp/fiat on-ramp/off-ramp UI components:

  1. displayOrder.ts: Changed cryptoAmount fallback from 0 to '...' (AMOUNT_PLACEHOLDER) when the value is null, undefined, or zero. This affects how order amounts are displayed in order lists.

  2. OrderContent.tsx:

    • Improved isLoading detection to consider both fiat/crypto amounts AND terminal order statuses (Completed, Failed, Cancelled, IdExpired) - prevents infinite loading state for terminal orders with no amounts
    • Replaced renderFiat with formatWithThreshold for fee and fiat amount display (better currency formatting)
    • Shows placeholder '...' instead of 0 for missing amounts
  3. Test files (3 snapshot/unit test files): Updated to reflect new behavior.

These changes are purely within the Ramp UI layer - no controllers, no Engine, no navigation, no shared components affected. The SmokeRamps tag covers the on-ramp/off-ramp flows including order details display, which is exactly what these changes affect. No other tags are needed as there are no cross-cutting impacts.

Performance Test Selection:
These changes are purely UI/display logic within the Ramp order details component - changing how placeholder amounts are shown and improving loading state detection. There are no performance-sensitive operations, no list rendering changes, no state management changes, and no data fetching changes that would impact app performance metrics.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

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

@georgeweiler georgeweiler changed the title fix(ramps): fixes 0 ETH ramps issue when order data is not yet available fix(ramps): fixes 0 ETH ramps issue when order data is not yet available cp-7.71.0 Mar 23, 2026
@sonarqubecloud
Copy link
Copy Markdown

@georgeweiler georgeweiler added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit 174afa0 Mar 23, 2026
100 checks passed
@georgeweiler georgeweiler deleted the ramps-empty-order-bugfix branch March 23, 2026 14:54
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 23, 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-low Low testing needed · Low 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.

6 participants