-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site editor routes: add docs for areas and prevent edit
area from rendering when canvas is edit
#66309
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
) } | ||
{ ! isMobileViewport && | ||
areas.edit && | ||
canvasMode !== 'edit' && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reasoning for this. I mean, it's ok, but feels like maybe it's the responsibility of the route no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is the same as any other area: for example, content
, sidebar
, or mobile
also have this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it's the responsibility of the route no?
The way the routes work as of now is that the "layout" is controlled by the site editor component, not the routes. We could change this so it's more flexible for 3rd parties (con: also less coherent), but it's about how we handle all areas, not just edit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go for consistency then for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is triggering an ESLint error since canvasMode
is undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, interesting. I wonder why the tests didn't report any issue for this PR? I see it was fixed at #66316
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a follow-up PR (#66213) removed the variable, but the conflict wasn't caught until it was merged.
|
||
## Areas | ||
|
||
When `canvasMode` is not `edit`, the areas avaliable to use are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, for me I see things differently :)
I see things like that:
the available areas are always "all of them" but when the canvas mode is "edit", the "preview" area is "focused/zoomed".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think we should document that the areas are different based on viewport, not based on canvasMode.
In mobile: the "mobile" area is used or otherwise "preview" (fallback)
In desktop: All the areas are used.
or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the available areas are always "all of them" but when the canvas mode is "edit", the "preview" area is "focused/zoomed".
But they are not really available because they are not rendered :)
Actually, I think we should document that the areas are different based on viewport, not based on canvasMode.
That's already documented as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But they are not really available because they are not rendered :)
That's not really important to me. I see them as there but hidden because I'm just focused on the preview. Again, it's just a mental model and probably both make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we have a different mental modal but I guess it's ok.
Size Change: 0 B Total Size: 1.81 MB ℹ️ View Unchanged
|
…endering when canvas is `edit` (WordPress#66309) Co-authored-by: oandregal <[email protected]> Co-authored-by: youknowriad <[email protected]>
Follow-up to #66030
What?
edit
area to be rendered when canvas mode isedit
, as it's not used.Testing Instructions
Smoke test the site editor navigation.