WIP: The preview button doesn't open in a new tab sometimes

Chrome 118
Windows 11

I think this started after the 1.9.2 update or at least one of the latest.
When I edit a page and then click the preview mode button and then view on frontend, it doesn’t open in a new tab and instead takes over the same tab and replaces my edit screen.
This behavior seems completely random, it will do this both ways even on the same page when editing. It seems a total crap shoot whether it might open the preview in a new tab or take over the current editing tab.
There are not settings about this behavior. And I can’t just middle-click to force it to open a new tab because middle-clicking or right-clicking doesn’t do anything. So I just have to cross my figers and click and hope it opens the new tab.

It’s the same when editing a template like a single/archive etc.

While on the same topic, I find it a bit odd to choose what to do with the yellow button. It just makes for an inconsistent experience between sites depending on who edited settings.
I think it would be really nice to just have static buttons that always do the same thing. I always want one link that goes back to WP backend (my usually configuration for the yellow button), and then another button to open preview in another tab (this requires opening preview first and clicking again, so not the best).

I know some people like to set the yellow button to be the preview button that opens in a new tab, but then this is redundant with the existing preview mode buttons, and it also leaves us no button to get back to WP admin at all.
I’d rather have two simple one-click top level buttons (no menus/dropdowns). One to open preview, one to go to WP admin. It can even be up to me whether those buttons open a new tab by middle clicking if I want. I don’t know, but it’s not perfect now, and bugs me more than it should due to the inconsistencies.
I shouldn’t find myself in a situation where I have no button to get back to WP.
I shouldn’t find myself having two ways to open the preview.
I shouldn’t have to go through a menu/separate screen to get the button to open a preview in a new tab.

Hopefully you can re-think this just a little. Even just adding another shortcut for opening preview in a new tab would be very useful.

1 Like

If you open a preview tab and then later edit using the preview tab, the preview from there will open in the same tab. If you are not aware of that, it can make it seem random.

2 Likes

Hi @vigilante,

Thank you for your report. As @macksix mentioned, this happens when the builder tab itself was previously a preview page. I have recorded this in our internal bug tracker.

Regarding the suggestions, I agree that it would be great to always have access to the “View on frontend” in the builder. It gets frustrating having to click 2 buttons to achieve that. We’ve discussed making it always visible before and I think this is a good time to do so, I have added this to our to-do list as well :white_check_mark:

1 Like

Thank you both.

That does make sense if the tab was already a preview tab. I don’t feel like it was in every case because I often open a page first from the WP backend and then edit. Or I browse the frontend to the page first.

I’ll keep an eye on that condition.
I don’t see a reason for making it work that way though. I wouldn’t call it a bug, just, not very useful or intuitive. Probably the preview should always open in a new tab regardless if the tab was already in preview mode.

I look forward to the improvements along these lines.

1 Like