-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard shortcut registry #90515
Comments
Pinging @elastic/kibana-design (Team:Kibana-Design) |
Pinging @elastic/kibana-core (Team:Core) |
I don't foresee any major technical issue registering global or per-app shortcuts. The tricky part here will be to find the correct API to let plugins register per-page shortcuts, as an application 'page' is a concept unknown from core. The plugins will probably have to manually refresh/update the shortcuts when the user transition from a page to another |
All our page transitions go through a single function, don't they? Could core use that transition as a signal to update the active shortcuts on a page? Then shortcuts could hopefully be global, tied to an app, or tied to a URL. But another difficulty would be what happens with certain EUI components registering shortcuts? Especially on pages like Dashboard where a lot of stuff is user driven, we'd need a way to register a shortcut from a rendered component, not from something like the plugin registry. |
No, they don't necessarily go through We could eventually listen to the history from core and try to 'deduce' the page from here, but that could be harder than it sounds, for multiple reasons. Also, I doubt that, in term of developer experience, registering everything during a plugin's startup would be the easiest approach. Most shortcuts are usually bounds to page-local handlers, meaning that registering everything for all their pages in advance would result in a way harder implementation for the consumers. I really think 'per-page' shortcut could be dynamically added by the pages components. e.g const MyPage: FC = ({ params }: { params: AppMountParameters }) => {
useEffect(() => {
const unregister = params.shortcuts.register(myShortcuts);
return () => unregister();
}, [])
} The example is exposing the local shortcut registry on This also has the upside that the shortcuts are not bound to the concept of 'pages', but of components instead. Nested routes could have multiple nested components adding potential shortcuts depending on the state of the app. One downside is that we will not be able to detect shortcut conflicts during core's setup/start phase, and only when a potentially conflicting app is mounted. |
I think that's a reasonable downside at least until it becomes a problem which could still be a long way away unless people start adding these all over very suddenly. |
Pinging @elastic/appex-sharedux (Team:SharedUX) |
cc @1Copenut |
Summary
Several teams have implemented their own keyboard shortcuts for various bits of UI throughout Kibana. This, on top of the keyboard shortcuts that EUI ships, are bound to start conflicting at some point.
Managing discovery of keyboard shortcuts also poses a challenge that no one has yet undertaken nor have the accessibility issues of shipping arbitrary keyboard shortcuts been tackled.
Goal
Provide a way for Kibana teams and EUI components to register their keyboard shortcuts to improve discoverability and allow for a central management of them from both a developer and a user perspective.
Do people want this?
Not including issues of people complaining about our tab order not being what they want or expect (which strong keyboard shortcuts could help mitigate):
Functionality & features
MVP
Phase 2
Future work
Accessibility notes
accesskey
— unfortunately, it largely doesn’t do anything and is buggy in places where it should do something so it’s best to avoid it entirelyaria-keyshortcuts
. The largest difficulty here will be updating these values when customized by usersNot addressed
Examples
Gmail has an extensive keyboard shortcut page that’s always available
a. And allows for individually configuring each option, giving an alternative, and resetting all of it back to defaults
Google Calendar has a more modern design of Gmail’s implementation (but the only control is a on/off toggle). Twitter, Feedly, Google Keep, Trello — all have similar designs and implementations.
GitHub shows you the keyboard settings available on the page you’re on and links out to all keyboard settings (and has no controls for them)
The text was updated successfully, but these errors were encountered: