lusakasa / saka

Elegant tab, bookmark and history search
MIT License
216 stars 20 forks source link

Hit-a-Hint has duplicate hints when too many links are present #110

Open mtalexan opened 3 years ago

mtalexan commented 3 years ago

Using the Hit-a-Hint logic on pages like Outlook.com when there are many emails in the folder being viewed demonstrates the problem well. The sequence for HaH assignment appears to be a fixed ordered set of characters where single characters are assigned, then double characters that go thru the combinations starting with all variants of the first character being the first character from the fixed set. However it appears to be limited to only double character hints that start with A and S (the first two characters in the fixed set) and then incorrectly starts over with single character hints.

Step-by-step:

  1. Go to a website with hundreds of links in a list, many of which are scrolled off-screen (e.g. Outlook.com Inbox)
  2. Press the shortcut key to activate Hit-a-hint

Expected behavior: No duplicate Hints exist. Pressing any of the hints selects the associated link

Actual behavior: Duplicate single-character hints exist. Selecting one of them hides all others leaving just the two identical ones. Selecting the single character has no effect and doesn't terminate the hinting or select either link.

When first triggering the Hit-a-Hint HitAHint-Duplicate After selecting one of the duplicated single-character hints. HitAHint-DuplicateAfterSelection

Probability: 100% reproducible. My email website is one I use all day every day, and always exhibits this problem. It seems that the way my email page presents makes the problem particularly difficult because the handful of the newest emails are always the first few single character hints and therefore always duplicated and unreachable with hints.

At a guess, it would seem that the hint generation is probably being done using a predefined fixed list rather than a combinatorial generation function, and that fixed list wasn't populated after getting thru all the double letters starting with A and S. Some support seems to have been added for the hint list looping to reuse some of the hints, but only for the hint assignment and not for the hint interaction.