Problem/Motivation
While working on #3489112: Integrate responsive preview with Navigation top bar, we realized that navigation toolbars were visible in the preview.

To have a more realistic experience, the preview could be rendered as an anonymous user.
This could lead to a possible issue when doing preview of an unpublished node, or in general a page where anonymous users don't have access, but preview could be valuable. Like unpublished nodes during review phase.
Another option would be to just add some extra CSS ot previews in order to hide Navigation.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
plopescComment #3
lauriiiHow this is done by Next.js preview is they generate a token that allows the preview to be loaded with special permissions: https://github.com/chapter-three/next-drupal/blob/main/modules/next/src/.... This might be more complex than what we need but essentially what we'd want the preview to generate is the page as anonymous user, with permissions potentially elevated to view the specific piece of content regardless of it being unpublished.
A more pragmatic approach might be to just try to remove administrative items from the page similar to what's being done in https://git.drupalcode.org/project/same_page_preview/-/blob/2.1.x/same_p.... This might be acceptable even though it doesn't get us to a full solution because there could be custom administrative blocks that are hard for us to identify.
Comment #4
plopescI feel that Next.js preview could be more complex than we want and we could still have some issues about the exact permissions to assign to that anonymous user with steroids.
Could we start with the simpler path and iterate if that's not enough or the community asks for a more elaborated approach?
Comment #5
plopescMR created.
Comment #7
rajab natshahThank you for this integration with navigation.
I'm hitting the following case.
Given that my home page is a Node,
And the alias for that page is
/nodeThen the review will show up a
404page withhttps://drupal11x02x02b1.ddev.site:8443/node?responsive_preview=enabledComment #8
rajab natshahComment #11
rajeshreeputraMerged!