Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve Orderbook UI #556

Merged
merged 193 commits into from
Jun 5, 2024
Merged

feat: improve Orderbook UI #556

merged 193 commits into from
Jun 5, 2024

Conversation

dib542
Copy link
Collaborator

@dib542 dib542 commented May 10, 2024

This PR aims to improve the Orderbook experience based on several user interview and feedback sessions

it includes several Orderbook changes:

  • LimitOrder card changes:

    • 1d5dcb1 1bf3321 changes Buy/Sell control from tabs to a radio input selection "switch"
    • 1d5dcb1 b0ac12d Adds Swap/Limit radio input "switch" to control the desired Dex Order type
    • 828005b allows editing of both amountIn or amountOut input fields
    • 828005b adds new style of token input values (using TokenInputGroup)
    • d2524dd fixes keyboard tabbing between inputs
    • e4712bb adds LimitPrice input control and connects to Order state
    • e4712bb adds LimitPrice shortcut buttons
    • 1b68d7e adds new style for Limit Price input component
    • 56b9324 13e732f improves the estimated swap price when current price is stale and being re-queried
    • 8427ff9 676ec6b improve estimated trade order and "Confirm" button state
    • eea0679 a8265e5 b11da0d adds Expiry time shortcut buttons
    • eea0679 allows setting new Custom expiries including "months" and "years"
    • b9bc50f connects market price slippage as a price indication to Depth and Chart
    • 132061b 1653376 f2ee8e6 improves style to become narrower
    • eb661dd allow input fields to be focused whenever their "group" of components is selected
    • e031c6a adds a new "focusable" style to allow users to know on hover that an input is focusable and interactive
    • 6423f7e d3ff604 adds error state when user has no input tokens
    • 19b4e07 b541823 improves loading/re-querying price state
    • 019eeb0 adds setting price indication on clicking shortcut button for LimitPrice
  • Chart component changes:

    • 129ae48 307f79f fix: improve/reduce re-rendering of Chart on page start/load
    • d948121 fix: remove manual addition of "spacing" bars, activate option for automatic "spacing" bars
    • 3d03a36 24ee5e8 matches TradingView chart colors to Duality theme colors for design consistency
    • 5ed9606 make chart height dynamic (now depends on LimitOrder card height)
    • 31d5cdf hide left toolbar by default
    • f6fd635 add 5/10 minutes bar options, default to 5 minute bars
    • 6952382 a35b095 draw price indication (potential Buy/Sell order) line on chart
    • 46aae64 adds click chart to set Order limit price
  • new Chart-Depth connection component:

    • a8a9b41, a233b00 visually connects the Chart to Depth table
    • 5543643 visually add price "indication" connection between Depth and Chart
    • 36b04b1 visually connections Depth table buckets to Chart
    • d4afb38 visually add all Depth buckets to side of Chart
    • 14d9875 ab72d77 adds toggle buttons for the display of buckets next to chart or not
  • Depth tab/table changes:

    • 7409a57 fix: puts higher prices at top of table (to align to y-axis of chart)
    • 2a07cef 3fe8cc6 adds dynamic number of rows in table to allow a dynamic height of table
    • 33d3415 add a bucket resolution control
    • b2cf4e4 adds "Value (USD)" column
    • 9259aed adds background color "progress bar" indication of value of order row
    • d808330 85eeecc d92926c c9047ee adds visual of "price indication" state (a potential trade)
    • 019eeb0 adds "click to set limit price" to each bucket row (except "0" price rows: 7a78f9e)
    • b3230b8 adds bucket animations on value changes
    • 72b52f8 adds radio buttons to select between show Buy or Sell order rows
    • 1648ee8 adds footer display of Buy vs Sell value %
  • Recent Trades List tab/table component changes:

    • 2ac05f5 adds 30 rows of recent orders, and allows table to scroll
    • d9f99ed adds a websocket subscription to stream real-time table data
  • My Orders table components changes:

    • a309054 changes text from "Orders" to "My Orders"
    • b17415f adds specific empty table message when wallet is not connected

and several general fixes to enable these updates:

  • 05b264c Adds a new hook useBuckets
  • 46a5c91 Adds a general fix to the useRealtimePrice hooks
    • this was sometimes used to get "base" price or "display" price
    • this is now explicitly split into two hooks: useRealtimeBasePrice and useRealtimeDisplayPrice
  • b541823 Adds a general fix to the isLoading state of react-query states
    • isLoading of the SWR state now maps to the react-query isLoading state as should make sense
  • 9b8eb8a Adds a general improvement to the indexer hooks
    • this allows am onAccumulated callback to receive the latest data updates as well as the accumulated state
  • 9792f6c Adds a general fix to the My Orders table
    • when no wallet is connected, the "My Orders" table no longer generates a chain tx query of no address field (resulting in querying all order txs)
  • a36b8c1 A general fix to the mutation of arrays
    • fixes potential unexpected in-place array .reverse() mutations (which should be avoided in React renders)
  • 28bf86e Allows Orderbook page to take up more width on a wide screen
  • 85919ac Using token displayPrices instead on basePrices
  • 1d19005 4305d0a tx end price calculation fixes

and several updates to components to enable these updates:

@dib542 dib542 force-pushed the 555-improve-orderbook-order-card branch from e4199fc to e4712bb Compare May 10, 2024 18:20
dib542 added 2 commits June 4, 2024 21:00
    - .toPrecision can return scientitific notation strings which will
      not pass validation on some numeric input fields
    - not all need to be changed but its best to change all anyway
@dib542 dib542 merged commit 45ad9c9 into main Jun 5, 2024
2 of 3 checks passed
@dib542 dib542 deleted the 555-improve-orderbook-order-card branch June 5, 2024 02:23
dib542 pushed a commit that referenced this pull request Jun 5, 2024
## [2.11.0](v2.10.0...v2.11.0) (2024-06-05)

### Features

* improve orderbook order card ([#556](#556)) ([45ad9c9](45ad9c9))
@dib542
Copy link
Collaborator Author

dib542 commented Jun 5, 2024

🎉 This PR is included in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dib542 dib542 added the released label Jun 5, 2024
@dib542 dib542 changed the title feat: improve orderbook order card feat: improve Orderbook UI Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Orderbook UI
2 participants