GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
570 stars 60 forks source link

[Request]: Hashtags list is not alphabetically sorted, not sortable nor filterable / searchable #1072

Open nekohayo opened 3 months ago

nekohayo commented 3 months ago

Describe the request

When you click "Hashtags" in the sidebar, you get a list of your followed hashtags in a reverse-chronological order, which makes it pretty hard to find what you're looking for when you follow many hashtags.

Ideally it should be alphabetical to begin with, and then searchable (in a filter search kind of way). Maybe by putting a search entry widget at the top of the list, with placeholder text that says "Search hashtags" (or still just "Hashtags")?

Sorting between "date of adding that hashtag" vs alphabetical vs popularity could also be a thing, though probably less important than search and alphabetical sorting.

Implementation Details

GeopJr commented 3 months ago

Not possible. Since the hashtags view is a timeline (api-wise), it has the same properties as all other timelines:

  1. they are reverse chronological
  2. they are paginated

Being paginated, makes any sorting or search impossible. E.g. if every page has 10 items and you follow 30 hashtags, you can only search and sort on what's has been loaded. So if I add a way to sort them alphabetically, it would look like this:

1st page:

*you scroll so the next page loads*

Now we can either re-sort everything, making the scroll position meaningless as you'd have to go back to the start to see everything again, or sort the new page:

One solution would be to pre-load everything. I am against that for posts/accounts as they can be quite long and resource intense for servers, hashtag objects are very small in comparison, but at the same time, there are extreme cases like someone following 10k hashtags

nekohayo commented 3 months ago

Hmmm, how would Tuba display 10k hashtags? It would show the first page of X amount of items only?

In any case then, shouldn't it be possible to filter-search the view's model on the client side even if it's just the current page? And then if there are no results, then Tuba can probe the server for more results, with a "Search more" button or something like that? i.e. same as if the user was moving between pages manually, and scanning the list with their eyes, but GTK would be the one doing the scanning of the list…

GeopJr commented 3 months ago

Hmmm, how would Tuba display 10k hashtags? It would show the first page of X amount of items only?

Yep, like a normal timeline, but instead of posts, it's hashtags

In any case then, shouldn't it be possible to filter-search the view's model on the client side even if it's just the current page? And then if there are no results, then Tuba can probe the server for more results, with a "Search more" button or something like that? i.e. same as if the user was moving between pages manually, and scanning the list with their eyes, but GTK would be the one doing the scanning of the list…

I mean, it's possible, but thinking of extremes once again, it could take ages to look through everything.

In pseudocode, it would be a while loop that goes through all hashtag pages until it reaches the end. More likely to hit ratelimits or take awfully long to finish. It's be faster to just use the search tab instead :shrug:

My issue with having a search entry at all, is that it either has to work 100% or not exist. If it only searches in alread-loaded hashtags, then users might be confused as to why it doesnt show the hashtag they were looking for. If it searches everything, it could fail or take too long.