Prevent Pre-Publish Panel from Displaying Incorrect Information After Navigating away #67010
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.
Fixes: #64913
What?
This PR addresses a bug highlighted in #64913 where the pre-publish panel displays incorrect or broken information when switching to edit a template part. Specifically, if you open the pre-publish checks and immediately switch to edit a template part, the panel continues to show details about the template part, instead of closing or updating appropriately.
Why?
This fix improves the user experience by preventing confusion caused by incorrect information in the pre-publish panel. It ensures the behavior aligns with expectations, where the pre-publish is closed when navigating away.
How?
The issue is resolved by ensuring that when the user navigates away from editing the page, the pre-publish panel is closed. This change ensures that the publish flow is not interrupted and the pre-publish checks are only shown for the current page or post, not the template part.
Testing Instructions
publish
to open the pre-publish panelScreenshots or screencast
pre-publish.panel.bug.mov