fix: reconcile open-limit Cancel with LCD OrderStatus (#530) #1059

Merged
PlasticDigits merged 2 commits from feat/530-limit-cancel-open into main 2026-08-16 08:49:55 +00:00
PlasticDigits commented 2026-08-16 07:31:13 +00:00 (Migrated from gitlab.com)

Summary

  • Reconcile My open limits with LCD OrderStatus plus indexer fills/cancels before offering Cancel, so a stale green ● row (report class order #1 · Sell UST1 · 82.044…) cannot show a mute or griefing Cancel.
  • Disabled Cancel now states why (paused / restricted / filled / already cancelled / no longer on the book). LCD ParkedRefund on an indexer-active row shows Claim refund.
  • Move /trade compact panel above sticky Place limit so Cancel is not a child of trade-limit-submit-sticky.

Closes #530

Triage (AC1)

Mainnet pair/tx for order #1 · Sell UST1 · 82.044004487226 · placed 2026-08-15T14:21:43 was not recovered (no hash in the report). Shipped fixture matches that UI string.

Signal Report-class fixture
Indexer lifecycle_status active (fills never flip this — F530-8)
LCD OrderStatus Unknown
Indexer fill present
Indexer cancel absent
Classification Filled — Cancel disabled, no ●

Most likely live class: full hybrid fill left ORDERS without a cancel/park event. Contributing UX hole: compact Cancel sat after sticky Place limit and could be covered while the ● line was still readable.

Acceptance criteria

  • AC1 — Report class classified via fixture (Sell UST1 / 82.044… / 2026-08-15T14:21:43) as LCD Unknown + fill → Filled.
  • AC2 — Cancel still broadcasts cancel_limit_order when LCD Active (unit + existing /limits panel path). Mutation happy path unchanged.
  • AC3 — Filled / already cancelled / Unknown without ORDERS: no enabled Cancel; status copy is explicit.
  • AC4 — ParkedRefund / parked_expired → Claim, not Cancel. Pause/blacklist copy unchanged (L6).
  • AC5 — Disabled reasons: paused, restricted, already cancelled, filled, gone.
  • AC6 — Compact panel is a sibling above sticky; DOM test asserts Cancel is not under trade-limit-submit.
  • AC7 — Cancel payload is { cancel_limit_order: { order_id } } only (invert-safe).
  • AC8 — docs/limit-orders.md F530-1–F530-8, frontend.md, playbooks, make verify-issue-530.

Not in this MR

  • Indexer filled lifecycle write (process_limit_order_fill still insert-only). Default-open can still list filled-as-active until LCD + fills reclassify (F530-8). Optional follow-up.
  • Full Playwright P1–P7 / A6 elementFromPoint on a live /trade ticket (worktree has no .env.local; existing limit-orders-tx.spec.ts /limits cancel remains the chain path).
  • #527 ticket-footer dock (out of scope). This MR only moves My open limits above the existing sticky chrome.
  • Recovering the live columbus-5 order_id=1 pair/tx.

Test plan

  • make verify-issue-530 (run + retest, 9/9)
  • Scoped Vitest: reconcile, panel, cancel mutation, queryOrderStatus, TradePage AC6
  • Manual: /trade 1280×720 — one open row, elementFromPoint on Cancel ≠ Place limit
  • Manual / e2e-tx: place then cancel on /limits and /trade when LocalTerra + .env.local are wired
  • If the UST1 row is still on mainnet: LCD OrderStatus + indexer fills/cancels, then confirm UI matches the table above
## Summary - Reconcile **My open limits** with LCD `OrderStatus` plus indexer fills/cancels before offering **Cancel**, so a stale green `●` row (report class `order #1 · Sell UST1 · 82.044…`) cannot show a mute or griefing Cancel. - Disabled Cancel now states **why** (paused / restricted / filled / already cancelled / no longer on the book). LCD `ParkedRefund` on an indexer-active row shows **Claim refund**. - Move `/trade` compact panel **above** sticky Place limit so Cancel is not a child of `trade-limit-submit-sticky`. Closes #530 ## Triage (AC1) Mainnet pair/tx for `order #1 · Sell UST1 · 82.044004487226 · placed 2026-08-15T14:21:43` was not recovered (no hash in the report). Shipped fixture matches that UI string. | Signal | Report-class fixture | |--------|----------------------| | Indexer `lifecycle_status` | `active` (fills never flip this — **F530-8**) | | LCD `OrderStatus` | `Unknown` | | Indexer fill | present | | Indexer cancel | absent | | Classification | **Filled** — Cancel disabled, no `●` | Most likely live class: **full hybrid fill** left `ORDERS` without a cancel/park event. Contributing UX hole: compact Cancel sat **after** sticky Place limit and could be covered while the `●` line was still readable. ## Acceptance criteria - [x] **AC1** — Report class classified via fixture (`Sell UST1` / `82.044…` / `2026-08-15T14:21:43`) as LCD `Unknown` + fill → Filled. - [x] **AC2** — Cancel still broadcasts `cancel_limit_order` when LCD `Active` (unit + existing `/limits` panel path). Mutation happy path unchanged. - [x] **AC3** — Filled / already cancelled / `Unknown` without `ORDERS`: no enabled Cancel; status copy is explicit. - [x] **AC4** — `ParkedRefund` / `parked_expired` → Claim, not Cancel. Pause/blacklist copy unchanged (**L6**). - [x] **AC5** — Disabled reasons: paused, restricted, already cancelled, filled, gone. - [x] **AC6** — Compact panel is a sibling **above** sticky; DOM test asserts Cancel is not under `trade-limit-submit`. - [x] **AC7** — Cancel payload is `{ cancel_limit_order: { order_id } }` only (invert-safe). - [x] **AC8** — `docs/limit-orders.md` **F530-1–F530-8**, frontend.md, playbooks, `make verify-issue-530`. ## Not in this MR - Indexer `filled` lifecycle write (`process_limit_order_fill` still insert-only). Default-open can still list filled-as-`active` until LCD + fills reclassify (**F530-8**). Optional follow-up. - Full Playwright P1–P7 / A6 `elementFromPoint` on a live `/trade` ticket (worktree has no `.env.local`; existing `limit-orders-tx.spec.ts` `/limits` cancel remains the chain path). - **#527** ticket-footer dock (out of scope). This MR only moves My open limits above the existing sticky chrome. - Recovering the live columbus-5 `order_id=1` pair/tx. ## Test plan - [x] `make verify-issue-530` (run + retest, 9/9) - [x] Scoped Vitest: reconcile, panel, cancel mutation, `queryOrderStatus`, TradePage AC6 - [ ] Manual: `/trade` 1280×720 — one open row, `elementFromPoint` on Cancel ≠ Place limit - [ ] Manual / e2e-tx: place then cancel on `/limits` and `/trade` when LocalTerra + `.env.local` are wired - [ ] If the UST1 row is still on mainnet: LCD `OrderStatus` + indexer fills/cancels, then confirm UI matches the table above
PlasticDigits commented 2026-08-16 08:44:24 +00:00 (Migrated from gitlab.com)

mentioned in issue #530

mentioned in issue #530
PlasticDigits commented 2026-08-16 08:49:52 +00:00 (Migrated from gitlab.com)

added 12 commits

  • 5aecf1ba...438e7bc0 - 11 commits from branch main
  • 9fd8b4ea - merge: keep open-limit Cancel above the ticket footer

Compare with previous version

added 12 commits <ul><li>5aecf1ba...438e7bc0 - 11 commits from branch <code>main</code></li><li>9fd8b4ea - merge: keep open-limit Cancel above the ticket footer</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/341/diffs?diff_id=1964223167&start_sha=5aecf1ba7dae5ce09cc5f1840a967d16d818d347)
PlasticDigits commented 2026-08-16 08:49:56 +00:00 (Migrated from gitlab.com)

mentioned in commit 367b772e7b

mentioned in commit 367b772e7b8caedfc53fa2488af3b636da39e408
PlasticDigits (Migrated from gitlab.com) merged commit 367b772e7b into main 2026-08-16 08:49:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1059
No description provided.