buda-base / public-digital-library

http://library.bdrc.io
5 stars 6 forks source link

latest searches for users #895

Closed eroux closed 1 month ago

eroux commented 4 months ago

the idea is that when users click on the search bar, but don't type anything, some recent user searches would be listed. I think this is a pretty major feature, but that raises a few questions on the implementation:

roopeux commented 4 months ago

@eroux I did not understand the first question. The general UI should be as it is, a search bar.

Search history should be as long as possible.

I would not complicate things and start sharing search histories between devices of the same registered user. It would be a nice-to-have but probably bad cost-benefit.

@berger-n I propose using localstorage and not a cookie, because a cookie can get too small.

The way to clear individual search items would be to add an X at the end of each autosuggestion like in the actual search bar, but I don't think it will be worth it. I struggle finding a use case.

roopeux commented 4 months ago

@berger-n The search history should be in chronological order, latest queries first. When user types, show the matching lines. (Match from the beginning of string only)

eroux commented 4 months ago

in terms of UI, the question is: will there be an indication that the search suggestions come from the user search history? like maybe an icon of a clock?

As long as possible seems like a lot UI-wise, it will take the whole screen in some cases, maybe we can limit to 10?

ok for localstorage yes! let's not have a clear history button for now and see if users ask

berger-n commented 3 months ago

done: https://library-dev.bdrc.io/osearch/search

simplescreenrecorder-2024-08-19_18 30 26 mkv

some items to discuss/fine tune (see how it works on Google search):

eroux commented 3 months ago

wow this is really cool, thanks a lot!

roopeux commented 2 months ago

Sorry I have missed this. The feature works great, but let's limit suggestions in any situation to 10, according to UX best practices.

Typically user's own queries are not visually different, but the way you have done it is very good.