-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
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
Reactions are currently unavailable
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