Commit 1fae307
authored
feat: cancel limit order (#41484)
## **Description**
Cancel limit order flow was missing from market detail screen.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Add cancel order flow from market detail entrypoint
## **Related issues**
Fixes:
## **Manual testing steps**
1. Go to this page...
2.
3.
## **Screenshots/Recordings**
https://github.com/user-attachments/assets/38f52452-b357-416a-a015-afeeaadd94fd
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds a new perps order-cancellation flow that triggers a background
`perpsCancelOrder` request and new toast states; mistakes here could
prevent cancellations or show incorrect feedback. Scope is UI-focused
with tests, but it touches user trading actions and navigation paths.
>
> **Overview**
> Adds a **Cancel Order** flow in perps market detail: clicking an order
card now opens a new `CancelOrderModal` that shows key order details and
submits `perpsCancelOrder`, with loading/error handling and
success/failure perps toasts.
>
> Updates perps activity so clicking *order* transactions navigates to
the relevant market detail page.
>
> Introduces new i18n strings (`Cancel order`, order detail labels,
`Reduce only`, `No`) and extends perps toast key/presentation mappings;
adds/updates Jest baselines and tests for the new modal and navigation
behavior.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9e33444. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent ce83d28 commit 1fae307
12 files changed
Lines changed: 1080 additions & 8 deletions
File tree
- app/_locales
- en_GB
- en
- test/jest
- ui
- components/app/perps
- cancel-order
- perps-toast
- pages/perps
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
1490 | 1493 | | |
1491 | 1494 | | |
1492 | 1495 | | |
1493 | | - | |
| 1496 | + | |
| 1497 | + | |
1494 | 1498 | | |
1495 | 1499 | | |
1496 | 1500 | | |
| |||
0 commit comments