-
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
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. |
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.
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 |
packages/preferences/src/components/preference-toggle-menu-item/index.js
Outdated
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 use
PreferenceToggleMenuItem` 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really close, thank you!
Besides the comments I left, we need to do:
- Remove
scope and name
here as we don't use them. Also pass the new param atonToggle
like this:toggleDistractionFree( { createNotice: false } )
. - We should have consistent messages in both more menus and actions. That means either have
${option} off/on
or${option activated/deactivated
. I'd go foron/off
personally. - Commented about it, but very important to remove the
speakMessage
prop 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 👍
|
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.
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 Options
other thanDistraction Fee
to show asnackbar notice
when they aretoggled
View Options
affected :Top toolbar
Spotlight mode
Fullscreen mode
Why?
How?
toggleDistractionFree
for otherView Options
toggles
which allowsSnackbar Notice
to be visible when these options are toggled via theMore Menu
Testing Instructions