fix(frontend): widen cancel-mutation prop types to LimitOrderCancelInput (#246) #737

Merged
Brouie merged 1 commit from qa/fix-cancel-mutation-prop-type into main 2026-06-03 01:59:18 +00:00
Brouie commented 2026-06-02 17:23:30 +00:00 (Migrated from gitlab.com)

Fixes a main build breakage found while verifying #268.

tsc -b / npm run build has been red on main since #246 (c93bb3c): the cancel mutation became LimitOrderCancelInput = number | number[] (for batch "Cancel all mine"), but the cancelLimitOrderMutation / cancelMutation prop types on OrderBookPanel and TradeOrderTicket stayed UseMutationResult<…, number, …>. So a number[]-capable mutation is passed through number-only props — 6 TS2322/TS2345 errors across OrderBookPanel, TradeOrderTicket, TradePage, LimitOrdersPage (e.g. number[] not assignable to number).

Not caught because the local/CI checks run vitest + eslint, neither of which type-checks; only tsc -b does.

Change

Widen the prop types to LimitOrderCancelInput (the actual hook input type) in OrderBookPanel.tsx (the panel prop + the two BookSideColumn cancelMutation props) and TradeOrderTicket.tsx (both prop decls). Type-only — no runtime change.

Verification

  • npx tsc -b — exits clean (was 6 errors).
  • npx vitest run OrderBookPanel TradeOrderTicket LimitOrdersPage pair.test — 30 passed.

Relates to #246 (origin) and unblocks #268's typecheck clean criterion. Not a close. Suggest adding tsc -b / npm run build to CI so type-only breaks are caught.

Fixes a main build breakage found while verifying #268. `tsc -b` / `npm run build` has been red on main since #246 (`c93bb3c`): the cancel mutation became `LimitOrderCancelInput = number | number[]` (for batch "Cancel all mine"), but the `cancelLimitOrderMutation` / `cancelMutation` prop types on `OrderBookPanel` and `TradeOrderTicket` stayed `UseMutationResult<…, number, …>`. So a `number[]`-capable mutation is passed through `number`-only props — 6 TS2322/TS2345 errors across OrderBookPanel, TradeOrderTicket, TradePage, LimitOrdersPage (e.g. `number[]` not assignable to `number`). Not caught because the local/CI checks run vitest + eslint, neither of which type-checks; only `tsc -b` does. ### Change Widen the prop types to `LimitOrderCancelInput` (the actual hook input type) in `OrderBookPanel.tsx` (the panel prop + the two `BookSideColumn` `cancelMutation` props) and `TradeOrderTicket.tsx` (both prop decls). Type-only — no runtime change. ### Verification - `npx tsc -b` — exits **clean** (was 6 errors). - `npx vitest run OrderBookPanel TradeOrderTicket LimitOrdersPage pair.test` — **30 passed**. Relates to #246 (origin) and unblocks #268's `typecheck clean` criterion. Not a close. Suggest adding `tsc -b` / `npm run build` to CI so type-only breaks are caught.
Brouie commented 2026-06-02 17:23:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #268

mentioned in issue #268
Brouie commented 2026-06-02 18:00:13 +00:00 (Migrated from gitlab.com)

mentioned in issue #246

mentioned in issue #246
PlasticDigits commented 2026-06-03 01:59:19 +00:00 (Migrated from gitlab.com)

mentioned in commit 90fca1be04

mentioned in commit 90fca1be04de0517abdb43441fab0f2e45109de7
PlasticDigits (Migrated from gitlab.com) merged commit 90fca1be04 into main 2026-06-03 01:59:19 +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!737
No description provided.