-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Make the Settings panel toggle button show its keyboard shortcut in its tooltip #65322
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
Merged
afercia
merged 2 commits into
trunk
from
fix/settings-panel-toggle-missing-shortcut-in-tooltip
Sep 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should this be limited to these areas only?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youknowriad to my understanding, the shortcut itself is meant to work only for these areas. It doesn't open the Styles panel, it doesn't open the Plugins panel. As such, the keyboard shortcut should only be shown in the Settings toggle button tooltip. Otherwise, it will show up also in the Styles toggle or any Plugin toggle button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the case in my testing for styles at least. The shortcut is passed by the usage of
<ComplementaryArea toggleShortcut={ something } />So if I don't pass it explicitly in my own plugin, it's not rendered and it's not effective. So I think we can probably remove this hardcoded checks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youknowriad I already tested it. And I tested it again now. Here's what happens when removing that condition:
As you can see, the shortcut is shown also in the Jetpack and Yoast SEO button tooltips. I stand corrected that it does not happen for the Styles button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, this means that we have a bug here
gutenberg/packages/editor/src/components/plugin-sidebar/index.js
Line 94 in 5f77458
The shortcut shouldn't be associated with the complementary area at all if it's not meant to be used for it. So basically I think we should just remove that line/prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. The only context I found about the plugin sidebar using the shortcut prop is in this comment #20698 (comment) but I'm not sure I fully understand it Cc @jorgefilipecosta when you have a chance coukd you please share some context?
For now, I just removed the prop from PluginSidebar.