-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add a basic keyboard shortcuts overview dialog #11711
Comments
I will not label this a good first issue but this is a great second or third issue for someone to pick up. We have a clear goal with an implementation proposal and small scope. This involves mostly usage of Django templates and Wagtail's own hooks system. @thibaudcolas @laymonage - feel free to edit, we want to keep the scope as small as possible though. We can build on this, as discussed, with more enhancements such as a better icon, activation of this dialog with a separate keyboard shortcuts and maybe review how this content can be customised per view but let's keep future enhancements listed on #3949 |
@lb- Can I work on this? |
Go for it, I think you messaged on Slack right (checking your the same person :) ) @kituuu |
Thanks, I'm the same person 🙃 |
Hey @lb- Edit: Also can you tell me more about the unit tests. What exactly do we have to check in unit tests? |
@kituuu yes please, try to add the sections/keyboard shortcuts described in the issue. However, I have not manually tested all these in Wagtail (specifically the text editor shortcuts). For example, I think the ctrl/CMD+K may not work yet. The generic browser/os shortcuts like cut and paste should be good to go. It would be great to also ensure there is some styling included. To align with the designs for the content within the dialog. Such as the table row heights, section title text, border under rows. |
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
Resolved via #11717 |
Is your proposal related to a problem?
There is a longer term desire to add a fully fledged keyboard shortcuts dialog, with the ability to be customised and potentially support 'quick type' actions throughout the admin. See #3949
However, we have discussed with some other core team and agreed we should start with something simple first.
This issue is to set up a very basic keyboard shortcuts overview dialog that's accessible within the Wagtail admin menu's help section.
Describe the solution you'd like
There should be a simple clickable button in the help section of the admin menu that allows the user to access a new dialog. It should have the label 'Shortcuts' and use the
regex
icon for now, we can enhance this later.Inside the dialog, it should have a basic set of shortcut groups as per the schedule below.
Ctrl + s
⌘ + s
Ctrl + p
⌘ + p
Ctrl + c
⌘ + c
Ctrl + c
⌘ + c
Ctrl + c
⌘ + c
Ctrl + c
⌘ + c
Ctrl + z
⌘ + z
Ctrl + shift + c
⌘ + shift + c
Ctrl + b
⌘ + b
Ctrl + i
⌘ + i
Ctrl + u
⌘ + u
Ctrl + j
⌘ + j
Ctrl + shift + x
⌘ + shift + x
Ctrl + .
⌘ + .
Ctrl + ,
⌘ + ,
Ctrl + k
⌘ + k
---
(Also add other text content; blockquote, code block apply heading style, numbered list, bullet list)
Mockup
Beyond that we want to keep things simple, we may need to review the keyboard shortcuts on the PR and whoever picks this up should manually test them also.
Finally, we will want a way to show the
meta
key differently on MacOS-like devices or Windows-like.Proposed implementation
1. Add a new menu item, something like this should be a good starting point.
wagtail/admin/wagtail_hooks.py
2. Add a new template tag to link to a new shared template include
Something like below, I have not fully tested but this should be an OK starting point to pass the
meta
key contextually to the template.Feel free to approach this differently.
wagtail/admin/templatetags/wagtailadmin_tags.py
3. Add the new template tag to the admin template
wagtail/admin/templates/wagtailadmin/base.html
4. The detail part, build out the initial keyboard shortcuts template content
Below is a basic starting point but it has no styles and we may want to be smarter about generating the content. It's OK if the PR for this issue has lots of repeated HTML, we want to start simple and then refine the content as we build more features.
We can probably use the tailwind classes to build out most of the styling but feel fre to add a standalone stylesheet within
client/scss/components
if needed.wagtail/admin/templates/wagtailadmin/shared/keyboard_shortcuts_dialog.html
5. Unit tests
It's important there is a basic unit test for the dialog content showing in the admin template and the trigger in the menu.
Mainly to ensure that the ids of the dialog and the data attributes on the menu trigger match and both are being rendered.
Testing the menu content is a bit tricky as it's all JSON (to render the React sidebar), but there should be some tests for the dismissable 'what's new in Wagtail' attributes and we can just do something similar in new tests.
Describe alternatives you've considered
Additional context
Working on this
The text was updated successfully, but these errors were encountered: