-
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
DataViews: Open a new tab when the View action button is clicked #56737
Conversation
Size Change: 0 B Total Size: 1.72 MB ℹ️ View Unchanged
|
Thanks for the PR! We had discussed this briefly when implemented it, that now it matches the behavior of admin lists. So I'd leave this for @jameskoster to either approve or provide a new icon. |
In general links that open in new tabs are somewhat jarring, as there's rarely a visual indication that clearly denotes new tab rather than just external link. Sometimes those are co-mingled, but not always. The main exception is the "View [Page|Post]" button and "Preview in new tab" menu items in the in the post and page editors, where I suspect it would be surprising if it didn't open in a new tab. Those options feel like the exception to the rule, where that particular preview feature best practice is, in fact, to open it in a new tab. That context here feels the same; conceptually this is just a "View Page" button. Same icon, same URL, so the motivation for the behavior to be the same I can support. The alternate take is that this is a feature equivalent to these hover buttons in the current list views: Those links do not open in a new tab. In that light, I'd support either direction. Though I do think the icon should probably be the same — it is conceptually an "external URL" as you are leaving the editor, a jarring shift. Not a strong opinion, I just don't think the eye works here. |
Good points, I suppose it can be reasoned that the icon is correct either way since it's is conceptually an external link, regardless of whether it opens in a new tab or not. Perhaps we leave things as they are and revisit this PR if needed later? |
Thank you everyone for your feedback. I'm a little confused as to what exactly this icon means... Does the arrow sticking out of the square mean it will open in a new tab? Or does this mean it's a link outside of my site (outside my domain)? have always thought that in most cases it means the former, but I am curious about how it is generally understood 😅 |
The icon means "External link". As in, website.com linking to website.com/test would be an internal link, but website.com linking to example.com would be an external link. That's the most basic meaning, but "external" can have a little nuance, and in this case it means "external to the admin" (i.e. preview). Open in new tab we don't really have a good way to denote, other than on the screen-reader/component level. |
I mistakenly thought this icon meant "open in new tab" rather than "external link", but now that I know that this is not the case, I agree with this suggestion. Users who wish to open in a new tab will be able to right-click the icon and select "Open link in new tab". In the future, as the data view becomes more complete, we may be able to decide which behavior is ideal. Therefore, I would like to freeze this PR for the time being. |
What?
This PR will open the page in a new tab when the View button is clicked in the data view.
Why?
As this icon indicates, the link is expected to open in a new tab. The "View post" button in the Post Editor and the "View site" button in the Site Editor also open a new tab.
How?
Updated
viewPostAction
callback processing. For now, I think this action should always be OK to open in a new window.Testing Instructions