PhonologicalCorpusTools / SLPAA

5 stars 0 forks source link

implement more efficient/intuitive shortcut for movement (or location) selection in movement (or location) dialog #344

Open kvesik opened 1 week ago

kvesik commented 1 week ago

If you type in a search term in the movement (or location) selector dialog, and then from the dropdown list choose the path you want by either (a) using arrow keys and "enter" or (b) clicking with the mouse, your choice is selected in the combobox but not yet populated in the list of selected paths in the right-hand panel. image

Then the user has to additionally prese the rightarrow key in order to confirm the selected path and add it to the right-hand list. image

But! I think instead, this should be done either (a) automatically when the path is selected, or (b) using a more intuitive keyboard shortcut (enter, for example?).

I think (a) is the more intuitive option here, and (b) was definitely feeling tricky when I first tried poking at it ages ago (see Note 1 below). So... let's see if we can make (a) happen? :)

Note 1: When I first tried setting enter as the confirmation key, I was having difficulty intercepting 'enter' signals from the keyboard and responding in a custom manner, before/instead of passing it upward to be dealt with by the system.

Note 2: This issue is a revamped version of #32 , which was created long enough ago that much of the discussion is now irrelevant/confusing.

kvesik commented 1 week ago

Good place to start: check out the TreeSearchComboBox class, used in LocationOptionsSelectionPanel and in MovementSpecificationPanel.

kchall commented 1 week ago

Thanks, @kvesik ! The only thing I don't think will work about (a) is that it's not always clear what 'selected' means. E.g. if the user types 'distal' into the search box in a movement module, there are multiple options listed:

image

...and then it's intuitive to use the down arrows to get to the right element on the list. So as you go, each one is highlighted in turn, but that shouldn't count as 'selection,' right? It is the case that pressing enter will uniquely put the currently highlighted option into the search bar, so if that's what is meant by 'selection,' then that's fine / great (but it's somewhat unclear then how that's different from getting the 'enter' key to work). :)

kvesik commented 1 week ago

Thanks, Kathleen! You're right-- by 'selection' all I meant is that we have a valid string in the search bar (whether chosen by up/down arrow and enter, or by mouse click). But then the user has to additionally press the right arrow key in order to get that selection into the selected paths list. I'd like those two events to be tied together (ie, if you press enter or mouse-click on an option in the combobox, it also gets added to the selected paths list).

FYI for whoever works on this: I don't think it should actually be too hard to do-- we just need to make a shortcut from the combobox's currentIndexChanged signal, to the code that's currently only access via right-arrow key press. It wasn't originally done because there was some other (now defunct) behaviour also attached to the right arrow key.