tradingstrategy-ai / frontend

Web frontend for TradingStrategy.ai
https://tradingstrategy.ai
131 stars 23 forks source link

Advanced search UX improvements #220

Closed kenkunz closed 2 years ago

kenkunz commented 2 years ago

Goal

Improve advanced search UX with the following enhancements:

1. handle mobile virtual keyboard "enter" (🔍)

Hitting "enter" (🔍) on mobile devices should close the mobile virtual keyboard

2. no results fallback

When a search returns no results, provide useful fallback text ("no results / check filters")

3. prioritize exchanges in search results

NOTE: ran into some issues implementing this – descoping into a separate issue #227

Currently, exchanges are not displayed even when searching for an exchange-specific term like "pancakeswap". This is due to the default liquidity:desc sort, since exchange records have null value for liquidity.

Typesense has a feature that can likely address this: https://typesense.org/docs/0.23.1/api/search.html#sorting-null-empty-or-missing-values

In SortSelect.svelte, update the sort value for â–Ľ Liquidity sort option to:

['liquidity(missing_values: first):desc', '_text_match:desc']

NOTE: This seemed to work in initial testing; later it stopped working and returned an error. Try this again and open a bug with Typesense if it is not working correctly.

Consider simplifying / refactoring SortSelect.svelte – the sort options don't require direction; it may work to directly set the sort array value on the <option> tag.

Checklist

kenkunz commented 2 years ago

Re: 3. prioritize exchanges in search results

Per Typesense support, we need to upgrade our hosted Typesense cluster to the latest version (0.24.0.rcn27) to take advantage of this feature.