fix(frontend): side-aware limit price deviation chips (#495) #1040

Merged
PlasticDigits merged 2 commits from fix/495-limit-price-deviation-chips into main 2026-07-25 04:54:26 +00:00
PlasticDigits commented 2026-07-25 04:34:27 +00:00 (Migrated from gitlab.com)

Summary

  • Make limit price deviation chips side-aware so buy presets land strictly below the reference and sell presets strictly above it (#495).
  • Map near-market magnitude 0 to ±LIMIT_PRICE_NEAR_MARKET_DEVIATION_PERCENT (0.01%) so chip prices never equal the reference (invalid per #154).
  • Document the chip invariant in docs/frontend.md, docs/design-system.md, docs/limit-orders.md, and skills/AGENTS_FRONTEND_LIMIT_ORDER_PRICE.md.

Test plan

  • vitest limitOrderPriceReference.test.ts + LimitOrderPriceField.test.tsx (run + restest)
  • Manual: /limits or /trade Limit → Buy → click 0%− / −1% / −5% / −10% → no “Invalid buy”
  • Manual: flip to Sell → click 0%+ / +1% / +5% / +10% → no “Invalid sell”
  • Manual: Place guard / non-crossing still blocks only when book requires it for chip-selected prices

Issue acceptance checklist

  • Buy chips set prices strictly below ref and clear invalid state
  • Sell near-market / positive chips set prices strictly above ref
  • Place guard / direction checks still pass for chip-selected prices (unit coverage)
  • Live UI smoke on LocalTerra (not run in this MR)

Closes #495

## Summary - Make limit price deviation chips **side-aware** so buy presets land strictly below the reference and sell presets strictly above it ([#495](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/495)). - Map near-market magnitude `0` to ±`LIMIT_PRICE_NEAR_MARKET_DEVIATION_PERCENT` (0.01%) so chip prices never equal the reference (invalid per #154). - Document the chip invariant in `docs/frontend.md`, `docs/design-system.md`, `docs/limit-orders.md`, and `skills/AGENTS_FRONTEND_LIMIT_ORDER_PRICE.md`. ## Test plan - [x] `vitest` `limitOrderPriceReference.test.ts` + `LimitOrderPriceField.test.tsx` (run + restest) - [ ] Manual: `/limits` or `/trade` Limit → Buy → click `0%−` / `−1%` / `−5%` / `−10%` → no “Invalid buy” - [ ] Manual: flip to Sell → click `0%+` / `+1%` / `+5%` / `+10%` → no “Invalid sell” - [ ] Manual: Place guard / non-crossing still blocks only when book requires it for chip-selected prices ## Issue acceptance checklist - [x] Buy chips set prices strictly below ref and clear invalid state - [x] Sell near-market / positive chips set prices strictly above ref - [x] Place guard / direction checks still pass for chip-selected prices (unit coverage) - [ ] Live UI smoke on LocalTerra (not run in this MR) Closes #495
ghost1 commented 2026-07-25 04:34:30 +00:00 (Migrated from gitlab.com)

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot) to get automatic reviews on future PRs.
PlasticDigits commented 2026-07-25 04:34:34 +00:00 (Migrated from gitlab.com)

marked this merge request as ready

marked this merge request as **ready**
PlasticDigits commented 2026-07-25 04:54:20 +00:00 (Migrated from gitlab.com)

mentioned in commit 9a8045cc63

mentioned in commit 9a8045cc63053ab3ae02478908cb2aee60217957
PlasticDigits commented 2026-07-25 04:54:21 +00:00 (Migrated from gitlab.com)

added 24 commits

  • a010b144...b734964e - 23 commits from branch main
  • 9a8045cc - merge: sync branch with main for !1040

Compare with previous version

added 24 commits <ul><li>a010b144...b734964e - 23 commits from branch <code>main</code></li><li>9a8045cc - merge: sync branch with main for !1040</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/322/diffs?diff_id=1923593463&start_sha=a010b1441f19a0b0e9b41b652ceb162a095ef2cb)
project_80162261_bot_e646d24e9b17aa4b22040bfe08d3fd1c commented 2026-07-25 04:54:23 +00:00 (Migrated from gitlab.com)

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot) to get automatic reviews on future PRs.
PlasticDigits commented 2026-07-25 04:54:26 +00:00 (Migrated from gitlab.com)

mentioned in commit 3151a42fca

mentioned in commit 3151a42fca48952b19a6f782078d147c5ad81f98
PlasticDigits (Migrated from gitlab.com) merged commit 3151a42fca into main 2026-07-25 04:54:26 +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!1040
No description provided.