Skip to content

Block Fields: fully adopt the DataForms API #73261

Closed as not planned
Closed as not planned

Description

@ramonjd

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

Proposed Approach

✅ Phase 1: Investigation (Time-boxed)

Started in #73180

Phase 2: Migration

Missing DataForm Controls to Address (so far)

Note: These could use ad hoc Edit components initially, but should be added to DataForm proper

Additional Considerations

Related

Activity

  1. added
    [Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced
    on Nov 13, 2025
  2. ramonjd commented on Nov 13, 2025

    @ramonjd
    MemberAuthor

    Relavant comment:

    Eventually, these sidebar controls should be a reflection of block attributes + data fields, where we know the shape and type of attributes and what control handles them.

    Not something that is deliverable in the short term, just to keep in mind when we integrate DataForms

  3. andrewserong commented on Nov 14, 2025

    @andrewserong
    Contributor

    Not something that is deliverable in the short term, just to keep in mind when we integrate DataForms

    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?

  4. talldan commented on Nov 17, 2025

    @talldan
    Contributor

    The Media field was being separately tracked in #72614. I've updated the issue description to mention it.

  5. talldan commented on Nov 17, 2025

    @talldan
    Contributor

    Show image preview instead of icon

    It already shows a preview/thumbnail, so this part might need some clarification.

  6. ramonjd commented on Nov 18, 2025

    @ramonjd
    MemberAuthor

    It already shows a preview/thumbnail, so this part might need some clarification.

    For me (looking at trunk) it's possible that the root block being tested was a Cover block:

    Image
  7. self-assigned this
    on Nov 18, 2025
  8. andrewserong commented on Nov 18, 2025

    @andrewserong
    Contributor

    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)

  9. talldan commented on Nov 18, 2025

    @talldan
    Contributor

    For me (looking at trunk) it's possible that the root block being tested was a Cover block:

    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:
    Image

    The code that handles this could definitely be improved, I wrote it very quickly. The styling is also very basic!

  10. talldan commented on Nov 18, 2025

    @talldan
    Contributor

    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/

  11. andrewserong commented on Nov 20, 2025

    @andrewserong
    Contributor

    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.fields a 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:

    • Tidy up the ad hoc fields in ContentOnlyControls (link, richtext, media) further so that they're as close as possible to independent controls that could live in DataForm controls
    • Add support for links that are set dynamically rather than statically
    • Once the ad hoc fields are working pretty well in ContentOnlyControls, propose them as general DataForm controls
    • If and when they're available as general DataForm controls, remove the ad hoc controls and allow simple type strings like media and richtext to pass through to the DataForm controls instead
    • Also, it'll be good to support additional blocks / fields like those that need to update entities instead of attributes: Block Fields: add inspector 'fields' support for blocks like Site Tagline, Site Logo etc. #73420

    These 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.

  12. fabiankaegy commented on Nov 20, 2025

    @fabiankaegy
  13. talldan commented on Nov 20, 2025

    @talldan
  14. fabiankaegy commented on Nov 20, 2025

    @fabiankaegy
  15. andrewserong commented on Nov 20, 2025

    @andrewserong
    Contributor

    Perfect :) sorry for my incorrect assumption here. Should have tested instead of just going for what I saw in the screen recording 🫣

    @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!

  16. oandregal commented on Nov 25, 2025

    @oandregal
    Member

    Sharing for awareness #73555

  17. andrewserong commented on Nov 25, 2025

    @andrewserong
    Contributor

    Update: @oandregal has landed #73479 which removes shownByDefault from the settings.fields keys, and instead uses a settings.form to define which fields default to being visible. The issue description includes some remaining tasks to get content only controls (and the setting.fields structure) aligned with the current Form / Fields / DataForm APIs. I'll plan to pick these up next week if no-one beats me to it!

  18. changed the title [-]Pattern fields in the inspector panel: use the DataForms API[/-] [+]Block Fields: fully adopt the DataForms API[/+] on Jan 22, 2026
  19. oandregal commented on Jan 22, 2026

    @oandregal
    Member

    The mapping and args properties have been removed as of #74575 (marked the task as done).

    Re-sharing this comment, next steps to align with Field API are:

    • Field API: add support for declaring fields that update multiple datums (each property of the data) at once with its Edit control. This should be addressed by #74409.
    • Field API: make the media and link controls declarative. Needs #74856
    • Field API: how to represent, declaratively, a rich-text field. Depending on the conversation at #73180 this can be a custom Edit (needs #74856) or a custom field type (needs #74858)
  20. oandregal commented on Jan 23, 2026

    @oandregal
    Member

    I'm exploring an alternative to remove getValue/setValue functions from the blocks at #74900

  21. oandregal commented on Jan 26, 2026

    @oandregal
    Member

    #74942 enables 3rd party registration via DataForm (addressing the need for custom media/link controls).

  22. removed their assignment
    on Apr 12, 2026
  23. jorgefilipecosta commented on Jul 24, 2026

    @jorgefilipecosta
    Member

    I will give a try to link control.

  24. talldan commented on Sep 15, 2026

    @talldan
    Contributor

    The Block Fields experiment was removed in #82531, so I'll close all related issues.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Type] Code QualityIssues or PRs that relate to code quality

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions