Open maxpatiiuk opened 2 years ago
@CarolineDenis This one might be interesting for you
I have the code for the keyboard picker component already written so can push it if you want to work on it
The remaining thing would be to create a hook like useKey('category', 'subcategory', 'item', callback)
where 'category', 'subcategory', 'item'
matches what you see in user prefs, and the callback is a function that will be called by the hook when the user presses the keyboard shortcut.
Edge cases to handle:
If user assigned a shortcut like B
(without Ctrl/alt/or other modified), than you have to make sure to only trigger the keyboard shortcut if user is not currently typing into a text field
- When browsing records in forms view, I miss a keyboard shortcut for moving to the next/previous record.
This would be so nice to have!
Requested By: Eyal at The Hebrew University of Jerusalem
Implementation idea: Split user preferences into 3 ultra-sections: Options (everything that is not in the next two) Theme (for setting UI colors - and add ability to customize more colors) Keyboard Shortcuts
I don't think this is the best solution anymore. Better implementation:
yes 100x to @maxpatiiuk 🎉
Did a bit of research on this.
Complications:
Cmd+Shift+Q
(i.e for opening query builder), presents several internationalization challenges:
Q
being pressed, then the key shortcut is not going to work if you have a non-English keyboard layout - meaning our default keyboard shortcuts would only work on English keyboards (unless we settle for only using keyboard shortcuts that don't include letters in them - like Cmd+Shift+ArrowUp and etc)key q
on US keyboards, then the shortcut would work on all keyboard layouts, but may no longer correspond to what is printed as letter Q
on their keyboard (i.e French keyboards). So if our UI shows press letter Q
, they will have to find a key labeled Q
on their keyboard, even if they keyboard layout has no such letter.Ctrl+Q
keyboard shortcut in the UI, and expects users to know where that isCtrl+O
may be ambiguous. Let's say Specify is listening for press of the key that has O
on it in US English layout. In a Cyrillic layout, there is a Cyrillic letter O
, which is in place where English J
is located, and so pressing this won't trigger the Ctrl+O
shortcut (but will trigger Ctrl+J
if there is such)
q
(which might not even be in their alphabet), thus making this shortcut harder to remember than it is for English users (partially mitigated by the fact that we will let people re-assign the shortcuts)Going to do a bit of reverse-engineering of Gmail's and Asana's source code to see how they handled these things. Will also look at what Google Sheets and Google Docs are doing since there they have a lot of text entry happening, thus complicating single-letter keyboard shortcuts
For now, I am thinking that:
D
or Q
. For example M
in the workbench to open the data mapper and etc. Only activate these if not actively typing in text.F5
and Ctrl+R
for page refresh, we could allow multiple keyboard shortcuts for an action as that does not complicate the implementation much.Observations:
Tab + letter key
for many keyboard shortcuts (alongside single-letter shortcuts and Cmd+letter). I am afraid of using that Tab key as it's essential for a11y, and so any code we write would have to be tested in many scenarios and systems - something Asana can do, but we don't have the resources to doAlt
in the UI even on mac (though they do correctly use Cmd
)Cmd+/
opens the keyboard shortcuts list. But in Gmail, it is ?
insteadStarted work on this on a branch: https://github.com/specify/specify7/pull/5097
Not completed yet, but if someone is interested, it's good enough now to preview the keyboard setting UI and keyboard shortcuts in action
For now, I only set the shortcuts for going between recordset items and adding a new item - will add several dozen more
My favorite part: the UI displays a hint in the tooltip if a keyboard shortcut is defined for a given action:
@maxpatiiuk, Corinna P has provided us with feedback on existing keyboard shortcuts and a list of tasks that users at CSIRO would like to see keyboard shortcuts for:
Our Herbarium users are doing large amounts of front-end data entry and have provided us with a bit of feedback regarding the current shortcuts that are available to them, which we wanted to pass on for possible integration into the above GH ticket.
For reference, we have been referring them to the section on shortcuts on this page: https://discourse.specifysoftware.org/t/using-forms-in-specify-7/959
- Closing a window should be enabled by using the Esc button. E.g., when you open a sub-form in a new window there should be an option to quickly close it when no editing is required. Currently, you have to tab through all fields to get to the Close button at the bottom of the form.
- Edit mode shortcut 'toggle'. Users have requested a quick way to turn on/off Edit mode. If you want to go from the CO form to the locality form you currently have to click the Edit button three times. A shortcut would minimise the amount of mouse-work required.
- Save is inconsistent. The provided shortcut is Ctrl+Enter; this only works in Firefox. We found through trial and error that Shift+Enter works in Chrome and Edge, however, this only works if you are in a non-expandable field. In a note field, for example, it just creates a new line. Noting that in the old herbarium system a save was achieved via F10.
- Jump between sub-sections in a form. Users would like the ability to jump by section/sub-form. Currently they have to tab through every field to get further get to subsections further down in the form.
Closing a window should be enabled by using the Esc button. E.g., when you open a sub-form in a new window there should be an option to quickly close it when no editing is required. Currently, you have to tab through all fields to get to the Close button at the bottom of the form.
I suppose by window this means a dialog? Esc key works to close modal dialogs (those that darken the screen behind them). It's disabled for non-modal dialogs. I believe it's disabled so as to prevent accidental loss of data if you have begun doing some edits in that dialog. Having Esc key work until you made any change in that dialog would be a nice improvement!
Edit mode shortcut 'toggle'. Users have requested a quick way to turn on/off Edit mode. If you want to go from the CO form to the locality form you currently have to click the Edit button three times. A shortcut would minimise the amount of mouse-work required.
Hmm, a bit of clarification on this one would be nice.
to turn on/off Edit mode
A shortcut for toggling the app-wide toggle readonly mode?
If you want to go from the CO form to the locality form you currently have to click the Edit button three times
Or do you mean the small edit button in the query combo box? We could have a shortcut that would "click" on the edit button in the query combo box, but that shortcut would only work if the query combo box is focused - otherwise there could be several query combo boxes on the page, so it wouldn't be clear to specify which one the user means to open.
Or did you mean quickly switching between creating a new Collection Object and creating a new Location? The v1 implementation of keyboard shortcuts will include ability to bind a custom keyboard shortcut for any specify URL, letting you bind a keyboard shortcut for opening the form for creating a new "Locality" for example. Does that work for you, or did I misunderstand the request?
Save is inconsistent. The provided shortcut is Ctrl+Enter; this only works in Firefox. We found through trial and error that Shift+Enter works in Chrome and Edge, however, this only works if you are in a non-expandable field. In a note field, for example, it just creates a new line. Noting that in the old herbarium system a save was achieved via F10.
This is controlled by the browser. The specify form is rendered as a native HTML form and the save button is the submit button - thus whatever is the keyboard shortcut in that browser for submitting the form, that is the behavior Specify uses. We could definitely though let people bind a custom shortcut for saving the form so as to circumvent the differences between browsers.
Jump between sub-sections in a form. Users would like the ability to jump by section/sub-form. Currently they have to tab through every field to get further get to subsections further down in the form
Ah, that's a great idea. What I have already implemented on a branch is a keyboard shortcut for going to first/previous/next/last record. Having a shortcut for moving focus one form section up/down would be a nice feature to have!
Hi @maxpatiiuk . Trying to add some clarifications for you 😊
Windows – I assume window and dialog box are referring to the same thing. What I was referring to was the new window/dialog box that pops up when I open a subform via a button or QCBX. For example, all our collections have shared CEs so we are using the QCBX. When I open the event it shows up as a new window. This can’t be closed other than with the ‘Close’ button at the end of the form.
Edit mode toggle – yes, this is in reference to the app-wide edit mode. We have turned RO-mode by default on for most of our instances now. It would be useful to have a short-cut that lets users toggle quickly between the RO/Edit mode rather than needing to click on the ‘Edit’ button repeatedly. The example provided was just highlighting how much clicking is involved. If you start in the CO, you need to click ‘Edit’ to be able to edit the record. From there, you open the CE, which is in RO-mode when it opens, so need to click ‘Edit’ again. Then you go to Locality, which again opens in RO-mode, so again need to click on ‘Edit’ to be able to modify the record.
Does this help?
Like this:
Particular menu itemedit: decided not to do this in favor of allowing setting keyboard shortcuts for a URL as that would be more genericTo meet the WCAG 2.1 requirements, these shortcuts must be customizable
Implementation idea: Split user preferences into 3 ultra-sections: Options (everything that is not in the next two) Theme (for setting UI colors - and add ability to customize more colors) Keyboard Shortcuts