-
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
Block Bindings: Add warning in attributes connected to invalid sources #65002
Block Bindings: Add warning in attributes connected to invalid sources #65002
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: +30 B (0%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
Flaky tests detected in 798d4dd. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10682780799
|
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 left some nitpicks related to the variable names, but overall, I think this solution is good enough to start with. #64893 could still be considered as a follow-up if in practice these warnings aren't helpful enough.
I think you are right and it is not related to this pull request. I can see the same problem in |
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
@jasmussen Regarding your comment: I have opened a follow-up PR to have the same line-height for the attribute and the key: #65007. It doesn't change the line height of the Text component but, if that is changed in the future, it ensures it is properly applied to both places. I hope that's fine. |
What?
Alternative to #64893
Instead of stopping the rendering of the block, just shows the default content and add a warning message in the connections panel.
Why?
It is less invasive, especially for use cases where the invalid attribute wouldn't break the block.
How?
I'm just checking if the source exists and, if not, change the message and add the
isDestructive
property of theText
component.Testing Instructions
Check that the warning is shown.
Check the paragraph still shows the default content.
You can repeat the process with an image with multiple attributes: