Skip to content

Conversation

matallui
Copy link
Contributor

@matallui matallui commented Oct 18, 2025

Description

Fixes for toasts during order placement.

Changelog

CHANGELOG entry: null

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

Screen.Recording.2025-10-17.at.9.17.48.PM.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

Adds loading/success toasts and new i18n keys for Predict orders, delays cash-out success, updates price formatting, and simplifies navigation by letting dispatch errors surface; tests updated.

  • Predict Order Hook (usePredictPlaceOrder):
    • Adds loading toasts for BUY/SELL; shows success "prediction placed" or delayed "cashed out" toasts (2s) with new i18n keys under predict.order.
    • Uses strings('predict.order.*') and formatPrice(..., { maximumDecimals: 2 }); failure toast uses order_failed key.
  • Views:
    • PredictBuyPreview: call placeOrder then immediately dispatch(StackActions.pop()); remove try/catch; onPlaceBet no longer async.
    • PredictSellPreview: same dispatch-after-placeOrder change; remove Alert usage; switch price formatting to { maximumDecimals: 2 }.
  • i18n (locales/languages/en.json):
    • Adds predict.order namespace: placing_prediction, prediction_placed, cashing_out, cashing_out_subtitle, cashed_out, cashed_out_subtitle, order_failed.
  • Tests:
    • Update to expect loading + success/failure toast sequences and delayed cash-out success.
    • Adjust navigation tests to expect thrown dispatch errors while still calling placeOrder.
    • Update formatting expectations to maximumDecimals: 2.

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

@matallui matallui requested review from caieu and kevinbluer October 18, 2025 03:08
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-predict Predict team label Oct 18, 2025
@matallui matallui marked this pull request as ready for review October 18, 2025 03:26
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@matallui matallui force-pushed the predict/fix-order-toasts branch from 94fad4e to c141634 Compare October 18, 2025 03:49
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.11%. Comparing base (944a916) to head (c141634).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21395      +/-   ##
==========================================
- Coverage   77.12%   77.11%   -0.01%     
==========================================
  Files        3615     3615              
  Lines       89144    89142       -2     
  Branches    16861    16861              
==========================================
- Hits        68748    68746       -2     
+ Misses      15719    15717       -2     
- Partials     4677     4679       +2     

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

Copy link

@matallui matallui enabled auto-merge October 18, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants