TAB key string prioritization

The tab key, possibly the single most used feature of a professional, has quite often been the bane of getting things done efficiently in Natron. Yes it is 1000 times better than weeding through a menu list; however, it’s sorting system is among the worst I’ve ever used. Currently it sorts by looking for anything that contains all the letters in the order they were typed at any point in the node name, but does not give priority to the typed string as a whole unit. Thus when typing something like, “add” where one would expect the first result to be the Add node instead gets Card3D, or “premul” to get the Premult node instead gets the Unpremult node first. Thus when attempting to move swiftly this acts as a counter intuitive hurdle that constantly slows down speed and efficiency.

My suggestion is to make the search results so that they display using these prioritization conditions from the following example:

If we had a list of hypothetical nodes named (ignore that some would likely be considered broken): Add, Card3D, AddSubtract, MyCard3D, InvertAdd, BadDad, BADDad, MyCard3DVersion2, AADDad, UltraBadDad, Bard2D , TrueCard3D, UltraBadDAd, Bard3D, Lard2D, Add2, Add3, add4, FaDDad, Addadd, Hard2d, Blur

and the user typed: add

The return results should sort as follows:
Add - Why: string ! chars 1, 1st position 0, difference 0, case error 1, lexical 1
add4 - Why: string ! chars 1, 1st position 0, difference 1, case error 0, lexical 1
Add2 - Why: string ! chars 1, 1st position 0, difference 1, case error 1, lexical 1
Add3 - Why: string ! chars 1, 1st position 0, difference 1, case error 1, lexical 2
Addadd - Why: string ! chars 1, 1st position 0, difference 3, case error 1, lexical 1
AddSubtract - Why: string ! chars 1, 1st position 0, difference 8, case error 1, lexical 1
Baddad - Why: string ! chars 1, 1st position 1, difference 3, case error 0, lexical 1
AADDad - Why: string ! chars 1, 1st position 1, difference 3, case error 1, lexical 1
BadDad - Why: string ! chars 1, 1st position 1, difference 3, case error 1, lexical 2
FaDDad - Why: string ! chars 1, 1st position 1, difference 3, case error 1, lexical 3
InvertAdd - Why: string ! chars 1, 1st position 6, difference 6, case error 1, lexical 1
UltraBadDAd - Why: string ! chars 1, 1st position 6, difference 8, case error 1, lexical 1
UltraBadDad - Why: string ! chars 1, 1st position 6, difference 8, case error 1, lexical 2
Hard2d - Why: string ! chars 0, 1st position 1, difference 3, case error 0, lexical 1
Bard2D - Why: string ! chars 0, 1st position 1, difference 3, case error 1, lexical 1
Bard3D - Why: string ! chars 0, 1st position 1, difference 3, case error 1, lexical 2
Card3D - Why: string ! chars 0, 1st position 1, difference 3, case error 1, lexical 3
Lard2D - Why: string ! chars 0, 1st position 1, difference 3, case error 1, lexical 4
Card3DVersion2 - string ! chars 0, 1st position 1, difference 11, case error 1, lexical 1
MyCard3D - Why: string ! chars 0, 1st position 3, difference 5, case error 1, lexical 1
TrueCard3D - Why: string ! chars 0, 1st position 5, difference 7, case error 1, lexical 1

where the priorities in order are:
string ! chars - was the whole string or individual characters found
1st position - is the position of the first instance of the fist character of the string or char sequence
difference - is the difference between characters typed and the full node name
case error - is the string found a case perfect match (if the lengths are identical then case matters)
lexical - if everything is identical sort it alphabetically

2 Likes

This is also one of the biggest pain points that I’ve encountered with Natron and I’m glad to see a thoughtful suggestion on the matter! +1.

1 Like

You should also note that the tab key memorises the frequency of your selection, so you only have to make the correct choice once, and then it comes first in the list. Whichever nodes you use most will come first. You probably didn’t notice that feature.

This is inspired by the same feature in Nuke, which had a lot of success and support: https://github.com/dbr/tabtabtab-nuke

There’s absolutely no chance that we remove this, but if you want to submit code that optionally (via a preference) disables it, we’ll gladly take it into account!

That’s not the only way it works though right? I’ve always noticed the tab search functionality hasn’t felt as accurate as Nuke’s. Maybe it’s weighted too high?

This feature is not by default in Nuke, it’s a popular addon that you must install from the website I pointed to.
The default tab behavior is to type all letters from the first to the last.
In Natron and with the Nuke tabtabtab extension you just have to type a few unique letters in the right order.
So for example, by default, to get “DegrainSimple” you would have to type “degrains” in stock Nuke (at least until 11.1), but with tabtabtab you just type “dgs”. Same in Natron.
You’ll quickly learn the key combinations that work best, and Natron will learn the most frequent ones.

Note that recent Nuke versions have a similar feature builtin: https://learn.foundry.com/nuke/content/release_notes/nuke_11.2.html

You should try: “ad”, “c3”, “ast”, “mc3”, etc. That’s much faster!

If Tabtabtab is built into Natron by default how do we clear it’s cache, because I attempted to use the add node 15 times and it always pulls up card3d first, and while I use both I expect card to pull up card3d and add to pull up the add node. When Add pulls up card3d no matter how many times I type add, then I consider the function broken.