Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"/" for subfolders should work for substring, not just prefix... #135

Closed
fredstluka opened this issue Apr 6, 2021 · 12 comments
Closed

"/" for subfolders should work for substring, not just prefix... #135

fredstluka opened this issue Apr 6, 2021 · 12 comments
Assignees

Comments

@fredstluka
Copy link

When I use Shift-M, Shift-T or Shift-J to go to a subfolder of a specified folder, I should be allowed to use a substring, not just a prefix.

I hit Shift-M, Shift-T or Shift-J to see a textbox.
I type "snipp/".
I hope to see the subfolder of my "01_Snippets" folder.
But it says: "No matching parent folders!"
Instead I have to type "01_snipp"

It would be nice to be able to type the substring "snipp" instead of the prefix "01_snipp".

Thanks!
--Fred

@RealRaven2000
Copy link
Owner

I did that deliberately because you can end up with a load of (or even some) confusing suggestions otherwise, so it's actually easier for most users - it makes sense to use this for the child / target folder. But I understand that you chose numeric prefixes and then it's obviously not so great in that case. I think the nicest thing would be to ignore anything NN_ and treat the string afterwards as the start of the string...

@fredstluka
Copy link
Author

fredstluka commented Apr 12, 2021 via email

@RealRaven2000
Copy link
Owner

Axel, Yeah, ignoring NN_ would solve my problem.  Good idea! Or even match on the prefix of any the segments of the name that are separated by underscores.  So, "abc" would match any of: - abcde - abcde_foo_bar - foo_abcd_bar - foo_bar_abc

yes - I like that idea the most, I think this would also technically be the "easiest" to implement (not super trivial, but doable). I think it should do both space and "_".

Do you think it should also work with "-" (dash) for things like composite names such as "Armin Mueller-Stahl"? So it would be found by entering "actors/st". The main reason I narrow down the results is that using the format "start of parent/start of child folder" is very intuitive and avoids too many false positives

@fredstluka
Copy link
Author

fredstluka commented Apr 12, 2021 via email

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Apr 12, 2021

Just testing. I made a subfolder Add-ons/01_xyz-test and searched for ad/xy:

image

..and it actually comes up! Relevant code is here in QickFolders.Interfaace.addMatchingFolder(..)

if (searchString.length<=2 && matchPos!=0) { // doesn't start with single/two letters?
  // is it the start of a new word? e.g. searching 'F' should match "x-fred" "x fred" "x.fred" "x,fred" ":fred" "(fred" "@fred"
  if (" .-,_:@([".indexOf(folderNameSearched.substr(matchPos-1,1))<0)
    continue;  // skip if not starting with single letter
}

So (at least for the search folderParent/someText it should already work. I am actually allowing the delimiters . , - _ : and @. So what's different in your case? Are you entering the first 2 letters of the parent folder?

Explanation: The part

" .-,_:@([".indexOf(folderNameSearched.substr(matchPos-1,1)

makes sure the search term is following one of these characters at position 1.

@RealRaven2000
Copy link
Owner

Reread the original bug description. I think you want the same match algorithm for all parent folders. That's currently not supported - so I need to roll out the same matching method to the parents. Hope it's not going to completely slow down the search with this additional complexity...

@RealRaven2000
Copy link
Owner

I wrote some test code, but it turns out not very useful - too many results that I don't want to see:

image

This is especially jarring for folders that are based on domain names using . as delimiters such as sumofus.org. Any comments how I could improve this? I am using a regular expression for the matching, so I don't really want to make the list of accepted delimiters a user-configurable list / parameter. The only thing I can think of is to take "." out of the equation. Test version for Thunderbird 68 (my current production version with 300+ folders so best for testing search performance in a real world enivronment) below:

QuickFolders-wx-4.21pre19.zip

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Apr 12, 2021

If I take out matching the delimiters - and . for parent folders then I get more useful results (and it covers your case). Some search examples:

image

image

I particularly like the fact that I was using _ to prepend to some folder names to force them showing up on top, and now they are included.

Test version (Tb68)
QuickFolders-wx-4.21pre20.zip

@RealRaven2000
Copy link
Owner

Test version for Thunderbird 78 and later:

QuickFolders-wx-5.5pre2.zip

@RealRaven2000
Copy link
Owner

@fredstluka did you get a chance to test the above version?

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@RealRaven2000
Copy link
Owner

Implemented in in 5.5 published today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants