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: search and filtering UX improvements #591

Conversation

rando128
Copy link
Contributor

Description

This PR brings some usability enhancements for searching and filtering the dashboard symbols.

4 main capabilities have been added:

  • The user can filter by asset directly from the account balance section
  • The user can filter symbols with active trades by clicking on open trades in the order stats section
  • The user can filter symbols with open orders by clicking on open orders - buy in the order stats section
  • The order stats section now renders the current filter:
    • Specific searchkeyword (from the filterIcon view)
    • Open trades
    • Open orders
    • Hidden disabled symbols

A toast has been added to inform which symbols are shown in the dashboard and the filtering icon of the header shows the red dot only when disabled symbols are hidden.

Changes:

  • 2 special searchKeywords (open trades, open orders) are now filtering symbols with open trades or orders. The logic has been added to common.js.
  • The OrderStats class includes the logic for displaying the current filter and making open trades/orders sections clickable (if their value is not 0)
  • AccountWrapper.js and AccountWrapperAsset.js classes have been updated to include a search button in the account balance section
  • The setSearchKeyword function of App.js now handles toasts
  • FilterIcon.js has been updated to propagate the searchKeyword changes only when the form is submitted
  • The app.css has been extended for button handling in the order stats section

Caveats:

  • The existing saveNumberOfBuyOpenOrders calculation doesn't always get all the symbols with active trades. This is something I discovered while developing this PR. I will open a separate bug as I couldn't find a straightforward reason.

Motivation and Context

I often struggle to find myself scrolling and changing paginations and search to get the relevant symbols. These improvements will hopefully make the experience smoother.

How Has This Been Tested?

This is working on my production server

Screenshots (if appropriate):

Filtering from Account balance
Screenshot 2023-01-15 at 12 20 43

Active filter with informative toast
Screenshot 2023-01-15 at 13 09 38

SearchKeyword filtering
Screenshot 2023-01-15 at 12 49 21

Open trades filtering
Screenshot 2023-01-15 at 12 48 54

Open orders filtering
Screenshot 2023-01-15 at 13 08 05

Only with hidden disabled symbols
Screenshot 2023-01-15 at 13 08 24

@rando128 rando128 changed the title feat: search and filtering improvements feat: search and filtering UX improvements Jan 15, 2023
@chrisleekr chrisleekr added the enhancement New feature or request label Jan 16, 2023
@rando128
Copy link
Contributor Author

@chrisleekr, I saw you assigned the ticket to me. What do you want me to do?

@chrisleekr
Copy link
Owner

@rando128 don't worry. I just assigned you because it was opened by you.

I am writing test cases for your changes.

The only feedback is I didn't realise I could click "Open buy orders" or "Open trades" until I saw the code.
But otherwise, all looks good. Once I finish writing test cases, I will merge them in.

@rando128
Copy link
Contributor Author

rando128 commented Jan 16, 2023

Yeah, I initially put a filter/search icon next to the "Open buy orders" and "Open trades" element, but it was making the UI very busy. After second thought, would a simple text-decoration: underline; be sufficient (only in case the value is not zero)?

Screenshot 2023-01-16 at 11 50 47

@chrisleekr
Copy link
Owner

@rando128 To be honest, I am not sure. Haha. I am not good at UX. Hence, I researched some other cases.
Could we add a filtering icon? Or make the text button?

In any way, probably don't worry too much about it. I will merge in, and we can improve later on.

@chrisleekr chrisleekr merged commit d517846 into chrisleekr:master Jan 16, 2023
@chrisleekr
Copy link
Owner

@rando128
It's merged. Thanks for your code! It's a good improvement.

@rando128
Copy link
Contributor Author

Thx. I'll address the UX improvement in another PR.

Sorry for leaking a console.log statement 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants