-
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
Experiment: Make block "synced" status applicable to all controlling blocks #46412
Experiment: Make block "synced" status applicable to all controlling blocks #46412
Conversation
Size Change: -310 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
I have a sense that @talldan mentioned that |
cc @glendaviesnz who worked on this originally. |
It looks like the purple outline isn't shown when in the post editor, but it is in the site and template part editor. @scruffian how else were you able to get the blue outline? |
it happens when other blocks are selected and I hover the nav block... |
I think this is a good use case for it. I do support using that selector, as it's good to make this feature work dynamically. Though I think initially the synced block purple color was supposed to only apply to template parts and reusable blocks. @jameskoster might know more about whether it should apply to the navigation block. |
As a bit of background, when I initially implemented this in the list view I showed everything under a template or reusable block as purple as my thinking was that if it was contained within a synced block it was essentially itself synced, ie. a group within a template part is just as 'synced' as the parent template in a way - but @jameskoster wanted to avoid any confusion and just color the template and reusable parents. Adding other blocks like Navigation makes sense to me though as editing its children has the same impact as editing the children of a template or reusable block. |
Just to clarify: If all the children have purple icons too then there's no way to quickly identify nested synced blocks. Navigation is a perfect example since it's common to find Navigation blocks inside Headers and Footers. We figured the purple tinted background was an adequate indicator that blocks inside the synced parent are inherently synced as well. |
The motivation here is that Navigation is synced. Its children are often synced with an entity just like Template Part and Reusable blocks. At the moment it's impossible to easily tell when a Nav block is syncing its children. With this change we'd have clearer visual cues. Is this pattern exclusive to TPs and RBs? |
No, but there's a nuance to consider before applying it to the Navigation block, see: #43261 (comment) |
I mentioned it in #46416 as well, but one thing worth noting about the technical approach is that #46416 makes the Page List a controlled block. If both this PR and that one were merged, Page List would be shown as synced in the UI. In some ways that is right. Page List is technically 'synced' to the user's page hierarchy. On the other hand, this isn't something that can be edited or saved in the editor, so it differs from other synced blocks. |
Following on from discussions in #43261 (comment) let's avoid making Nav block one of the "synced" blocks. For that reason let's close this PR out. That said we could still explore using the status indicator in the inspector controls for template parts and reusable blocks. Let's do that in a followup. Todo:
|
@glendaviesnz I saw you were working on the colorizing. Do you have any guidance for how you'd prefer I go about the above? |
As the existing purple colorizing is based on blocks being Also, currently the check to see if is a template or reusable block happens in a couple of places, so if we are adding to this list of possible blocks maybe we should add a single selector that does this check? |
Yes I noticed the check was in a few places. We going to need to come up with a term. Perhaps it's |
|
What?
Extends and improves visual affordances applied to more types of "synced" blocks:
Closes #43261.
Why?
Currently only Reusable blocks and Template parts are given the visual affordances associated with being "synced". However other blocks may also benefit from this including the Navigation block.
This PR explores how that might look.
How?
Updates the logic determining what constitutes "synced" to be whether or not the block's inner blocks are "controlled". Originally the block type was the determining factor in this.
Testing Instructions
Try out various types of synced blocks and look out for the purple visual affordances given to these. They include:
Testing Instructions for Keyboard
Screenshots or screencast