-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Enhance 404 message styling #69234
Enhance 404 message styling #69234
Conversation
@@ -264,6 +264,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) { | |||
|
|||
.edit-site-layout__area__404 { | |||
margin: $canvas-padding; | |||
color: $gray-800; |
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.
After PR #69226 gets merged. This line won't be necessary.
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. |
Hi @t-hamano |
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.
Thanks for the PR!
Now that #69226 has been merged, the color overrides are no longer necessary. Can you rebase this PR?
Here are three things I noticed:
The browser console gives me an error: I think we need to replace the description wrapper with a div
tag instead of a p
tag:
react-dom.js?ver=18:73 Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.
This may be a matter of preference, but you can also do something simpler like this:
function NotFonundError() {
return (
<Notice status="error" isDismissible={ false }>
{ __(
'The requested page could not be found. Please check the URL.'
) }
</Notice>
);
}
export const notFoundRoute = {
areas: {
mobile: (
<SidebarNavigationScreenMain
customDescription={ <NotFonundError /> }
/>
),
content: (
<Spacer padding={ 2 }>
<NotFonundError />
</Spacer>
),
},
};
I'm a bit undecided whether to use the error or warning status.
I'm somewhat inclined towards error; but also fairly undecided. |
Hi @t-hamano,
as it is no longer required. Please review it at your convenience. |
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.
Hi @t-hamano, |
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 the error
status is fine for now.
By the way, we plan to display some text when you access a screen where the classic theme is not allowed to be used (#69005).
Let's take into consideration the status of the PR and if we think a warning
status would be more appropriate, we can address it in a follow-up.
Hi @t-hamano, I was wondering if adding an E2E test for the 404 page would be beneficial. I’m unsure if it. Do you think it’s worth adding? If so, I’d love to work on it. |
Yes, I think that's a good idea. |
Closes: #69174
What?
This PR improves the error message displayed on 404 (Not Found) pages in the Site Editor.
Testing Instructions
Screenshots
Desktop
Mobile