feat: QuickBuy stay-on-screen swap lifecycle toasts#31073
Conversation
Pressing Buy now closes the QuickBuy sheet immediately (no horizontal slide on exit) and submits in the background. Swap lifecycle toasts (pending / complete / failed) fire globally via the app-root ControllerEventToastBridge, so they surface even after the user navigates away from the trigger screen — important for slow cross-chain swaps. Terminal state is driven by BridgeStatusController status. Toasts follow the Swap design: action title line plus the exchange-rate quote as a description, with mode-aware copy (buy/sell). Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
| * App-root registration that surfaces QuickBuy swap outcomes as toasts. | ||
| * | ||
| * Mounted via `ControllerEventToastBridge` in `App.tsx`, so it outlives the | ||
| * QuickBuy bottom sheet and the trigger screen — the `complete` / `failed` |
There was a problem hiding this comment.
That's very important! We want to show the toasts even when the QuickBuy component is unmounted (user has navigated somewhere else in the app)
This update introduces haptic feedback for QuickBuy interactions, enhancing user experience during trade confirmations. The `playImpact` function is triggered on pending trades, while `playSuccessNotification` and `playErrorNotification` are invoked based on the outcome of the transactions. Tests have been added to ensure the correct haptic responses are executed during various QuickBuy states. Co-authored-by: Cursor <cursoragent@cursor.com>
This update introduces an `immediateFetchToken` mechanism in the QuickBuy component, allowing for immediate quote fetching when the user commits an amount via slider release, bypassing the typing debounce. The changes include new tests to ensure that quotes are fetched correctly under various scenarios, such as when the immediate fetch token increments or remains unchanged. This enhancement improves the responsiveness of the QuickBuy feature during user interactions. Co-authored-by: Cursor <cursoragent@cursor.com>
This update modifies the QuickBuy toast options to include a transparent background color for both success and error toast notifications. This change enhances the visual consistency of the toast messages within the QuickBuy component, ensuring they blend seamlessly with the app's UI. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Reviewed by Cursor Bugbot for commit 9e39c20. Configure here.
…ations This update introduces the `resolveQuickBuyTerminalToast` function, which reconciles tracked QuickBuy trades against the BridgeStatusController's history. It displays appropriate toast notifications for completed or failed trades, providing haptic feedback and ensuring trades are untracked after notification. Additionally, tests have been added to verify the functionality across various trade states, enhancing user experience during QuickBuy interactions. Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are well-contained within the QuickBuy feature with the exception of the App.tsx toast registration change, which has broader potential impact on the global toast system. Performance Test Selection: |

Description
Screen.Recording.2026-06-04.at.14.34.49.mov
Previously, submitting a QuickBuy transaction redirected the user to the Activity view. This change keeps the user on the screen where QuickBuy was triggered (e.g. token details) so they get feedback in context and can watch their balance update.
What changed:
isClosinggates the screen-exit transition).BridgeStatusController.submitTxresolves when the source tx is submitted, not when the swap settles — for cross-chain bridges the destination leg can take minutes. So toasts reflect the real lifecycle, driven byBridgeStatusControllerstatus, not submit success.NotificationManageronly watches redesigned tx types, which exclude swap/bridge). The terminalcomplete/failedtoast is fired from the app-rootControllerEventToastBridgevia a newuseQuickBuyToastRegistrationshook, so it shows even after the user navigates away. A small in-memoryquickBuyTradeTrackerscopes the handler to QuickBuy-initiated trades and carries the copy data (token pair, amount, rate).Architecture note: everything stays within
**/SocialLeaderboard/**(social-ai) by importing existing controllers/selectors, except a ~5-line wiring change inApp.tsx/App.test.tsx(mobile-platform CODEOWNERS), matching the existing Predict/Perps toast-registration precedent.Changelog
CHANGELOG entry: QuickBuy now stays on the current screen after you tap Buy and shows pending, complete, and failed swap toasts (including for slow cross-chain swaps).
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Made with Cursor
Note
Medium Risk
Changes bridge submit UX, global toast wiring in App.tsx, and swap status handling; mistakes could miss terminal toasts or double-fire notifications, but scope is limited to QuickBuy-tracked trades with tests.
Overview
QuickBuy no longer navigates to Activity after submit. Tapping Buy closes the sheet immediately, shows a pending toast on the current screen, and runs
BridgeStatusController.submitTxin the background.Swap lifecycle toasts use a shared builder (
buildQuickBuyToastOptions) plus an in-memoryquickBuyTradeTrackerkeyed by tx meta id. Complete / failed outcomes are driven byBridgeStatusControllerstatus viaresolveQuickBuyTerminalToast, wired at app root throughuseQuickBuyToastRegistrationsonControllerEventToastBridgeso toasts still appear after navigation or sheet unmount. Submit failures before publish show failed immediately; fast settlements are reconciled right after tracking.UX polish:
QuickBuyRootusesrequestClose/isClosingto animate the sheet down and skip horizontal screen-exit animation. Slider commits bumpimmediateFetchTokenso quotes fetch without the typing debounce. New i18n strings for buy/sell toast copy.Tests cover close behavior, toast registration, tracker, terminal resolve, controller confirm flow, and immediate quote fetch.
Reviewed by Cursor Bugbot for commit 92e358a. Bugbot is set up for automated code reviews on this repo. Configure here.