openstenoproject/plover

Add stroke validation feedback

Opened this issue · 2 comments

When you try to search by stroke, add a new stroke, or change an existing stroke in the dictionary it will not accept input that is either 1) a nonexistent key 2) out of steno order or 3) lowercase. Nothing happens when you try to enter invalid input, and it's not immediately apparent why nothing happens.

I think there should be some notification that the input was invalid. Maybe an error sound, or perhaps allow the input to be entered but then have some sort of highlighting to show the invalid part (and disallow entry into the dictionary until it is corrected).

This also is relevant to existing invalid entries that were added to a dictionary before stroke validation was implemented, added by another application, or added manually into the file. Invalid strokes will appear at the top of the dictionary list and they will have a warning triangle next to them, but there's no feedback about what the problem is. I first expected to get information by mouseover of the warning symbol, but there's none. Highlighting would also be helpful here.

The current code isn't smart enough to determine exactly which part is invalid, it can only determine if a stroke is valid or not I think.

Side note, if the stroke is entered in add translation window with the steno keyboard itself (which is the most common case I think) you'll not encounter this issue (obviously all strokes will be valid)

You could check the first char, then, if still good, try the stroke that also has the second one, then fold in the third. The position at which it fails is the one that has the error. Start from nothing, add one char at a time until you either have the whole thing come out good or a stroke fails.