Skip to content

Try content only editable content fields with DataForm#73186

Closed
andrewserong wants to merge 61 commits intotrunkfrom
try/content-only-inspector-fields-with-dataform
Closed

Try content only editable content fields with DataForm#73186
andrewserong wants to merge 61 commits intotrunkfrom
try/content-only-inspector-fields-with-dataform

Conversation

@andrewserong
Copy link
Contributor

@andrewserong andrewserong commented Nov 12, 2025

What?

Branched from #71730

⚠️ ⚠️ ⚠️ This is just an experiment, not ready for merging ⚠️ ⚠️ ⚠️

Try out using DataForm in the editable content fields PR. This PR points to that PR's branch instead of trunk. This PR is largely a collaboration 😄 with Claude, so I haven't reviewed the code closely. Note that this PR currently duplicates controls a bit, and they need tidying. This is really a proof of concept right now, so my goal here is to gauge how this looks/feels before putting too much time in it.

It's really just to see how we might use DataForm with a header that resembles the ToolsPanel without actually using the ToolsPanel. I'm quite sure this PR is broken in many ways.

Why?

To see how we might work with DataForm even if we don't (yet) have field controls for things like Media, Link, and RichText.

How?

  • Update the structure of the fields settings in the block files so that they're a little closer to what DataForm looks like
  • Add some functions to convert / translate things
  • Hook up some UI that looks like the ToolsPanel but isn't, to control field visibility

Testing Instructions

Take it for a spin with the content only experiment enabled and have a play around. I believe drilldown is broken.

Testing Instructions for Keyboard

Screenshots or screencast

2025-11-12.18.13.28.mp4

@jasmussen
Copy link
Contributor

Thanks for working on this, just took it for a quick spin and I'm still seeing the kebab menu, and the main difference seems to be that there's now a "Content" label before the input fields, is that correct?

Screenshot 2025-11-13 at 11 06 50

Just to add a little context, DataForm I see as becoming the singular component that replaces the document inspector, and many similar panels that are commonly "a sequence of controls". The purpose is more about reusing and refining that single component, than about the visuals, in fact I hope we can improve the visuals and the behavior of the DataForm perhaps in the 7.0 phase. It's already being used in the experimental QuickEdit panel, and showing both potential and shortcomings there. E.g. perhaps "slug" is a field you edit right there, inline, rather than in a flyout.

But if we think of the DataForm as a single component that will be used in at least those three places—QuickEdit, post/page inspector, and in this contentOnly panel, what changes do we need to make to the DataForm to unify across those three? We will likely need some design work that considers this (CC @WordPress/gutenberg-design to put it on the radar), but we'll basically need to thread the needle between all those three.

Not sure if that's helpful at this point, but just wanted to clarify that by employing DataForm the hope is we'll get some features like the flyouts for free, but also that we'll likely need to massage the DataForm component itself in the process. Which should be fine since, as far as I'm aware, only the QuickEdit experiment uses it so far. Notably it doesn't have the kebab menu.

@jameskoster
Copy link
Contributor

Isn't the idea that DataForm is agnostic of any specific context and usable for all forms? Panels like this one, the document Inspector, or the quick edit panel feel like a higher level abstraction to me.

@andrewserong
Copy link
Contributor Author

Oh, thank you for taking a look at this early experimental PR, folks! The goal with this PR was more from the code-quality side of things to see whether the existing design could be achieved with DataForm instead, which I believe we've managed to prove out now.

Isn't the idea that DataForm is agnostic of any specific context and usable for all forms? Panels like this one, the document Inspector, or the quick edit panel feel like a higher level abstraction to me.

So yes, I mostly wanted to see if we could use DataForm as the underlying structure to achieve the current design, but it also means by ditching ToolsPanel we could achieve any different kind of design we like, too.

I'll likely close out this PR as it was an early timeboxed experiment (with Claude) to see if it was possible to achieve, but it'll help inform doing it properly (tracked in #73261)

Base automatically changed from add/content-only-inspector-fields to trunk November 13, 2025 23:57
@andrewserong
Copy link
Contributor Author

Closing this one out for now, it'll be easier to create a fresh PR I reckon, now that #71730 has landed in trunk.

@fcoveram
Copy link
Contributor

I iterated a new design and shared it in #73466. It proposes using DataForm in a similar manner but in a different surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants