floccusaddon / floccus

:cloud: Sync your bookmarks privately across browsers and devices
https://floccus.org
Mozilla Public License 2.0
5.56k stars 235 forks source link

[Android] search only finds results in the current folder (and its sub-folders) #1296

Open heapifyman opened 1 year ago

heapifyman commented 1 year ago

Which version of floccus are you using?

4.17.1

Sync method

Nextcloud Bookmarks

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

Brave 1.4.131 on Android 13

Which version of Nextcloud Bookmarks are you using? (if relevant)

No response

Which version of Nextcloud? (if relevant)

No response

What kind of WebDAV server are you using? (if relevant)

No response

Describe the Bug

The search only returns results from the currently selected bookmarks folder and its sub-folders.

Let's say you have a bookmark for www.example.com in folder A and folder B, which are both sub-folders of the root folder. If you then navigate to folder B inside the floccus Android App and then search for example the search results will only include the bookmark from folder B.

If the currently selected folder does not contain any bookmarks that match the search term, floccus will not display any results even if there are bookmarks in other folders that match the search term.

If however you are in the root folder the search results will include both the bookmark from folder A and the bookmark from folder B.

Expected Behavior

The search should find results from all folders, not only the currently selected folder.

I would expect the search to return both bookmarks:

Regardless of where in the bookmarks folder structure I am at the moment.

To Reproduce

Steps to reproduce

  1. Organise bookmarks in different folders. For example, create folders A and B in the root folder, and add a bookmark for www.example.com to both folders A and B.
  2. In floccus Android, navigate to folder root/B.
  3. Tap into search field in the top bar, and search for example.

Debug log provided

marcelklehr commented 1 year ago

This is the intended behavior, not a bug. If you want to see results from all folders you need to search in the root folder. This should be apparent from the label for the search function which afaik says e.g. "Search in B..." Do you have an idea on how to make this more apparent, perhaps?

infinity0 commented 1 year ago

IMO this should not be the intended behaviour and the search box should just look in all accounts, and not change its behaviour based on the currently-selected folder. It should act similar to a browser address bar. No browser implements "search only in 1 bookmark folder" functionality, likely because nobody needs it.

heapifyman commented 1 year ago

This should be apparent from the label for the search function which afaik says e.g. "Search in B..."

Unfortunately, it is not that apparent. For example, I let floccus sync both "Bookmarks Menu" and the "Bookmarks Bar" folder. When I go into either one of them, the search input's placeholder just says: Search in Bookmarks....

I don't have any good idea except for adding an additional label that displays the current folder name, and change the placeholder to "Search this folder..." or something. But that would occupy additional screen space (and depending on your language settings the new placeholder might not fit into the search input anyway). So it might not be worth the effort.

This is the intended behavior, not a bug.

Then I would like to convert this into a feature request instead. I don't think that the current behaviour is very useful. If I already know that the bookmark I am searching for is inside the current folder, then it is probably faster to just scroll through the current folder entries instead of tapping into the search field, typing in a search term, and then scroll through the results.

It also deviates from the behaviour of any browser's built-in bookmarks manager. If I search for a bookmark there the browser will display results from any folder, not just from the folder I am currently in.

I would also second @infinity0's statement that the more common use case is that the floccus search bar will be used like the browser's address bar: I type in some words that I think might be included in the name or URL of the bookmark I am looking for. And then I go through the search results and open the bookmark I want.

pinpontitit commented 1 year ago

This is the intended behavior, not a bug. If you want to see results from all folders you need to search in the root folder. This should be apparent from the label for the search function which afaik says e.g. "Search in B..." Do you have an idea on how to make this more apparent, perhaps?

+1

Before reading your answer, I was also thinking: "I don't know if it was intended or not, but I think that's a good behavior".

It permits filtering and more precise queries, without creating a too complicated "Filtering" menu, or a dropdown with more details. If you want to search precisely you go to a precise subfolder, if you want to search everywhere you go to root. Also, I've already seen this type of behavior elsewhere so it doesnt feel weird. But I can imagine that some people get confused because this behavior is not explained explicitly.

It's true that browsers doesnt use this functionnality neither in the adress bar (but that's normal), neither in the Bookmarks menu, and to be honest I don't specially need it either.

However I can imagine how someone with 2000+ or more bookmarks could benefit from this, don't you think ?

Imagine this stuation: I'm a crazy bookmark collector, with 5000 bookmarks. I'm a geek that jump between many OS. I have a folder "MacOs Ventura" A folder "MacOs Catalina" A folder "Windows 11" A folder "Windows 10" A folder "Ubuntu" A folder "ArchLinux" A folder "Debian" etc..

In each of these folders I have a folder called "Apps" or "Configs" or whatever.

So if I am searching for "Apps", I will have at least 7 results, without counting all the bookmarks with Apps in the URL or title.

So I can see how it could be useful, for someone with a lot of links, collecting movies, or I don't know what.

So taking out this feature would be a loss, and 1 year from now, someone will come asking for this feature.

Another thought: Either the current behaviour (better documented if possible), or some dropdown search results (ressembling the search dropdown in Github) with those options:

3 results found in this folder and subfolders: -Apps (Folder) -10 best apps for Windows 11 (Bookmark) -Windows 11 apps you absolutely need (Bookmark)

56 results found everywhere: -Apps (Folder) (in Windows 11) -Apps (Folder) (in Windows 10) -Apps (Folder) (in Macos) -.......

But such Dropdown, with all those options, is starting to become difficult to create and maintain, no ?

So I think the current solution could be a middle solution between simplicity and precise searches.

infinity0 commented 1 year ago

honest I don't specially need it either.

However I can imagine how someone with 2000+ or more bookmarks could benefit from this, don't you think ?

UIs should be written to help the user execute the most common tasks faster. A rare task shouldn't be sped up at the expense of common tasks.

marcelklehr commented 1 year ago

IMO the current behavior is the typical behavior of a file manager which we are trying to mimick, but I understand that it can be confusing if the label is not fully legible

infinity0 commented 1 year ago

Because of the lack of browser extensions on mobile, the floccus mobile UI should be trying to replace a browser address bar, and this is already a compromise.

I can't imagine anyone intentionally looking for a replacement for their browser bookmarks manager that acts more like a file manager. It's not a problem that I've heard anyone ever complain about, and it's certainly not why I was interested in floccus. Most people have 100,000s of files on their filesystem and trees up to 10 levels deep, but only several hundred or thousand bookmarks if that, with shallower trees.

I'm curious how often you personally use this folder-specific search functionality, vs wanting to just search across all bookmarks like in a normal browser.

heapifyman commented 1 year ago

I share @infinity0's opinion. AFAIU, when using floccus on a mobile device you cannot have your bookmarks in your mobile browser anymore due to lack of extension support or missing extension APIs.

Thus, floccus becomes your bookmarks manager, replacing your mobile browser's bookmarks manager.

That is why I expected floccus (search) to work the same way as the bookmarks manager.

Would it be possible to make this configurable? It could be a simple checkbox (toggle) "Always search from root folder" or similar.

As far as the actual search is concerned, it would mean changing a single line of code, if I understand correctly. This:

items = this.search(this.searchQuery.toLowerCase().trim(), this.currentFolder)

Would have to be changed into something like this (pseudo code):

items = this.search(this.searchQuery.toLowerCase().trim(), globalSearchEnabled ? this.rootFolder : this.currentFolder)
marcelklehr commented 1 year ago

It's correct that this would mean changing a single line of code.

Let me please understand your perpspective a bit better. By default the behavior after opening the app is the one you want, AFAIU. You can search through all folders in the account you have selected. In order to get the selective folder filtering to apply, you need to select a subfolder first.

heapifyman commented 1 year ago

By default the behavior after opening the app is the one you want, AFAIU.

Right, after starting the app I am inside the "root" folder. If I do a search while in the root folder the search results include matching bookmarks from all folders. That's fine.

Sometimes I go into a sub folder to open a specific bookmark. This is usually a folder where I have a few bookmarks that I open every day, or a folder where I collect bookmarks for my "read later" to do list. Let's say I am in the "read later" sub folder and now I want to open another bookmark that I open regularly - let's say it is related to a project from work, and therefore located in another sub-folder structure like "work/project-name".

I know it's in that folder so I could navigate up to root and then down into folder "work" and open the bookmark directly. But that takes time. It would be much faster to just type in a few characters and "search" for the bookmark. Unfortunately, the search will not return any results because I am in the "read later" folder, and the folder "work" is in a different branch of the bookmarks tree.

If I weren't using floccus and the bookmarks were still inside the browser, however, I would just type those few characters in the browser's address bar, and the browser would show me a list of bookmarks that match the search term, regardless of where in the bookmarks tree the bookmarks are located.

This is the behaviour I would like to see in floccus, and I think that is what @infinity0 also had in mind.

infinity0 commented 1 year ago

I know it's in that folder so I could navigate up to root and then down into folder "work" and open the bookmark directly. But that takes time.

+1, computers are about saving time, not just in terms of algorithms but in terms of human user time.

marcelklehr commented 1 year ago

Nice, thanks for the explanation! How about we have multiple search results sections? First section is results inside the current folder, second second is results inside the current account, third section is results in all other accounts?

infinity0 commented 1 year ago

That sounds good to me yeah. Ideally the separator between the sections wouldn't take up too much screen space.

heapifyman commented 1 year ago

👍🏽 That would work for me.