kewisch / quickmove-extension

Quick Folder Move Add-on for Thunderbird
85 stars 26 forks source link

Show subfolders when including a slash in the search string #84

Open quazgar opened 1 year ago

quazgar commented 1 year ago

Enhancement proposal

Let's assume this folder hierarchy:

- foo
  - bar
  - baz

When showing the target folders, there should be a hint for existing subfolders. In this example, I may remember the name foo, but not the name of its subfolders. It would be great if subfolders could be hinted once I enter foo.

Ideas

How could this be implemented UI-wise?

kewisch commented 1 year ago

There is an option to show full folder paths, I think the hierarchy would overload things. Let's stick with that.

benoiton commented 1 year ago

Showing full path is not efficient for all use cases.

UC1: I do not remember the folder name, but I do know its parent folder name.

UC2: I have a lot of folders with the same name. For instance I have a folder for each project (dozens of projects), and each project folder has standard subfolder hierarchy ("sales", "delivery", "internal", ...). I'd like to type the project name to find its "delivery" subfolder, instead of type "delivery" and having to choose among dozens of lines (with full path).

kewisch commented 1 year ago

Ah I see, I jumped to conclusions before. Would fo/z expand only foo/baz or also foo/bar/baz ? The slash syntax might not be very obvious, though I guess with some documentation works out and is a nice feat for power users.

quazgar commented 1 year ago

Ah I see, I jumped to conclusions before. Would fo/z expand only foo/baz or also foo/bar/baz ?

I would expect the latter, but do not have strong opinions yet. The general rule could be "A slash separates path components. For each component the same expansion holds as for simple text strings."

kewisch commented 1 year ago

I took a quick stab at this, I think a good solution would require some more major refactoring. I only have the current folder for matching search, which makes figuring out things about parent or child folders more difficult.

I have a somewhat working solution, but having some issues displaying the outcome in a sensible way.

Let's say you have folders like this

-bar
--bar2
---baz
-foo
--foo2
---foo3
----baz
-----quux

Then the search results for "baz/" would be

---baz
----baz
-----quux

Which would make it look like direct subfolders. Adding a visual cue like a line might help a bit, though I'm not sure it wouldn't make things more cluttered. If you have ideas on how to best display I'm open for them.

benoiton commented 1 year ago

In 2.0.1, searches for "baz" folders would be shown this way:

baz    bar -> bar2
baz    foo -> foo2 -> foo3

Searching for "baz/" should show only children of any baz folder

quux    foo -> foo2 -> foo3 -> baz

More complex hierarchy:

-bar
--bar2
---baz
----yop1
-foo
--foo2
---foo3
----baz
-----quux
-----yop2
-----baz
------yop3

Searching for "baz/" could result:

yop1    bar -> bar2 -> baz
quux    foo -> foo2 -> foo3 -> baz
yop2    foo -> foo2 -> foo3 -> baz
baz    foo -> foo2 -> foo3 -> baz
yop3    foo -> foo2 -> foo3 -> baz -> baz
RealRaven2000 commented 1 year ago

Hmm, I thought you already had this feature? One could use / for direct parent folders and > for skipping all folders and finding matching subfolders (matching word starts). Example:

image

kewisch commented 1 year ago

@benoiton Ah ok, that would be an option. I was thinking more complicated, e.g. in the results show the parent folder, and then indented show all the child folders. Does this version have the behavior you expect? (I did take one shortcut, it searches within the path component names and not the folder names. Might fix that later on)

quick_folder_move-2.5.0.zip

@RealRaven2000 I don't want to add a complicated syntax. While it does give power users more flexibility, I'd rather aim for simplicity here. A slash is already at the edge of my comfort zone :D

benoiton commented 1 year ago

It would make it possible to find folders from their parent name. I will try new version, but I'm away from my keyboard for the week. Sorry.

benoiton commented 1 year ago

I've downloaded and installed v2.5.0, but it doesn't work. When I press "Quick Move" button or press the shortcut, the modal with 3 buttons "Move, Copy, Tag" appears, but with no lists, and hitting some letter triggers default TB shortcuts. I tried to uninstall, restart TB and reinstall: same behavior. Reinstalling v2.0.1 restore correct behavior.

kewisch commented 1 year ago

Did you get any error console messages?

benoiton commented 1 year ago

image

fran-f commented 12 months ago

Using / as a level separator feels quite specific, I wonder if a custom syntax for this could be a development cul-de-sac. Tools that implement some kind of fuzzy matching tend to be more immediate and easy to learn than, compared to custom operators.

I wonder if there is a larger refactor, or a "fuzzy matching" option, that could cover this and a number of others cases. For example, if QFM were to convert each space in the query in a .* or .*/.* piece of regular expression, and match against the full path of a folder (account included), this could bring both:

Subfolder matching

Account matching

Results can be sorted by length (shortest first), or by another heuristic for "specificity" (e.g., submatch length).

kewisch commented 11 months ago

I really don't want to make it too complicated. The latest version in #88 allows for some word-based matching. I could imagine having some fuzzy matching that would help with typos. But the more I think about it the less I think we should do magic with slashes.

I'm going to leave this open for a while in case someone wants to contribute a really sound-but-simple solution, but I don't think I'll be working on this one myself.

olivergrahl commented 5 months ago

I used to use the long discontinued Quicker Filer addon, which I had manually tweaked to work with later TB versions. Finally switched to QuickFolderMove now (so glad I found it--thank you so much for your work!). But then I found out that I cannot enter complex folder paths as before. I have a structure like this:

Product1
 + Foo
 + Bar
Product2
 + Foo
 + Bar

and a dozen times every day I used to file emails by just pressing the Move shortcut, entering "1/F", hitting ENTER. Or "2/B", ENTER.

Without the ability to match a complex folder path like this, my productivity is now kind of broken. :-(

Please reconsider supporting the use of "/" to match folder paths. Thank you!