-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Preview menu: Remove redundant "opens in a new tab" hidden text #24427
Preview menu: Remove redundant "opens in a new tab" hidden text #24427
Conversation
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.
It looks like the snapshots just needed updating. Usually whenever the markup of the UI changes, these need updating. I do it on the commandline using |
@@ -207,12 +207,6 @@ export class PostPreviewButton extends Component { | |||
{ this.props.textContent | |||
? this.props.textContent | |||
: _x( 'Preview', 'imperative verb' ) } | |||
<VisuallyHidden as="span"> |
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.
It looks like there are a couple of other uses of PostPreviewButton
, like in the PostLockedModal
, and I think that only says 'Preview'.
An option could be to change the text everywhere to 'Preview in new tab', or make the VisuallyHidden text something that can be enabled/disabled through a prop..
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 catch, Probably risky to change that phrasing because it will likely not scale to mobile interfaces with the length of the phrase.
So we should probably restore the hint for that use case.
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.
Yep, this was, in a way, mentioned on the issue:
Looking at the implementation, not sure what is the preferred approach. PostPreviewButton accepts a textContent prop and fallbacks to a link text Preview if none is passed. So the default text does need the visually hidden text, while a more meaningful text passed via textContent may not need it. Since this depends on the actual text passed via the prop, I'd tend to think the behavior can't be automated and maybe an additional, explicit, prop to render the visually hidden text would be the best option.
Thanks! TIL. |
@jasmussen Looks good! I'm not sure what that change in the unrelated snapshot file is though: |
Thanks for looking. That's curious indeed, I didn't even notice it. I'll try a good rebase and regenerate the snaps afterwards. Happy to know the fix is okay though 👍 |
29c4957
to
266afc2
Compare
I rebased, which removed the snapshots discrepancy. I am however seeing a test failure locally, both on this branch and in master, that seems unrelated to this PR but might nonetheless cause tests to fail here:
|
Hooray, tests are passing! |
Congrats on your first PR here, Kelly, and thank you! |
Congratulations on your first merged pull request, @kellychoffman! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
Fixes: #24386
Text link already states that the link will open in a new tab, so this PR removes the visually hidden "(opens in a new tab)" text. (And yes, I realize this very description is redundant if you've read the title)