Skip to content
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: Notify on save when users edit the value of a connected custom field instead of the post content #61405

Closed
SantosGuillamot opened this issue May 6, 2024 · 7 comments
Labels

Comments

@SantosGuillamot
Copy link
Contributor

This is part of a broader effort to improve the block bindings UI.

What?

When saving a post, specify if it updates the post content or the value of the custom fields.

As part of the block bindings project, it is expected to allow the users to edit the value of the source connected to the block directly through the rich text. It was showcased in this Gutenberg Hallway Hangout, and there is an ongoing PR for post meta here.

This means that if a paragraph's content is connected to a custom field, users will edit the value of the custom field instead of the post content. It'd be great to clarify that during the saving in the same way we do with other entities.

Screenshot 2024-05-06 at 13 35 28

At first, I thought it was gonna work out of the box because it is actually using the proper editEntityRecord function: link. However, in the end we are just editing the post entity, and it doesn't differentiate between editing the content or other parts like meta fields.

Would it make sense to specify which parts of the entity are being updated and, in case the meta fields are part of that, trigger the same "warning" as when we edit an external entity like in the previous example? Something like this but properly designed:

Screenshot 2024-05-06 at 13 45 13
@jasmussen
Copy link
Contributor

If you change several global styles, we have a gray-colored bulletted list design already, that would work for this. To see this, go to global styles, change typography and colors, and see the save dialog. It should look like the column on the left in this screenshot:

Near term

The column on the right shows that same layout as applied to connected custom fields, listed out.

The important piece here is to figure out: what should the text say? Should it say "Page content." and "Page meta." as suggested in this screenshot? Or should we be more explicit, such as "Page content." and "Custom field: meta."? Do we even apply the code styling to custom field names, or apply a color?

Longer term it'd be nice to add checkboxes to this list, so you could uncheck changes if they were made in error:

Longer term

Figma.

@artemiomorales
Copy link
Contributor

The important piece here is to figure out: what should the text say? Should it say "Page content." and "Page meta." as suggested in this screenshot? Or should we be more explicit, such as "Page content." and "Custom field: meta."? Do we even apply the code styling to custom field names, or apply a color?

It should be more granular and refer to the custom fields, right? I think it should even get more granular so that you can see all of the individual custom fields have been updated. I believe that's what I'd personally prefer to see, though I understand that would probably vary depending on how technical the user is.

@artemiomorales
Copy link
Contributor

@jasmussen We have a very rough, preliminary implementation going here in case you'd like to take a look.

@jasmussen
Copy link
Contributor

Just connecting dots with a comment here, on a potential path forward: #61560 (comment)

@jasmussen jasmussen removed the Needs Design Feedback Needs general design feedback. label May 28, 2024
@gziolo
Copy link
Member

gziolo commented Jun 3, 2024

Initial integration landed on Friday with #61811. This is how it looks like in the post editor when other posts get modified, for example when using Query Loop block with Block Bindings defined in the post template:

Screenshot 2024-05-31 at 10 14 00

@SantosGuillamot
Copy link
Contributor Author

The initial version of the save panel is already in trunk. Is it okay to close this issue and work on potential improvements, like showing the list of meta fields, on follow-up issues/PRs?

Screenshot 2024-06-27 at 13 30 44

@artemiomorales
Copy link
Contributor

Is it okay to close this issue and work on potential improvements, like showing the list of meta fields, on follow-up issues/PRs?

New issue opened here: #62938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants