Open jpfleury opened 13 years ago
What if the result list is like this:
- folderA/folder1/file1
- folderA/folder1/file2
- folderA/folder2/file1
- folderA/folder2/file2
- folderB/folder1/file1
- folderB/folder1/file2
- folderB/folder2/file1
- folderB/folder2/file2
What should the context menu for the first entry show: "Collapse folderA" or "Collapse folder1"?
I think it would make it very clear if it showed the direct parent, so Collapse "folder1" (or Collapse "folderA/folder1" if relative path is displayed).
Hm... collapsing the direct parent would be good to get consistent and reliable behavior. However, how about a case like this, which is not uncommon:
- file-search/ui.py
- file-search/searcher.py
- file-search/locale/de/LC_MESSAGES/file-search.po
- file-search/locale/fr/LC_MESSAGES/file-search.po
- file-search/locale/ru/LC_MESSAGES/file-search.po
- testbranch/abc
- testbranch/bar
- testbranch/foo
It would be useful to hide all .po files, and to collapse the entire "locale" directory, but that would not be possible if the context menu only offers "Collapse LC_MESSAGES". It might be possible to automatically detect that "locale" is the common ancestor of all three .po files, and offer "Collapse locale" in context menu; but that would be an unpredictable behavior which might be irritating during use.
A completely different way would be to arrange all results in the list in a tree structure, similar to their location in the file system (I think Kdevelop 4 does that); but that might create lots of useless directory entries even for normal uses.
Yet another solution might be to detect which part of the path the user has clicked on when opening the context menu, and offer to collapse that directory part. I guess that would be difficult to implement, and might not be obvious to the user.
Well I'm really not sure yet what to do :-)
What about adding all parents in the context menu? Example:
Copy
----
Expand All
Collapse All
----
Collapse "file-search/locale/de/LC_MESSAGES"
Collapse "file-search/locale/de"
Collapse "file-search/locale"
Collapse "file-search"
Or maybe add x parents, for example 3 parents: direct parent, grandparent and great-grand-parent.
After searching, we can realize that all matches in a specific subfolder are not relevant for us. It would be very useful to have an option in the "right click menu" to collapse all these results. Example:
Say results are:
A lot of matches are in "folder4". If they are irrelevant for us, we could click right on any result of this subfolder and have the following choices:
Written in a more generic form, the new option would be Collapse all matches in "%(folder of the clicked match)s".