-
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
Allow opt-out of pattern overrides #60066
Conversation
Size Change: +330 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
I still hold the opinion that the default state of whether something is overwritable should be false. Even when named. The main interface for renaming a block is the list view. Not the advanced inspector controls. To me, this does not really solve the full UX issue. From my point of view, it is a bad experience to have a side-effect on a feature as common as renaming. Like I've said before. Users are so used to the fact that they can rename files, layers, elements, etc. in other pieces of software / operating systems. And that action should not have a side-effect. I'm fine with using the name as the underlying API for us to determine what overrides are connected to instead of a unique ID (even though I still think that fixing a typo in a name should not mean that all instances lose the connection because it is really hard for users to understand why that happened) |
@fabiankaegy I actually agree with everything you said! I still decided to create this draft PR so that people can test the flow themselves and decide which option is better. Now that the original tracking issue is getting too big and closed, I recommend sharing your opinions on the new epic issue #59819, which more people would see! My intention is to create more working examples (like this PR) and potentially guide the feature towards an acceptable state for everyone. |
One aspect of this that might need further consideration is support for mixing and matching different types of bindings. An option could be to mark individual attributes as Pinging some block bindings contributors (cc @gziolo @SantosGuillamot @artemiomorales @michalczaplinski) |
Maybe I'm missing something but, if what you want is not to use pattern overrides, why don't you directly delete the binding from the block attributes instead of setting it to |
There's a seperate proposal to not have any binding attributes - Use metadata.name only as the hint for pattern overrides. |
In the current implementation, once a |
So, let me ensure I understand it correctly. What you want is:
Is that right? If that's the case, I want to consider it better because we are relying on the existence of the |
Would having a "default" option like discussed in this issue help? We could potentially have:
"metadata": {
"name": "custom-name",
"bindings": {
"__default": "pattern/overrides"
}
}
"metadata": {
"name": "custom-name",
"bindings": {
"__default": "core/pattern-overrides",
"content": "core/post-meta",
}
}
"metadata": {
"name": "custom-name",
"bindings": {
"content": "core/pattern-overrides",
}
}
|
Overall, block bindings are opt-in. In effect, developers or users must explicitly set the connection for the individual attribute. It's a contract that ensures that there is full control over what is bound. The presence of the |
@gziolo do your concerns still apply if pattern overrides were opt-in only as outlined here #59812 (comment) ? |
It does seem to be moving towards it being opt-in now, so potentially the solution outlined above by @SantosGuillamot adding a |
No concerns regarding opt-in. It's been opt-in from the start for Pattern Overrides and works out of the box on the server with |
Closing as since #60234 this feature requires opt-in by default. |
What?
Supersedes #59583. Attempts to close #59812.
Add an opt-out toggle for pattern overrides.
Why?
The current implementation of pattern overrides relies on the block's name (Block Renaming API) to enable the feature, but it lacks an opt-out mechanism to just name the block without enabling the feature.
How?
This PR adds a toggle box next to the block name control, which defaults to true, and disables the feature when it's toggled off.
The design is similar to what @SaxonF shared in #59813 (comment) (the last one).
Technically, we set the
bindings
tofalse
to disable the feature. This is not "officially supported" but it seems to work 🤷.Testing Instructions
heading
,paragraph
,image
, andbutton
) to the patterns and give them block names (in the editor settings -> Advanced panel)bindings
attribute tofalse
.Screenshots or screencast
Kapture.2024-03-21.at.16.30.13.mp4