TheGame icon indicating copy to clipboard operation
TheGame copied to clipboard

Feature/global search

Open Udit-takkar opened this issue 2 years ago • 4 comments

Closes #1002

TODO

  • [x] Have to fix some css
  • [x] Handle when to show and hide search box
  • [x] Experiment with Rxjs SwitchMap
  • [ ] Fuzzy matching

Implementation

This implementation is better and improved version of https://github.com/MetaFam/TheGame/pull/1087.

  • Used Rxjs for building this real time search .

The benefits of RxJS is we can chain operators together, similar to how we can chain array methods together and cancel, refetch the network requests. Due to this i was able to use filter and debounce easily and also switchMap which discard previous stream when new stream is input and prevent race conditions.(What is race condition? - https://wanago.io/2020/03/02/race-conditions-in-react-and-beyond-a-race-condition-guard-with-typescript/)

  • Created new routes for displaying all the search results.

  • Added GIN index on some tables to improve performance.

Assets

https://user-images.githubusercontent.com/53316345/154152692-9358de72-21df-45c0-94e3-acd82d705fe5.mov

Udit-takkar avatar Feb 13 '22 21:02 Udit-takkar

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/metafam/the-game/78GNz5qTiVv3M1ejFX3YNYJWczN8
✅ Preview: https://the-game-git-feature-global-search-metafam.vercel.app

vercel[bot] avatar Feb 13 '22 21:02 vercel[bot]

There are still some more things to be done.

Udit-takkar avatar Feb 13 '22 21:02 Udit-takkar

It looks like your solution searches for players by their username instead of their display name. Could you make it so that it searches for both, since some people might not set their username at all?

vidvidvid avatar Feb 16 '22 12:02 vidvidvid

@Udit-takkar Really great work. I love this feature.

Can you add a loading indicator when the user starts typing so that we know we have to wait?

We could also make the search dropdown larger ?

Also there is some issues with the search bar location on mobile screens. Screenshot from 2022-03-02 15:51:09

There is also an issue where it doesn't display any text although its finding some information. Example: Screenshot from 2022-03-02 15:49:55

Along with these changes can you rebase with develop as well?

@davort could you provide some design tips to make the search bar/drop down look better?

dan13ram avatar Mar 02 '22 10:03 dan13ram

@dan13ram @peth-yursick @alalonde @dysbulic Is it just the remaining review issues & a lack of @Udit-takkar that are stopping this from getting finished?

luxumbra avatar Oct 08 '22 13:10 luxumbra

Is it just the remaining review issues & a lack of Udit-takkar that are stopping this from getting finished?

Yes thats right. Its probably best one of us takes this on and completes it over the next few weeks.

dan13ram avatar Oct 08 '22 17:10 dan13ram