Repository navigation
Closed as not planned
Labels
[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsyncedA collection of blocks that can be synced (previously reusable blocks) or unsynced[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality
Description
Follow up to:
Issue Summary
Goal: Migrate editable fields from PR #71730 to use the DataForms API instead of recreating similar functionality.
Key Points
Context
- PR ContentOnly Patterns experiment: Add content only inspector fields #71730 introduces editable fields in block settings, but the implementation largely recreates DataForm behavior
- Current approach is guarded behind an experiment, allowing for iteration
Proposed Approach
✅ Phase 1: Investigation (Time-boxed)
Started in #73180
- Validate whether DataForm can support the UI/UX requirements from ContentOnly Patterns experiment: Add content only inspector fields #71730
- Identify compatibility gaps and blockers
- Determine which components need to be hard-coded vs. generic
Phase 2: Migration
- Consider replacing ToolsPanel with simpler heading + DropdownMenu for visibility controls
- Replace custom implementation with DataForm components
- Align
settings.fieldsshape with DataForm API conventions- Use
typeto correspond with DataForm controls - Use
idinstead of custom mappings where possible - Remove
shownByDefaultfor controlling which fields are visible (possibly look atisVisible). WIP PR in Content only block experiment: blocks provide the form #73479 - Each field's
Editfunction should not update the blocks directly. It should just emit a new value, with the block updates happening in the DataForm'sonChangecallback (see comment on: ContentOnlyControls: Refactor to use DataForm #73374 (comment)) -
mappingsupport should be added to the Field API, possibly through apropertieskey, that provides the mapping. Content-only: removemappingandargsin favor of DataForm API #74575 - Remove
argsand instead useEditconfig instead (also see comment: ContentOnlyControls: Refactor to use DataForm #73374 (comment))
- Use
Missing DataForm Controls to Address (so far)
- RichText control see DataForm: Add a generalised richtext field #73180
- Media/MediaItem control see Fields: Replace the
FeaturedImageEditfield to a more generalMediaUploadfield #72614 (with square/round-rect thumbnail, similar to Site Logo. Show image preview instead of icon. See ContentOnly Patterns experiment: Add content only inspector fields #71730 (comment) ) - Link control
Note: These could use ad hoc Edit components initially, but should be added to DataForm proper
Additional Considerations
- Explore field visibility/filtering mechanism (some fields like image links and captions could be shown by default to reduce long field lists)
- A small wrapper component to manage which fields are displayed is acceptable
- Block Fields: add inspector 'fields' support for blocks like Site Tagline, Site Logo etc. #73420
Related
Reacted by Andrew Serong
Metadata
Metadata
Assignees
Labels
[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsyncedA collection of blocks that can be synced (previously reusable blocks) or unsynced[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality
Activity
ramonjd commentedon Nov 13, 2025
Relavant comment:
Not something that is deliverable in the short term, just to keep in mind when we integrate DataForms
andrewserong commentedon Nov 14, 2025
I think we can probably get there iteratively, which is to say, attempt to create a structure that mirrors DataForms as close as we can, so that we deviate only when needed. Then that should (hopefully) give us a list of tasks of things to implement (i.e in DataForms controls) to bridge the gap?
talldan commentedon Nov 17, 2025
The Media field was being separately tracked in #72614. I've updated the issue description to mention it.
talldan commentedon Nov 17, 2025
It already shows a preview/thumbnail, so this part might need some clarification.
ramonjd commentedon Nov 18, 2025
For me (looking at trunk) it's possible that the root block being tested was a Cover block:
andrewserong commentedon Nov 18, 2025
Just assigning myself to this one, as I'd like to give it another try. To keep things contained, I think I'll try to retain the current functionality but refactor to DataForm. That way we can (hopefully) approach this in an iterative way, and not make too many changes at once. (I.e. keep the drilldown behaviour for now)
talldan commentedon Nov 18, 2025
True, it doesn't work for cover blocks, but only when the image hasn't been uploaded to the media library. The issue is that the cover block can have images or videos added to it. If the media isn't in the library we don't know what media type it is, and therefore whether a thumbnail can be shown. I'm not sure how to solve that, maybe there's a way, but seems like a small issue and not worth focusing on to me.
In other cases you should get the thumb and if it's in the library the image title too:

The code that handles this could definitely be improved, I wrote it very quickly. The styling is also very basic!
talldan commentedon Nov 18, 2025
Actually, had an idea. Maybe we can always try to load the media as an image (even when it's a video), and then style any broken images to look like the fallback media icon - https://css-tip.com/broken-image/
andrewserong commentedon Nov 20, 2025
Update: I've landed an initial pass in #73374 which swaps out ToolsPanel for DataForm and a custom dropdown menu that resembles the ToolsPanel behaviour for showing and hiding fields. It also nudges the structure of
settings.fieldsa little closer to the structure of DataForms fields — it's not an exact match and there's some mapping happening between the two, but it's a step in that direction.Ideas for next tasks:
mediaandrichtextto pass through to the DataForm controls insteadThese tasks are broadly captured in the issue description under "Missing DataForm Controls to Address".
I'm not too sure how much further I'll get on these tasks in the immediate term as after this week I'll be spending a week focused on other things, but happy to pick this up again starting in December.
fabiankaegy commentedon Nov 20, 2025
talldan commentedon Nov 20, 2025
fabiankaegy commentedon Nov 20, 2025
andrewserong commentedon Nov 20, 2025
@fabiankaegy no worries, and thanks for the reminder — I've been testing multiple experimental features at the same time and it's a good reminder for me to be a bit more granular with my demo videos!
oandregal commentedon Nov 25, 2025
Sharing for awareness #73555
andrewserong commentedon Nov 25, 2025
Update: @oandregal has landed #73479 which removes
shownByDefaultfrom thesettings.fieldskeys, and instead uses asettings.formto define which fields default to being visible. The issue description includes some remaining tasks to get content only controls (and thesetting.fieldsstructure) aligned with the current Form / Fields / DataForm APIs. I'll plan to pick these up next week if no-one beats me to it![-]Pattern fields in the inspector panel: use the DataForms API[/-][+]Block Fields: fully adopt the DataForms API[/+]oandregal commentedon Jan 22, 2026
The
mappingandargsproperties have been removed as of #74575 (marked the task as done).Re-sharing this comment, next steps to align with Field API are:
mediaandlinkcontrols declarative. Needs #74856oandregal commentedon Jan 23, 2026
I'm exploring an alternative to remove getValue/setValue functions from the blocks at #74900
oandregal commentedon Jan 26, 2026
#74942 enables 3rd party registration via DataForm (addressing the need for custom media/link controls).
jorgefilipecosta commentedon Jul 24, 2026
I will give a try to link control.
talldan commentedon Sep 15, 2026
The Block Fields experiment was removed in #82531, so I'll close all related issues.