-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add WP Admin link to Global Site Sidebar #87584
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~5147 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~162 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
LGTM, with a minor i18n feedback.
data-tooltip={ translate( 'WP Admin' ) } | ||
> | ||
<Icon icon={ wordpress } className="wpicon" /> | ||
WP Admin |
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 should probably need translation as well.
> | ||
<Icon icon={ wordpress } className="wpicon" /> | ||
{ translate( 'WP Admin' ) } | ||
<Icon icon={ external } className="external" /> |
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.
With this icon, I think we have to open the wp-admin on the new tab.
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 initially felt the same, but I believe it's preferable to remain in the same tab for this scenario.
W3C generally advises against opening new tabs, and it specifies that it should be avoided unless in explicit situations. I thought our scenario did not meet the criteria for opening a new tab as outlined by the WCAG here: https://www.w3.org/TR/WCAG20-TECHS/G200.html.
- Opening a page containing context-sensitive information, such as help instructions, or an alternate means of completing a form, such as a calendar-based date picker, will significantly disrupt a multi-step workflow, such as filling in and submitting a form, if the page is opened in the same window or tab.
- The user is logged into a secured area of a site, and following a link to a page outside of the secured area would terminate the user's logon. In this case opening external links in an external window allows the user to access such references while keeping their login active in the original window.
While it's debatable, I've concluded that opening a new tab, even when an external icon is present, is not the best approach in this instance.
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 found another reason to stay in the same tab: #87551 (comment).
Maybe we should be aligned with the header action. Or could we just remove the external icon? @nuriapenya
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.
Sounds good! I agree to remove the external icon for now 👍
href={ `https://${ selectedSiteSlug }/wp-admin/plugins.php` } | ||
className="sidebar__footer-wpadmin tooltip tooltip-top" | ||
title={ translate( 'WP Admin' ) } | ||
data-tooltip={ translate( 'WP Admin' ) } |
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.
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.
Do you have any thoughts, referring to your previous review: #85013 (comment), @taipeicoder? 🙂
I'm in favor of leaving out the shortcut, but keeping the tooltip for accessibility purposes. Even though it might be redundant 🙂
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.
IIRC the screen reader should be able to capture the text of the link, so we probably don't need to add the title here since it doesn't provide any additional information 🙂
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.
LGTM, I don't have strong preference on new tab or not - its something we can return to later if needs be.
40ea132
to
ac48883
Compare
Related to
Proposed Changes
This PR adds the WP Admin link to the Global Site Sidebar.
Design: pfsHM7-aY-p2
Testing Instructions
Pre-merge Checklist