Fix : Snackbar Notice Inconsistency#66405
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ntsekouras
left a comment
There was a problem hiding this comment.
Thanks for the PR, it looks good! My comments are mostly nits about inline comments :).
The thing that is not handled here though is the duplicate speak message. I think for these use cases it makes most sense to just use MenuItem component directly and avoid the weird handleToggling and messageActivated/messageDeactivated messages.
|
Hi @ntsekouras 👋. Thanks for the detailed review
Let me know your thoughts on the changes. Thanks |
|
To confirm and validate the |
Replace PreferenceToggleMenuItem with MenuItem. Replace function called when Fullscreen Mode shortcut is used to show the notice. Fix speakMessage placement. Remove disableSpeech prop from PreferenceToggleMenuItem component
There was a problem hiding this comment.
Thank you for iterating!
Related though to the latest feedback on the issue, maybe it's better not to show a notice on the more menu clicks, but also preserve the spoken messages.
So some refactoring will be needed. I think by adding a createNotice param (with default true) in toggleDistractionFreeand revert to usePreferenceToggleMenuItem` in the more menu items would be enough.
|
So just that we are on the same page :
|
|
I also noticed quite a few changes made to the labels here : #66371 |
That were my first thoughts but didn't spent time in code. Probably it will be enough. To elaborate a bit..
Makes sense? |
There was a problem hiding this comment.
This is really close, thank you!
Besides the comments I left, we need to do:
- Remove
scope and namehere as we don't use them. Also pass the new param atonTogglelike this:toggleDistractionFree( { createNotice: false } ). - We should have consistent messages in both more menus and actions. That means either have
${option} off/onor${option activated/deactivated. I'd go foron/offpersonally. - Commented about it, but very important to remove the
speakMessageprop you added here.
With these addressed, I think we can land.
Ensure speak messages are consistent for actions and menu items. Remove speakMessage option for createInfoNotice. Revert extraction of showIconLabels. Convert createNotice param to an object based param.
|
Thanks @ntsekouras for the review 👍
|
ntsekouras
left a comment
There was a problem hiding this comment.
Great work here, thanks!
Co-authored-by: Vrishabhsk <vrishabhsk@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: mtias <matveb@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org>
What?
Fixes: #66364
View Optionsother thanDistraction Feeto show asnackbar noticewhen they aretoggledView Optionsaffected :Top toolbarSpotlight modeFullscreen modeWhy?
How?
toggleDistractionFreefor otherView Optionstoggleswhich allowsSnackbar Noticeto be visible when these options are toggled via theMore MenuTesting Instructions