-
Notifications
You must be signed in to change notification settings - Fork 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
Full Site Editing: Investigate options to make Publish button clickable on site block changes [5+5] #34004
Comments
Props to @glendaviesnz for actually identifying this behavior when he was setting up the FSE environment! I only reported what he found :) |
Seems that |
Another thing to consider (either on this issue or on a new one) is the draft status. If a user changes a site setting within a block and the template is not published but saved as a draft, we shouldn't save the setting until the template is published. But we should store somewhere the draft value of the site setting and use it on the template draft. Example:
|
I have looked for an option to get the editor to see content as dirty if an FSE block is updated without duplicating the site option data in the block attributes. The following options were explored:
It looks like the only easy way currently to indicate to the editor a need for update is using setAttributes - but using this for the actual site block data leaves the data needlessly serialised in the block page content .... so I explored the approach of instead using a generic attribute that would be shared by all FSE blocks. I started with a simple boolean, eg. Instead I tried With this approach each block would have attributes set as:
The actually site specific data for the given FSE block would be handled in local component state, eg.
And the update handler would then update local component state, and run setAttribute for the
|
From early feedback, @apeatling noted that the extra save buttons would be too rough as a user experience. It is however super helpful to have them in the plugin as we work on a better solution. Let's get #34112 in a good state and landed into the plugin. We can then follow up with an investigation on better long term options. It's very likely we need to add some core Gutenberg contributions. I've added an extra five points here for the second round of options. |
Have put up a draft PR at WordPress/gutenberg#16254 of one possible approach to exposing a forceIsDirty flag in the core editor code |
After wider discussion at at paAmJe-tF-p2 it was decided to:
|
As originally reported by @mmtr the Save/Publish button should be clickable in the block editor when a change is made to a site block like Site Title or Site Description.
To reproduce this case:
Internally, these are dynamic blocks that are represented the template_part as
<!--wp:a8c/site-title /-->
. When a user updates the title from say "Hello World" to "Foo Bar", this is not serialized as a part of the block, because this should be updated via API in the site option instead. (Values would quickly get out of sync if we tried to serialize this).The text was updated successfully, but these errors were encountered: