-
Notifications
You must be signed in to change notification settings - Fork 381
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
Improve AMP admin bar item when DevTools is turned on or off #4986
Conversation
Plugin builds for 3d5b5c4 are ready 🛎️!
|
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.
I tend to prefer this being the other way around: the ⚡ AMP logo being used to link to the AMP page with the text "View AMP", and vice-versa with the 🔗 icon being used to link to the non-AMP page with the text "View non-AMP". The submenu seems unnecessary if no other submenus are there.
I can see that, but this is the reverse of the behavior when DevTools is turned on. Also, using the 🔗 icon when on the non-AMP version and the AMP logo when on the AMP version is closer aligned to what the AMP Validator extension does. Note the consistency with the changes in this PR:
Also, keeping the parent admin bar menu item to just “AMP” takes up less space which can be limited with other plugins adding their own admin menu bar items. We could also have a custom SVG for the AMP 🔗 icon, but that is somewhat redundant since it already says “AMP”. If we did that, however, then we could eliminate the “AMP” text. But then we'd have to figure out what to do when DevTools is turned on, some AMP logo with a warning overlay perhaps, like the validator extension does: This is similar to what we discussed before when the icons were changed from emoji in the first place: #3726 (comment) |
Thanks for taking the time to explain the reasoning behind the changes in detail. Really appreciate it 🙇. |
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 a great changes and a resulting much better UX.
A bit of calibration for the Validate link as discussed.
…on-devtools-admin-bar-item * 'develop' of github.com:ampproject/amp-wp: (32 commits) Use empty() instead of isset() Fix lint issue Set mobile_redirect to true from `originalOptions` when value is unchanged in first run Remove previously completed todo Optimize AMP_Tag_And_Attribute_Sanitizer::get_missing_mandatory_attributes() Run astra theme e2e tests separately so theme can be activated/removed only once Recommend transitional/reader mode to technical users with amp-compatible active theme Fix Jest tests Onboarding wizard close link: return to previous location Persist default mobile_redirect setting when it is not interacted with Prevent wpfooter from preventing clicks Fix lint issues Change currentThemeIsReaderTheme to currentThemeIsAmongReaderThemes Update Browse/Customize AMP text and placement on done screen Determine is_reader_theme in PHP instead of JS Break up long import statement into multiple lines Comment typo fix Restore blocking mobile switcher link if in Customizer but only for Reader mode Eliminate blocking of mobile version link switcher in customizer preview Allow mobile redirection in dev mode generally; improve paired browsing detection ...
@pierlon @amedina Please re-review as I've made improvements to how the validation errors are listed in the link, and now the warning icon is used in Standard mode when there are unreviewed errors or there are kept ones. https://github.com/ampproject/amp-wp/pull/4986/files/65c9e10..36a7846 |
QA passed |
Summary
This is a follow-up to #4955 (for #2673), specifically this line:
Before this PR, when DevTools is turned off, on an non-AMP page the admin bar item contains "🔗 AMP" and on the non-AMP page it contains "🔗 Non-AMP". This is confusing because it's not clear whether the icon is referring to the page being non-AMP or the link being to the AMP version:
This PR improves that situation by:
Also, when DevTools are enabled, when there are no validation errors on a page, now instead of saying “Validate 0 issues“ the link text will remain just “Validate”:
Additionally, when there are are validation errors now they will be explicitly mentioned. The
small
element is used to reduce the width of the menu item.All reviewed:
Some unreviewed (all others removed and reviewed):
Some kept and some unreviewed (in a paired mode):
Some kept without any unreviewed (in a paired mode):
And now, in Standard mode when there is kept markup that is reviewed, a warning icon is shown instead of green checkmark:
All kept:
Checklist