slmnio / slmngg-sfc

New SLMN.GG website & server
5 stars 8 forks source link

Quick Switcher to search for Teams/Players/Events #99

Open zusorio opened 2 years ago

zusorio commented 2 years ago

Is your feature request related to a problem? Please describe. To go to a team/player/event a user first has to go to the correct tab for the category, wait for the page to load, then enter their search query. This is annoying and takes some time.

Describe the solution you'd like A quick switcher that appears as an overlay on any page whenever the user presses a shortcut like ctrl/⌘+k. It should fuzzy search teams, players and events and jump to the corresponding page on enter. There could also be an option to immediately jump to subpages for the select item like brackets, played matches, branding, etc. using the arrow keys.

Describe alternatives you've considered There could also just be a universal search tab, however this would still be another click before being able to search.

Additional context GitHub has the option to use tab for searching inside the selected option, this could be nice. image image

slmnio commented 2 years ago

I use the quick switcher all the time in Discord so would love to have it on SLMN.GG. I think the main thing is working out how to get the data for the switcher. Most stuff on the site uses its own cache of SLMN.GG which is events/teams/things it has loaded. We don't want it to load the entire site just to filter through them on the client.

It should all probably be handled by the server. As things are updated, they can be given an extra field which contains strings that could match a fuzzy search. For example, events could pull their name, their short name, series name and so on. ST4's array would look something like ["Avast's Sub Tourney 4", "subtourney", "Sub Tourney 4", "Avast's Sub Tourney", "June 2021"] just from the text fields on the record.

We'd also need to add either more descriptive fields or some sort of aliases list (there's actually one on the Teams table that we used for matching up stats from lobby names). The short name of events is not actually the shortest we use - "BPL3" and "ST4" are not actually on the database at all other than some redirects that aren't linked.

slmnio commented 2 years ago

👀

https://user-images.githubusercontent.com/15251071/150610979-a6986ea8-7127-4eaf-91d0-ffc6221e2933.mp4