W12-C2: Edit button on open limit order rows fires no action and sends no network request #178

Closed
opened 2026-05-21 14:08:34 +00:00 by totdking · 20 comments
totdking commented 2026-05-21 14:08:34 +00:00 (Migrated from gitlab.com)
No description provided.
totdking commented 2026-05-21 14:09:29 +00:00 (Migrated from gitlab.com)

Issue Summary

Each open limit order row in the BIDS panel has two action controls: a × (cancel) button and an Edit button. The × button works correctly (it has aria-label="Cancel this resting order" and initiates the cancel flow). The Edit button is visually present and appears interactive but produces no observable effect when clicked — no modal opens, no drawer appears, no network request fires, and no UI state changes. The button is functionally dead.


Reproduction Steps

  1. Start the app (VITE_NETWORK=local npm run dev) with LocalTerra running
  2. Connect Station wallet (localterra)
  3. Navigate to a valid pair, e.g. http://localhost:3000/trade/terra146ypndztcmmrmyxef7e20cul82gh43vjnw4uacwdvg5sp9kva7sqc9mjav
  4. Place a resting limit order so it appears in the BIDS panel
  5. Open DevTools → Network tab, filter to All
  6. Click the Edit button on the open order row
  7. Observe the UI and Network tab

Expected Behavior

Clicking Edit should open an order-amendment interface (modal, drawer, or inline form) pre-populated with the existing order's price and quantity, allowing the trader to modify the resting order. A network request should fire if the amendment is submitted.


Actual Behavior

  • No modal, drawer, or inline form appears
  • No network request fires
  • No loading state is shown
  • No toast or error message is shown
  • The row and BIDS panel remain unchanged
  • The × (cancel) button on the same row works correctly

Environment Details

Field Value
OS macOS (Apple M1 Pro, 14-inch)
Browser Google Chrome 148 (desktop)
Viewport ~1440px desktop
Network localterra (local Docker)
Frontend VITE_NETWORK=local npm run dev at localhost:3000

Wallet / Device Details

  • Wallet: Keplr browser extension
  • Wallet state: Connected — localterra

Severity / Impact

P2 UX. A visible Edit button that does nothing damages trader trust and implies functionality that does not exist. For a CEX migrant expecting to amend resting orders (a standard CEX feature), a dead Edit button is a meaningful usability failure. Found under W12-C2 (Accessibility — icon-only trading buttons and interactive controls inspection).

cc: @PlasticDigits

### Issue Summary Each open limit order row in the BIDS panel has two action controls: a **×** (cancel) button and an **Edit** button. The × button works correctly (it has `aria-label="Cancel this resting order"` and initiates the cancel flow). The **Edit** button is visually present and appears interactive but produces no observable effect when clicked — no modal opens, no drawer appears, no network request fires, and no UI state changes. The button is functionally dead. --- ### Reproduction Steps 1. Start the app (`VITE_NETWORK=local npm run dev`) with LocalTerra running 2. Connect Station wallet (localterra) 3. Navigate to a valid pair, e.g. `http://localhost:3000/trade/terra146ypndztcmmrmyxef7e20cul82gh43vjnw4uacwdvg5sp9kva7sqc9mjav` 4. Place a resting limit order so it appears in the BIDS panel 5. Open DevTools → Network tab, filter to **All** 6. Click the **Edit** button on the open order row 7. Observe the UI and Network tab --- ### Expected Behavior Clicking Edit should open an order-amendment interface (modal, drawer, or inline form) pre-populated with the existing order's price and quantity, allowing the trader to modify the resting order. A network request should fire if the amendment is submitted. --- ### Actual Behavior - No modal, drawer, or inline form appears - No network request fires - No loading state is shown - No toast or error message is shown - The row and BIDS panel remain unchanged - The × (cancel) button on the same row works correctly --- ### Environment Details | Field | Value | |-------|-------| | OS | macOS (Apple M1 Pro, 14-inch) | | Browser | Google Chrome 148 (desktop) | | Viewport | \~1440px desktop | | Network | `localterra` (local Docker) | | Frontend | `VITE_NETWORK=local npm run dev` at `localhost:3000` | --- ### Wallet / Device Details - **Wallet:** Keplr browser extension - **Wallet state:** Connected — localterra --- ### Severity / Impact **P2 UX.** A visible Edit button that does nothing damages trader trust and implies functionality that does not exist. For a CEX migrant expecting to amend resting orders (a standard CEX feature), a dead Edit button is a meaningful usability failure. Found under **W12-C2** (Accessibility — icon-only trading buttons and interactive controls inspection). cc: @PlasticDigits
totdking commented 2026-05-21 15:04:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #116

mentioned in issue #116
PlasticDigits commented 2026-05-22 05:51:03 +00:00 (Migrated from gitlab.com)

mentioned in commit db75b02a4e

mentioned in commit db75b02a4e88b173edea1ba9072071282d623710
PlasticDigits commented 2026-05-22 05:51:15 +00:00 (Migrated from gitlab.com)

Fix shipped on main (f5f7a38)

Root cause

On desktop (lg / ≥1024px), /trade mounted two TradeOrderTicket instances (sub-lg layout hidden via CSS + desktop layout visible). Clicking Edit pushed LimitBookTicketDraft to both; the hidden ticket’s useEffect applied the draft then called onLimitBookDraftConsumed(), clearing parent state before the visible ticket could read it — so the UI looked dead (no tab switch, no prefill, no network — by design for prefill-only).

What changed

  • Gate sub-lg vs desktop workspaces with useMediaQuery(TRADE_DESKTOP_LAYOUT_MEDIA_QUERY) so exactly one ticket mounts.
  • Shared tradeOrderTicket element + stable useCallback draft handlers.
  • aria-label on book Edit for W12-C2 a11y.
  • Regression tests: OrderBookPanel click → onPrefillLimitTicket; TradePage desktop Edit → limit tab + price input.
  • Docs/skills: invariants in docs/frontend.md § trade-book-row-actions, docs/limit-orders.md, skills/AGENTS_FRONTEND_ORDER_BOOK_ROW_ACTIONS.md, skills/AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.md.

Note: Edit intentionally does not submit an on-chain amend (no modal / no tx). It prefills the limit ticket; cancel the resting order, then place a replacement.


Verification checklist

@totdking — please confirm on localterra + Chrome desktop (≥1440px):

  • Connect wallet, open /trade/<valid-pair>, place a resting bid you own
  • Click Edit on that row → Limit tab selected; price + amount fields match the order
  • No network request on Edit alone (expected)
  • × cancel on the same row still works
  • Sub-desktop viewport (<1024px): Edit still prefills the single visible ticket
  • Book helper copy still mentions cancel-then-replace

Leaving open until verified. Thanks!

## Fix shipped on `main` (f5f7a38) ### Root cause On desktop (`lg` / ≥1024px), `/trade` mounted **two** `TradeOrderTicket` instances (sub-lg layout hidden via CSS + desktop layout visible). Clicking **Edit** pushed `LimitBookTicketDraft` to both; the hidden ticket’s `useEffect` applied the draft then called `onLimitBookDraftConsumed()`, clearing parent state **before** the visible ticket could read it — so the UI looked dead (no tab switch, no prefill, no network — by design for prefill-only). ### What changed - Gate sub-lg vs desktop workspaces with `useMediaQuery(TRADE_DESKTOP_LAYOUT_MEDIA_QUERY)` so exactly **one** ticket mounts. - Shared `tradeOrderTicket` element + stable `useCallback` draft handlers. - `aria-label` on book **Edit** for W12-C2 a11y. - Regression tests: `OrderBookPanel` click → `onPrefillLimitTicket`; `TradePage` desktop **Edit** → limit tab + price input. - Docs/skills: invariants in `docs/frontend.md` § [trade-book-row-actions](docs/frontend.md#trade-book-row-actions), `docs/limit-orders.md`, `skills/AGENTS_FRONTEND_ORDER_BOOK_ROW_ACTIONS.md`, `skills/AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.md`. **Note:** **Edit** intentionally does **not** submit an on-chain amend (no modal / no tx). It prefills the limit ticket; cancel the resting order, then place a replacement. --- ### Verification checklist @totdking — please confirm on localterra + Chrome desktop (≥1440px): - [ ] Connect wallet, open `/trade/<valid-pair>`, place a resting bid you own - [ ] Click **Edit** on that row → **Limit** tab selected; price + amount fields match the order - [ ] No network request on **Edit** alone (expected) - [ ] **×** cancel on the same row still works - [ ] Sub-desktop viewport (<1024px): **Edit** still prefills the single visible ticket - [ ] Book helper copy still mentions cancel-then-replace Leaving open until verified. Thanks!
Brouie commented 2026-05-25 08:03:57 +00:00 (Migrated from gitlab.com)

qa cleared source+test layer @PlasticDigits

verified f5f7a383 is on main.

Regression tests green:

  • TradePage.test.tsx → "book Edit prefills the visible desktop limit ticket (GitLab #178)" ✓
  • TradePage.test.tsx → "sub-desktop workspace uses md two-column grid for tablet portrait" (#146) ✓
  • OrderBookPanel.test.tsx 3/3 (click → onPrefillLimitTicket handler)

@totdking is out — flagging source side green so this isn't sitting in limbo. M1 / Chrome ≥1440px browser walk still belongs to him when he's back, or your call to close.

qa cleared source+test layer @PlasticDigits verified `f5f7a383` is on main. Regression tests green: - TradePage.test.tsx → "book Edit prefills the visible desktop limit ticket (GitLab #178)" ✓ - TradePage.test.tsx → "sub-desktop workspace uses md two-column grid for tablet portrait" (#146) ✓ - OrderBookPanel.test.tsx 3/3 (click → onPrefillLimitTicket handler) @totdking is out — flagging source side green so this isn't sitting in limbo. M1 / Chrome ≥1440px browser walk still belongs to him when he's back, or your call to close.
PlasticDigits commented 2026-05-27 06:46:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 049a9797a0

mentioned in commit 049a9797a00ee8752a158b071f4e1b14201cdef4
PlasticDigits commented 2026-05-27 06:46:27 +00:00 (Migrated from gitlab.com)

Verified and closed (M1 / Chrome ≥1440px browser walk)

Root cause (already on main since f5f7a38): /trade mounted two TradeOrderTicket instances (CSS-hidden sub-lg + visible desktop). Book Edit pushed LimitBookTicketDraft to both; the hidden ticket consumed the draft before the visible ticket applied it — dead Edit UX with no tab switch, prefill, or network (by design for prefill-only).

Verification performed:

  • LocalTerra healthy, host Postgres :5432, indexer :3001, bot swarm 30/30
  • Frontend on CORS-allowed port 4173 (PLAYWRIGHT_BASE_URL)
  • Vitest: TradePage “book Edit prefills…” + OrderBookPanel 4/4 green
  • Playwright e2e/trade-book-edit-178.spec.ts (merged 049a979):
    • 1440×900: wallet connected → seeded dev-wallet bid → Edit selects Limit tab, prefills price + escrow from indexer order, no POST on Edit alone, × cancel fires tx path, helper copy mentions cancel-then-replace
    • 820×1180: sub-desktop single ticket still prefills correctly

Note: Edit intentionally does not submit an on-chain amend — cancel resting order, then place replacement (documented behavior).

## Verified and closed (M1 / Chrome ≥1440px browser walk) **Root cause (already on main since f5f7a38):** `/trade` mounted two `TradeOrderTicket` instances (CSS-hidden sub-lg + visible desktop). Book **Edit** pushed `LimitBookTicketDraft` to both; the hidden ticket consumed the draft before the visible ticket applied it — dead Edit UX with no tab switch, prefill, or network (by design for prefill-only). **Verification performed:** - LocalTerra healthy, host Postgres :5432, indexer :3001, bot swarm 30/30 - Frontend on CORS-allowed port **4173** (`PLAYWRIGHT_BASE_URL`) - Vitest: `TradePage` “book Edit prefills…” + `OrderBookPanel` 4/4 green - Playwright `e2e/trade-book-edit-178.spec.ts` (merged 049a979): - **1440×900:** wallet connected → seeded dev-wallet bid → **Edit** selects **Limit** tab, prefills price + escrow from indexer order, **no POST** on Edit alone, **×** cancel fires tx path, helper copy mentions cancel-then-replace - **820×1180:** sub-desktop single ticket still prefills correctly **Note:** Edit intentionally does not submit an on-chain amend — cancel resting order, then place replacement (documented behavior).
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 06:46:29 +00:00
PlasticDigits commented 2026-05-31 12:21:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #247

mentioned in issue #247
PlasticDigits commented 2026-06-05 04:08:28 +00:00 (Migrated from gitlab.com)

mentioned in issue #312

mentioned in issue #312
PlasticDigits commented 2026-06-05 12:03:19 +00:00 (Migrated from gitlab.com)

mentioned in issue #294

mentioned in issue #294
PlasticDigits commented 2026-06-06 08:15:55 +00:00 (Migrated from gitlab.com)

mentioned in merge request !829

mentioned in merge request !829
PlasticDigits commented 2026-06-06 08:16:24 +00:00 (Migrated from gitlab.com)

mentioned in issue #292

mentioned in issue #292
PlasticDigits commented 2026-06-06 09:56:26 +00:00 (Migrated from gitlab.com)

mentioned in merge request !831

mentioned in merge request !831
PlasticDigits commented 2026-06-07 12:14:13 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
PlasticDigits commented 2026-06-08 07:23:39 +00:00 (Migrated from gitlab.com)

mentioned in merge request !836

mentioned in merge request !836
PlasticDigits commented 2026-06-08 08:14:06 +00:00 (Migrated from gitlab.com)

mentioned in issue #338

mentioned in issue #338
PlasticDigits commented 2026-08-15 12:19:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #524

mentioned in issue #524
PlasticDigits commented 2026-08-15 13:18:35 +00:00 (Migrated from gitlab.com)

mentioned in issue #527

mentioned in issue #527
PlasticDigits commented 2026-08-18 12:08:53 +00:00 (Migrated from gitlab.com)

mentioned in issue #561

mentioned in issue #561
PlasticDigits commented 2026-08-28 05:28:48 +00:00 (Migrated from gitlab.com)

mentioned in issue #693

mentioned in issue #693
Sign in to join this conversation.
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#178
No description provided.