-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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 documentation for editor in the Wagtail UI #3949
Comments
Note: I haven't thought about how this modal would be launched yet because I'm unclear if we'll have one set of shortcuts (preferable from a UX perspective I think) or different shortcuts within different parts of the UI. |
Just adding some basic research into what other popular web applications do in regards activation of keyboard shortcuts modal (via a keyboard shortcut). It seems that Medium's modal is the only one that can actually be activated within a text box that the user has focus on. Medium
Inbox by Google, Google Drive, Gmail
Trello
Github
|
Here is the list of keyboard shortcuts supported by Draftail, heavily inspired by Google Docs: https://github.com/springload/draftail/tree/master/docs#keyboard-shortcuts. I foresee problems integrating this with the rich text editor because the shortcuts would need to change depending on:
I imagine we could |
It's easier to see how this could work with the improvements done over the last few months:
For rich text shortcuts,
I think we could start with only the "default Wagtail shortcuts" modal, then expand to rich text shortcuts later on. If someone is interested in implementing this with React, I'm more than happy to give plenty of guidance. |
@thibaudcolas More documentation for |
@SalahAdDin there's now a list of all Draftail keyboard shortcuts over at https://www.draftail.org/docs/keyboard-shortcuts (which is referenced in the official Wagtail docs). |
Could we have this on hover? Miro does this nicely. When you hover over an icon it shows you the shortcut. I think we could do a similar thing in Wagtail. When you hover over the Save or Preview buttons we show the shortcut then? This would help with discoverability of these shortcuts too and could be rolled out elsewhere if we brought more in. |
Lovely, thanks @thibaudcolas ! @benenright what do you think? Are you happy with this approach? If so shall I get some designs done that we can pass by you, or maybe you could do the designs? |
This is the way Slack presents keyboard shortcuts. I like it. Slack has some nice details:
Some keyboard shortcuts do not have a visible element:
Wagtail can have those as well. They can only be communicated by a 'cheat sheet' as there is no element to hover. I think a cheat sheet is the best solution because:
I'd like to help and make the cheat sheet happen. Especially the part where integrators and third parties can hook their own shortcuts to the cheat sheet. |
That's great feedback @allcaps. Especially the part about allowing third parties to be able to hook in too. I think a cheat sheet would be useful, but perhaps we could even do both (show some in context where it's useful, but all in the cheat sheet). The more interesting issue for me is the inconsistency with which the existing shortcuts work for save and print. Cmd+P often opens the print dialogue, and Cmd+S tries to save the page. I realise now that this is because of where I'm focusing - if I click on the top of the page near the title and use the shortcuts it is fine. If I am editing a field and then try then it doesn't work. This isn't great, as the majority of the time you'll want to save or preview once you've just made an edit. I think we shouldn't promote these shortcuts until we figure out a way to make this more consistent, otherwise we risk detracting from Wagtail overall (Kano model theory). |
Before I forget, shortcuts may be different per operating system. |
Interesting approach from Facebook, which has the same problem of "shortcuts are different depending on where you are in the app": https://engineering.fb.com/web/facebook-com-accessibility/ |
We discussed having keyboard shortcuts in our accessibility team meeting today. There is definitely interest in having this, first step would probably be to create a cheat sheet panel like in Tom's mockup and some way to register them. There is also the issue that many areas of Wagtail are not currently useable with a keyboard. This is an accessibility issue that we are working on 😅 |
Updated discussion happening in UI chat on slack.
|
Good article on deciding on keyboard shortcuts Also https://www.commandbar.com/blog/selecting-keyboard-shortcuts-for-your-app |
Good reference for common web application keyboard shortcuts https://usethekeyboard.com/ |
See also. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey Note. It's not recommended to use this but it's a good reference for naming things if we did our own data attributes approach. E.g. |
A suggestion came up in our Wagtail+Next.js workshop:
The fact that we don't document the shortcuts (yet people find them anyway) suggests that there's some expectation for this to be useful, so I think this will definitely be a great addition 👍 |
Here are some mockups for how a shortcuts panel could work. Access from the Help menu (help users to learn the command to toggle the panel to negate the need to access it from this menu): Panel:
![]() |
As I know we will want to tackle the keyboard shortcuts stuff better in the coming release or so I have updated the Stimulus adoption issue to be both simpler to use in our DOM and avoids waiting on a Stimulus PR to be merged. The HTML data attributes to use a keyboard shortcut on any button would be something like; Once that issue has a PR and is merged we can look at a way to collate these controlled elements and their keyboard shortcuts into data and present these in a keyboard shortcut modal. This data would need to incorporate the RichText shortcuts but that should not be too complex. Still a while off but I feel there is a path forward. |
We’ve discussed this with @lb- and @laymonage today, just noting we’re keen to proceed with the above designs with hard-coded content if anyone wants to contribute to this but feels daunted by the scope of having to register shortcuts. |
Great, I might raise a new issue that covers this smaller scope with a bit of direction, hopefully with enough detail for a new-ish contributor to work with. |
#11711 has been raised for a very basic initial version of the keyboard shortcuts dialog. I have also updated this issue's description with a bit of an action plan and links to other issues that have already been created. I am happy to help anyone that wants to contribute to this with some direction on what to work on or where to help. |
@benenright - any chance you could add a comment with the keyboard icon svg? |
We may also want to consider some guidelines in our documentation for how to create accessible keyboard shortcuts. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-keyshortcuts Also, the guidelines on that MDN page advise against overriding common browser shortcuts such as We probably should be careful to document keyboard shortcuts that may not be good practice. Thoughts @thibaudcolas ? |
Also adding this comment from @zerolab
It's a nice looking library that also has some great documentation on how to make accessible keyboard shortcuts. |
Include the ability to trigger the dialog from the sidebar Include base styling and unit tests Fixes #wagtail#11711 Relates to larger work for keyboard shortcuts in wagtail#3949
Include the ability to trigger the dialog from the sidebar Include base styling and unit tests Fixes #wagtail#11711 Relates to larger work for keyboard shortcuts in wagtail#3949
#11740 has been merged & #10167 has been closed. The next steps can be started if anyone is keen, specifically adding a new set of keyboard shortcuts for the sidebar, Minimap and the keyboard shortcuts dialog. Post here if you want to pick something up and I can create an issue with some clear steps. |
I'm interested in working on this. Adding shortcuts for the Minimap and keyboard shortcuts dialog sounds interesting. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is your proposal related to a problem?
As part of the ATAG guidelines.
(Guideline A.3.1) (For the authoring tool user interface) Provide keyboard access to authoring features.
We want to work towards a fully compliant, customisable and flexible keyboard shortcut system within Wagtail.
At this time, there are some undocumented keyboard shortcuts, some browser 'default' shortcuts and lots of available shortcuts in Draftail.
These, however, are hard to discover and we would like to improve this.
Describe the solution you'd like
As per the comments below, here are some mockups for how a shortcuts panel could work.
Access from the Help menu (help users to learn the command to toggle the panel to negate the need to access it from this menu):
![image](https://private-user-images.githubusercontent.com/4907819/284565740-f4356a6a-c623-4f9e-ad52-11322e2caa9f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NDYxMjksIm5iZiI6MTcxOTY0NTgyOSwicGF0aCI6Ii80OTA3ODE5LzI4NDU2NTc0MC1mNDM1NmE2YS1jNjIzLTRmOWUtYWQ1Mi0xMTMyMmUyY2FhOWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMDcyMzQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGRkNTQ0ZmRjMjY3ZGIxNGM3ZTJjNWY0YTBjMDI0ZWQzMDBjOGJiY2VlMGZlZWI1ZmU3YjdhNzc2YTgyMjFlYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.gJDaHXO41CjUSYlHQP2YCG2OAw2_hftnwHW4i12-G7A)
Panel:
Tasks
KeyboardController
/w-kbd
#11844[
/]
)cmd + /
orshift + /
or both) & include on the dialog itselfDescribe alternatives you've considered
Additional context
Working on this
The text was updated successfully, but these errors were encountered: