-
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
Editor: Include additional details when saving post fails #68360
base: trunk
Are you sure you want to change the base?
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. |
Size Change: +28 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in 1109e42. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12554707369
|
53fcf9c
to
1109e42
Compare
// Check if message string contains HTML. Notice text is currently only | ||
// supported as plaintext, and stripping the tags may muddle the meaning. | ||
return message && ! /<\/?[^>]*>/.test( message ); | ||
} ); |
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 having a go at this 👍🏻
The extra context is definitely helpful, but I'm wondering if there's a bit too much in there. It might also be confusing for editors.
Before
After
I expect that it's difficult to know which error message is the most helpful. 🤔
Forgetting everything we know about Gutenberg/WordPress, as a user, it'd be helpful to know what failed and why, nothing else. E.g.,
The post couldn't be saved. The post password must be a maximum of 255 characters and contain only letters, numbers or special characters such as "!@#$%^&*".
I expect this would require making the error messages more friendly in the backend. For example, what's invalid is pretty obscure. And the lengths check depends on the database type.
Maybe a hook that passes in the error code, field type so that consumers (a.k.a the block editor) can write their own messages 🤷🏻
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.
@peterwilsoncc will have a better idea I think 😄
What?
Closes #64158.
PR updates the
getNotificationArgumentsForSaveFail
builder to include additional error messages returned by REST API.Why?
Additional details inform users how to fix the problem.
Testing Instructions
Long password
Testing Instructions for Keyboard
Same.
Screenshots or screencast