feat: add lightweight v2 toast notifications for Ramps orders#26670
Conversation
Replace the old NotificationManager-based notifications with modern Toast-based notifications for Ramps orders when the unifiedBuyV2 feature flag is enabled. The new toasts use simple parameters (orderId, cryptocurrency, cryptoAmount, state) instead of the full FiatOrder object, making them lightweight and decoupled from legacy code. Covers all order states (pending, completed, failed, cancelled) with appropriate icons and colors. The pending toast includes a Track button to navigate to order details. Falls back to old notifications when the feature flag is off.
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| IconSize as ReactNativeDsIconSize, | ||
| } from '@metamask/design-system-react-native'; | ||
| import { Spinner } from '@metamask/design-system-react-native/dist/components/temp-components/Spinner/index.cjs'; | ||
| import { lightTheme } from '@metamask/design-tokens'; |
There was a problem hiding this comment.
Hardcoded light theme colors ignore dark mode
Medium Severity
v2OrderToast.ts imports lightTheme from @metamask/design-tokens and uses lightTheme.colors.success.default, lightTheme.colors.error.default, and lightTheme.colors.warning.default for icon colors. These are hardcoded to the light palette and won't adapt when the app is in dark mode, potentially resulting in poor contrast or invisible icons against a dark background.
index.tsx and useHandleNewOrder used selectRampsUnifiedBuyV2ActiveFlag directly, skipping the build flag override and minimum version gate that Checkout already applied via useRampsUnifiedV2Enabled. Added isRampsUnifiedV2Enabled utility for non-hook contexts (thunks) and updated useHandleNewOrder to use the hook directly since it is already a hook itself.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokeRamps is the appropriate tag as it covers:
No other tags are needed because:
Performance Test Selection: |


Description
Introduces new lightweight toast notifications for Ramps orders behind the
unifiedBuyV2feature flag. When enabled, orders display modern Toast-based notifications instead of the legacyNotificationManager.showSimpleNotificationapproach.The new toasts accept simple parameters (
orderId,cryptocurrency,cryptoAmount,state) rather than the fullFiatOrderobject, keeping them decoupled from legacy aggregator/deposit code. This makes them easy to maintain and eventually replace the old notifications entirely.What changed:
v2OrderToast.tsutility withbuildV2OrderToastOptionsandshowV2OrderToastfunctionsAvatarSize.Lgwith transparent backgrounds and semantic colors from design tokensselectRampsUnifiedBuyV2ActiveFlag/useRampsUnifiedV2Enabled- falls back to old notifications when flag is offprocessFiatOrder,processCustomOrderId(inindex.tsx),handleOrderCreated(inCheckout.tsx), anduseHandleNewOrder(Deposit flow)ramps_v2.notificationsChangelog
CHANGELOG entry: Added new toast-style notifications for buy order status updates (processing, completed, failed, cancelled) behind the Unified Buy V2 feature flag
Related issues
Refs: Unified Buy V2
Manual testing steps
Screenshots/Recordings
Before
Legacy
NotificationManager.showSimpleNotificationbannersAfter
New Toast notifications with semantic icon colors, and Track navigation button
Aggregator:
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-02-26.at.20.50.38.mov
Native:
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-02-26.at.20.48.36.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes user-facing order status notifications in multiple Ramps entry points (checkout, deposit, polling) and adds navigation from a toast action; regressions could affect notification delivery/timing, though behavior is gated and falls back to legacy notifications when disabled.
Overview
Adds new
v2OrderToastutility to show Toast-based Ramps V2 order status notifications (pending/completed/failed/cancelled), including a pending-state Track action that navigates toRoutes.RAMP.RAMPS_ORDER_DETAILS.Updates the main order-notification emitters (
Checkout.handleOrderCreated, deposituseHandleNewOrder, andprocessFiatOrder/processCustomOrderIdinRamp/index.tsx) to conditionally use the new toasts when Unified Buy V2 is enabled, otherwise keeping the existingNotificationManager.showSimpleNotificationbehavior (some calls deferred withInteractionManager.runAfterInteractions).Introduces a non-hook
isRampsUnifiedV2Enabled(state)helper (with tests) for thunk/plain-function contexts, extends test Babel config to avoid inlining the related env var, and adds newen.jsonstrings underramps_v2.notifications.Written by Cursor Bugbot for commit 7d84e5f. This will update automatically on new commits. Configure here.