vegaprotocol / frontend-monorepo

Toolkit for building apps that interact with Vega
https://vega.xyz
MIT License
25 stars 17 forks source link

Filter orders by default on trading page #3072

Closed mattrussell36 closed 1 year ago

mattrussell36 commented 1 year ago

Story

As a user I want the order list to be filtered when on the trading page So that I only see relevant orders

Acceptance Criteria

Tasks

Sketch

Additional details / background info

https://vegaprotocol.slack.com/archives/C037STCKMGC/p1677749496425519

bglownia commented 1 year ago

@mattrussell36 since orders table use pagination (infinite scroll) sorting need to be done on backend. To move LP pegged orders to the bottom backend need to return it on very bottom. Even if this will be done on backend I don't think it has a lot of sense. User will need to scroll through all pages of "normal" orders to get to LP pegged orders. IMHO it will be better to have filter to hide pegged orders or show only pegged orders

barnabee commented 1 year ago

@mattrussell36 since orders table use pagination (infinite scroll) sorting need to be done on backend. To move LP pegged orders to the bottom backend need to return it on very bottom. Even if this will be done on backend I don't think it has a lot of sense. User will need to scroll through all pages of "normal" orders to get to LP pegged orders. IMHO it will be better to have filter to hide pegged orders or show only pegged orders

Some design choices here we should at least take a critical look at in future iterations.

I'm not sure infinite scroll makes sense here (nor in many places on a trading app, to be honest). I'd expect Console to always load all orders into the active orders view, unless there are literally thousands and be able to filter, sort, and group them in many more ways than would be supported by DN APIs. This seems to me like something that ought to live on the client.

I'm open to the idea that my intuition here is wrong, but I get the sense we might be doing this just because it's become kind of a default for websites, not because it's necessarily the right approach for the application we are building.

mattrussell36 commented 1 year ago

@bglownia @barnabee

Allowing infinite scroll for the order list was a requirement that came from me, which may or may not be wrong from a purely a user experience point of view.

However, implementing it that way absolutely had a technical knock on affect of making filtering and sorting much more difficult to manage, which IMO provides way more value.

In other tables we've already made changes to handle more on the client. I'd suggest we do the same for orders. What that would like is the following: