Open
Conversation
If the number of labels is larger than the alphabet size, then we need to widen the labels to more than just one character wide. We take care to make sure that when we add two-character labels, we remove the associated single-character label. For example, if we add the two-character labels "ja" and "jb" and "jc" we make sure to first remove the single-character label "j". If we don't remove "j" then the user will never be able to actually select the object with label "j" because the hint engine will still be trying to match against "ja" or "jb" etc. This applies to three-character labels and so on as well.
Reverse the order of hint labels so that the "simpler" ones (shorter labels and labels that use characters earlier in the alphabet) come first. This is done because the user is probably more likely to want to select the hint label that is lower on the screen.
Owner
|
man this was such good pr i apologise, sorry for late reply. I will review it if is still interest @edralston |
Author
|
Yes I believe this is still valid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a hint pattern results in the number of hint labels exceeding the size of the alphabet, then some of the labels will need to be two characters instead of just one character. Sometimes this results in a mixture of single-character and two-character hint labels. However, as currently implemented, there is a chance for some of the two-character hint labels starting with the same character as a single-character label. For example, the set of hint labels might contain "j" and "ja" and "jb" and "jc" but in this case, it would be impossible to select the object associated with hint label "j" since the hint engine will still be attempting to match against "ja" or "jb" etc.
This commit resolves this issue by removing the shorter label ("j" in the example above) before adding the longer labels ("ja" and "jb" etc.).