Skip to content

Post Publish Panel: Open view post links in a new tab #70127

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

Merged
merged 10 commits into from
May 21, 2025

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented May 15, 2025

What, Why, and How?

Closes #70126

This PR updates the View Post links in the Post Publish Panel to open in new tabs, ensuring a smoother editing workflow by preserving the current editor session.

Testing Instructions

  1. Create a new post.
  2. Publish the post.
  3. From the post publish panel, click on View Post.
  4. Confirm that it opens up in a new tab.

Testing Instructions for Keyboard

Same.

Screenshots

Before After
before after

Screencast

post-publish-demo.mov

@yogeshbhutkar yogeshbhutkar force-pushed the enhance/post-publish-panel branch from 652a8ea to c483a59 Compare May 15, 2025 11:47
@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review May 15, 2025 12:09
Copy link

github-actions bot commented May 15, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: HILAYTRIVEDI <hilayt24@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. General Interface Parts of the UI which don't fall neatly under other labels. labels May 16, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that these two buttons are expected to change to a vertical layout if the button text is long. Here is an example in German:

Before After
before after

Perhaps the props of the Button component have changed, causing the intended style to no longer be applied.

@yogeshbhutkar yogeshbhutkar force-pushed the enhance/post-publish-panel branch from 24df417 to 3f95ebd Compare May 19, 2025 07:09
@yogeshbhutkar
Copy link
Contributor Author

Note that these two buttons are expected to change to a vertical layout if the button text is long.

Thanks for pointing that out! The issue was caused by the .has-icon class adding a min-width. I've fixed it, and it should now work as expected. Please have a look when you get a moment.

Test

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Comment on lines 165 to 166
target="_blank"
rel="noopener noreferrer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
target="_blank"
rel="noopener noreferrer"
target="_blank"

Nit: There is an effort to stop adding noreferrer and noopener. See #26914

@yogeshbhutkar yogeshbhutkar force-pushed the enhance/post-publish-panel branch from 95929d6 to ef96606 Compare May 21, 2025 05:12
@t-hamano t-hamano merged commit 381b623 into WordPress:trunk May 21, 2025
59 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.9 milestone May 21, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
* Post Publish Panel: Open view post in new tab

* chore: fix import order

* chore: update unit test snapshots

* chore: update e2e tests

* chore: update e2e test

* fix: let the button stack up if the text is large

* chore: update `publishPost` to use a11y locators

* fix: simplify visiting published post logic

* fix: remove rel attribute

* chore: update snapshots

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: HILAYTRIVEDI <hilayt24@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post-Publish Panel: Clicking on View Post should open the post in a new tab
3 participants