Skip to content

feat(perps): show persistent "Submitting your trade" toast during order placement#26432

Merged
michalconsensys merged 6 commits intomainfrom
feat/perps/tast-persistant
Feb 26, 2026
Merged

feat(perps): show persistent "Submitting your trade" toast during order placement#26432
michalconsensys merged 6 commits intomainfrom
feat/perps/tast-persistant

Conversation

@michalconsensys
Copy link
Contributor

@michalconsensys michalconsensys commented Feb 23, 2026

Description

  1. What is the reason for the change?
    During Perps order placement, users only saw an "Order submitted" toast after the order was sent. There was no feedback while the order was in flight, which could make it unclear that the app was still working.

  2. What is the improvement/solution?

    • Show a persistent "Submitting your trade" toast as soon as the user confirms the order. It stays visible until the order completes (success or failure).
    • Remove the separate "Order submitted" toast; success/error is still communicated by the existing confirmed/creationFailed toasts.
    • The new toast has hasNoTimeout, a loading icon, and a close button so users can dismiss it manually if they want.
    • Implemented via a new orderManagement.shared.submitting() option in usePerpsToasts, used in PerpsOrderView before calling the order execution hook.

Changelog

CHANGELOG entry: Added a persistent "Submitting your trade" toast during Perps order placement so users see clear feedback while the order is processing.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2570

Manual testing steps

Feature: Perps order placement toast

  Scenario: user sees persistent "Submitting your trade" toast while order is in flight
    Given the user is on the Perps order view and has valid order inputs

    When the user taps to place the order (market or limit)

    Then a "Submitting your trade" toast appears immediately with a loading icon and close button
    And the toast remains visible until the order completes (no auto-dismiss)
    And the user can dismiss it manually via the close button
    And on success, the existing "Order filled" / "Order placed" toast is shown; on failure, the error toast is shown

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-02-23.at.16.15.32.mov

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

Low Risk
Primarily UI/UX toast behavior changes around order submission with corresponding test and i18n updates; no changes to order execution semantics beyond when toasts are shown.

Overview
Perps order placement now shows a persistent Submitting your trade toast immediately when the user places an order, providing in-flight feedback until the order resolves.

This removes the prior onSubmitted-triggered Order submitted toast from usePerpsOrderExecution usage, and introduces a new PerpsToastOptions.orderManagement.shared.submitting() toast option (no timeout, loading icon, manual dismiss via close button). Tests and English locale strings were updated accordingly.

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

michalconsensys and others added 2 commits February 23, 2026 14:41
- Show 'Submitting your trade' toast during order placement (replaces Order submitted toast)
- Toast persists until completion or user dismiss via close button or swipe left/right
- Add swipe-to-dismiss for hasNoTimeout toasts in Toast component
- Add orderManagement.shared.submitting() in usePerpsToasts with hasNoTimeout and close button
- Remove onSubmitted toast from PerpsOrderView; success/error toasts replace submitting toast
- Add locale perps.order.submitting_your_trade and unit tests

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
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.

@metamaskbot metamaskbot added the team-perps Perps team label Feb 23, 2026
@michalconsensys michalconsensys marked this pull request as ready for review February 24, 2026 08:40
@michalconsensys michalconsensys requested a review from a team as a code owner February 24, 2026 08:40
michalconsensys and others added 2 commits February 24, 2026 10:39
…toast close handler

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link

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

expect(mockShowToast).toHaveBeenCalled();
});
// We show "Submitting your trade" (from shared.submitting), not "Order submitted"
expect(mockSubmitted).not.toHaveBeenCalled();
Copy link

Choose a reason for hiding this comment

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

Test doesn't verify submitting toast is shown

Low Severity

The test "does not show order submitted toast; submitting your trade toast is shown instead" only verifies that mockShowToast was called and that mockSubmitted was not called. It doesn't verify that shared.submitting was called or that mockShowToast received the correct toast configuration. Other tests in this file use toHaveBeenCalledWith to verify the exact toast shown. The test should verify shared.submitting was invoked to ensure the correct toast is displayed.

Fix in Cursor Fix in Web

Triggered by project rule: MetaMask Mobile E2E Testing Guidelines

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes modify the Perps order submission UX flow by replacing the "Order submitted" toast (shown after submission) with a persistent "Submitting your trade" toast (shown before/during submission). The changes are contained to:

  1. PerpsOrderView.tsx - Removed onSubmitted callback, added new submitting toast before order execution
  2. usePerpsToasts.tsx - Added new submitting() toast configuration with hasNoTimeout and close button
  3. en.json - Added new translation string
  4. Test files - Updated to reflect new behavior

SmokePerps is required as this directly affects perpetuals trading order flows. Per the tag description, SmokeWalletPlatform must be selected because Perps is a section inside the Trending tab. SmokeConfirmations is also required because PerpsOrderView is used in the confirmations flow for perpsDepositAndOrder transactions, and the tag description states to select it when selecting SmokePerps for on-chain transactions.

The changes are well-tested with updated unit tests and are purely UI feedback changes (toast notifications), not core transaction logic changes.

Performance Test Selection:
The changes are purely about toast notification timing and UX feedback during order submission. No changes to rendering performance, data loading, state management, or app startup. The toast changes don't affect the actual order execution performance or any metrics that would be measured by performance tests.

View GitHub Actions results

@michalconsensys michalconsensys added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit c0f9dc6 Feb 26, 2026
97 checks passed
@michalconsensys michalconsensys deleted the feat/perps/tast-persistant branch February 26, 2026 14:42
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2026
@metamaskbot metamaskbot added the release-7.68.0 Issue or pull request that will be included in release 7.68.0 label Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.68.0 Issue or pull request that will be included in release 7.68.0 size-S team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants