Skip to content

feat: add listView, contentRole and content attributes to blocks in preparation of wp7#96

Merged
YvetteNikolov merged 1 commit into
mainfrom
feat/wordpress-7
Jun 5, 2026
Merged

feat: add listView, contentRole and content attributes to blocks in preparation of wp7#96
YvetteNikolov merged 1 commit into
mainfrom
feat/wordpress-7

Conversation

@YvetteNikolov

Copy link
Copy Markdown
Contributor

https://make.wordpress.org/core/2026/03/15/pattern-editing-in-wordpress-7-0/

Zie ook het bericht in de Frontend - Updates channel.

Het toevoegen van deze extra attributen zorgen ervoor dat onze blokken:

  1. In de patroon gelijk editable zijn (role: content en contentRole) . Dit doorgevoerd voor alle content blokken. Blokken zoals het Table of Contents blokje zijn uitgezonderd.
  2. Blokjes die functioneren als een container krijgen de listView prop. Zo krijgen ze hun eigen lijstweergave in een patroon.

Eigen list view:

Screenshot 2026-06-03 at 15 26 19

en als je er op klikt:

Screenshot 2026-06-03 at 15 26 31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Deze PR bereidt de Yard Gutenberg blocks voor op de (aangekondigde) pattern-editing wijzigingen richting WordPress 7.0 door block metadata uit te breiden, zodat blocks beter als “content” te bewerken zijn in patronen en container-blocks een eigen weergave krijgen in de List View.

Changes:

  • Voegt supports.contentRole toe aan meerdere blocks om pattern-editing als content mogelijk te maken.
  • Voegt supports.listView toe aan container-/wrapper-blocks zodat ze een eigen entry in de List View krijgen.
  • Markeert specifieke block attributes met role: "content" zodat die attributes als content bewerkbaar zijn in patterns.

Reviewed changes

Copilot reviewed 29 out of 33 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Blocks/timeline/block.json Timeline wrapper: contentRole/listView toegevoegd; align attribute default verwijderd.
src/Blocks/timeline-item/block.json Timeline item: supports.contentRole toegevoegd + formatting.
src/Blocks/timeline-item-collapse/block.json Markeert title/subtitle attributes als content via role: "content".
src/Blocks/tabs/block.json Tabs wrapper: contentRole/listView toegevoegd.
src/Blocks/tabs-item/block.json Tabs item: supports.contentRole + headingText als role: "content".
src/Blocks/slider/block.json Slider wrapper: contentRole/listView toegevoegd + supports herordend.
src/Blocks/slide/block.json Slide: supports.contentRole toegevoegd + formatting.
src/Blocks/iconlist/block.json Iconlist wrapper: contentRole/listView toegevoegd.
src/Blocks/iconlist-item/block.json Iconlist item: meerdere attributes gemarkeerd met role: "content".
src/Blocks/icon/block.json Icon: supports.contentRole toegevoegd.
src/Blocks/counting-number/block.json Counting number: supports.contentRole toegevoegd.
src/Blocks/collapse/block.json Collapse wrapper: contentRole/listView toegevoegd.
src/Blocks/collapse-item/block.json Collapse item: headingText/subtitleText gemarkeerd met role: "content".
package-lock.json Version bump en dependency lock updates.
build/Blocks/timeline/index.js Build output bijgewerkt voor timeline metadata/supports.
build/Blocks/timeline/index.asset.php Asset hash update.
build/Blocks/timeline/block.json Build block.json bijgewerkt (contentRole/listView, align attr weg).
build/Blocks/timeline-item/index.js Build output bijgewerkt voor timeline-item supports.
build/Blocks/timeline-item/index.asset.php Asset hash update.
build/Blocks/timeline-item/block.json Build block.json: supports.contentRole toegevoegd.
build/Blocks/timeline-item-collapse/index.js Build output bijgewerkt voor attribute role: "content".
build/Blocks/timeline-item-collapse/index.asset.php Asset hash update.
build/Blocks/timeline-item-collapse/block.json Build block.json: role: "content" op title/subtitle.
build/Blocks/tabs/block.json Build block.json: supports.contentRole/listView.
build/Blocks/tabs-item/block.json Build block.json: headingText role + supports.contentRole.
build/Blocks/slider/block.json Build block.json: supports.contentRole/listView.
build/Blocks/slide/block.json Build block.json: supports.contentRole.
build/Blocks/iconlist/block.json Build block.json: supports.contentRole/listView.
build/Blocks/iconlist-item/block.json Build block.json: attributes role: "content".
build/Blocks/icon/block.json Build block.json: supports.contentRole.
build/Blocks/counting-number/block.json Build block.json: supports.contentRole.
build/Blocks/collapse/block.json Build block.json: supports.contentRole/listView.
build/Blocks/collapse-item/block.json Build block.json: attributes role: "content".
Files not reviewed (3)
  • build/Blocks/timeline-item-collapse/index.js: Language not supported
  • build/Blocks/timeline-item/index.js: Language not supported
  • build/Blocks/timeline/index.js: Language not supported
Comments suppressed due to low confidence (2)

src/Blocks/collapse-item/block.json:50

  • Volgens de PR-beschrijving krijgen content-blokken supports.contentRole: true. Dit block voegt wel role: "content" toe aan attributes, maar supports mist contentRole, waardoor het block mogelijk niet als bewerkbare content in patterns wordt behandeld.
			"role": "content"
		}
	},
	"parent": [ "yard/collapse" ],
	"supports": {

src/Blocks/timeline/block.json:17

  • Het align attribute met default "wide" is verwijderd. Dit wijzigt het standaard gedrag bij het inserten van dit block (nieuw geplaatste blocks krijgen geen alignwide-class meer tenzij expliciet gekozen). Graag bevestigen dat dit intentioneel is; zo niet, voeg het align attribute met default terug toe (zoals bij o.a. yard/tabs/yard/slider).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 21 to +25
"subtitle": {
"type": "string",
"source": "html",
"selector": ".wp-block-yard-timeline-item-collapse__subtitle"
"selector": ".wp-block-yard-timeline-item-collapse__subtitle",
"role": "content"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive. Zodra je "role": "content" toevoegt aan één attribuut, doet dat hetzelfde als supports.contentRole: true

Comment on lines +32 to 36
"role": "content"
}
},
"parent": ["yard/iconlist"],
"parent": [ "yard/iconlist" ],
"supports": {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive. Zodra je "role": "content" toevoegt aan één attribuut, doet dat hetzelfde als supports.contentRole: true

@laravdiemen laravdiemen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Hoe zit het met het query block, aan gezien die niet hierin staat. Moet die ook aangepast worden of gaat dat al goed?

"background": true,
"color": true
},
"contentRole": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wat is nu precies de keuze wanneer je "contentRole": true gebruikt en wanneer "role": "content" op een attribute? Bij dit blok zijn er ook attributes waarbij die role content zou kunnen

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"role": "content" Moet je toevoegen bij een attribuut + control die echt in de editor-styles-wrapper staat, niet in de inspector.

Bij dit blok kun je niks in de editor-styles-wrapper aanpassen, maar wel in de inspector. Dus vandaar contentRole true. Zo is hij wel aanklikbaar.

Zal het een keer tonen hoe het werkt :-)

"parent": ["yard/slider"],
"parent": [ "yard/slider" ],
"supports": {
"contentRole": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Een slide heeft ook innerblocks toch, zou "listView": true dan ook hier toegevoegd kunnen worden?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

de "listView" attribuut is niet voor innerBlocks, maar echt voor blokken die als container functioneren rondom dezelfde meerdere blokken. Dus bijv. de core/buttons (die meerdere core/button bevat), onze collapse list, timeline list, etc.


"supports": {
"anchor": true,
"contentRole": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier heb je nu wel allebei staan, als ik je comment op copilot zie is dit dubbelop? En zelfde opmerking of hier de listview ook bij zou moeten? Mijn listview opmerking geldt voor misschien nog wel meer blokken maar misschien dat ik het mis heb dus ik benoem het hierna niet meer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohja oeps, contentRole is hier overbodig.

@YvetteNikolov YvetteNikolov merged commit c4e63ac into main Jun 5, 2026
1 check passed
@YvetteNikolov YvetteNikolov deleted the feat/wordpress-7 branch June 5, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants