Fix: Rethink the View (device emulation), Preview, and View Post UI #69559
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #65918
Why?
This PR covers the following things mentioned in the issue by @afercia :
Move 'Preview in a new tab' to the top bar. It should be clearly distinguished from 'View Post' and make clear it's a tool to see your live changes, even the ones that aren't saved yet.
Overall, I'd like to propose to make the right part of the top bar an area that only contains controls related to the save / preview / publish / view editorial flow. Those are logically related features that should stay together while the device emulation tools are more a design tool.
On a published post, when there are no live changes, 'Preview in a new tab' should be (accessibly) disabled because there's no live changes to see. In this scenario, only 'View Post' should be enabled.
Rename 'Preview in a new tab' to make more clear it shows your changes e.g. 'Preview changes'. It's not a case that this is what Classic Editor always did for published posts:
How?
This PR introduces a new
PostPreviewChangescomponent, separate from the device emulator (view), to show live editor changes without saving. It also includes component refactoring to accommodate this update.Testing Instructions
Screenshots or screencast
Screen.Recording.2025-03-13.at.3.46.52.PM.mov