-
Notifications
You must be signed in to change notification settings - Fork 4.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
Do not show tooltip of the block toolbar buttons when text label preference is enabled. #43936
Do not show tooltip of the block toolbar buttons when text label preference is enabled. #43936
Conversation
Size Change: +72 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Note: as mentioned in #42815 buttons that are associated with a keyboard shortcut always display a tooltip, to visually expose the keyboard shortcut. This logic is in the |
5b201b3
to
08951b3
Compare
Flaky tests detected in 08951b3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4084552512
|
I'm going to close this PR waiting to find a better approach. |
See #42811
What?
This PR is a Proof Of Concept to illustrate a potential approach to address #42811
When the 'Show button text labels' preference is enabled, the block toolbar buttons show text instead of icons. However, they still display a tooltip (on hover and focus) that just repeats the visible text.
Why?
A tooltip that just repeats the visible text of the buttons is pointless and just clutters the UI. When 'Show button text labels' is enabled, the tooltip should not show, as done for the Top toolbar in #42676 / #42815
How?
For now, this PR shows a potential approach only for the 'block switcher' dropdown button, which is the first button within the block toolbar.
showIconLabels
preference value from thepreferencesStore
.showIconLabels
as value to be used for theshowTooltip
prop.Feedback on a couple things would be greatly appreciated. Also, any suggestions for a batter approach is very welcome. Problems I see with this approach:
preferencesStore
and add it to theblock-editor
package? I'm not sure that is desirable.showTooltip
prop needs to be explicitly set on all the buttons of the various components that are used within the block toolbar. This applies to both the post editor and the site editor. There's a lot (dozens?) of components that are used within the toolbar that would need to be changed. Is there any simpler, more generic, approach anyone can think of?Testing Instructions
Screenshots or screencast