quickmove-extension icon indicating copy to clipboard operation
quickmove-extension copied to clipboard

Show subfolders when including a slash in the search string

Open quazgar opened this issue 2 years ago • 15 comments

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?

  • foo/ shows foo/bar and foo/baz in the popup.
  • fo/z expands to foo/baz

quazgar avatar Apr 12 '23 08:04 quazgar

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

kewisch avatar Aug 19 '23 19:08 kewisch

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).

benoiton avatar Aug 20 '23 17:08 benoiton

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.

kewisch avatar Aug 21 '23 19:08 kewisch

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."

quazgar avatar Aug 22 '23 10:08 quazgar

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.

kewisch avatar Aug 24 '23 20:08 kewisch

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

benoiton avatar Aug 25 '23 14:08 benoiton

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

RealRaven2000 avatar Aug 25 '23 20:08 RealRaven2000

@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

kewisch avatar Aug 25 '23 21:08 kewisch

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 avatar Aug 27 '23 06:08 benoiton

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.

benoiton avatar Sep 03 '23 16:09 benoiton

Did you get any error console messages?

kewisch avatar Sep 04 '23 07:09 kewisch

image

benoiton avatar Sep 04 '23 07:09 benoiton

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

  • "foo" would match all folders with the string in their path, including "foo / bar", "bar / foo", and "foo / uhm / bar"
  • "foo bar" would filter this down to "foo / bar" and "foo / uhm / bar"

Account matching

  • "loc foo" would match "Local folders → foo" and "dreadnaut → locomotives / foo"
  • "all" would match "dreadnaut → All Mail" and "other → All Mail", while...
  • "dre all" would narrow the results down to "dreadnaut → All Mail"

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

fran-f avatar Sep 18 '23 16:09 fran-f

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.

kewisch avatar Oct 07 '23 20:10 kewisch

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!

olivergrahl avatar Apr 16 '24 13:04 olivergrahl

There is a new option added since #169 to allow partial matches, thanks to @micz . I know this doesn't have full control, but maybe it is sufficient for your needs? @quazgar @benoiton would appreciate if you could give it a try.

quick_folder_move-3.1.0pre.zip

kewisch avatar Jan 18 '25 21:01 kewisch

I installed the 3.1.0pre version some days ago, with the entire path match option, it works perfectly for me. I need to change some habits, but it's covers 100% of my needs. 👍

benoiton avatar Jan 26 '25 15:01 benoiton

There is a new option added since #169 to allow partial matches, thanks to @micz . I know this doesn't have full control, but maybe it is sufficient for your needs? @quazgar @benoiton would appreciate if you could give it a try.

I tried out this version and it's a great addon as always, but it does not show any incremental hints to guide the user.

While you are working on the query logic, would it be possible to search the account name as well? Whenever I want to move a mail to the inbox of a specific account, I enter "Inbox", but then I have to choose from a dozen of inboxes of my different accounts.

quazgar avatar Jan 30 '25 11:01 quazgar

@quazgar I think that the account filtering could be done with #167.

micz avatar Jan 30 '25 21:01 micz

I'm going to close this issue in favor of the partial match and account filtering options, I think that should cover 80% of use cases and keeps the query simple. Thank you though for bringing this up and discussing options!

kewisch avatar Feb 08 '25 21:02 kewisch