Skip to content

Feat/custom group block - #180

Merged
YvetteNikolov merged 64 commits into
mainfrom
feat/custom-group-block
Oct 5, 2026
Merged

YvetteNikolov merged 64 commits into
mainfrom
feat/custom-group-block

Conversation

@Yannicvanveen

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Legacy patterns regress, focal-point settings are ignored on the frontend, and several card/group behaviors are incorrect.

Review effort: Balanced
Findings: 1 High severity · 5 Medium severity

Open (6)
What changed in this PR

Introduces server-rendered Gutenberg blocks for reusable theme layouts and replaces legacy core Group variations.

Changes:

  • Adds Article, Banner, Card, Group, and Section blocks.
  • Adds block templates, styling, palettes, and PHP renderers.
  • Updates legacy group/card behavior and editor configuration.
File Description
web/​app/​themes/​sage/​theme.json Adds block color palettes.
web/​app/​themes/​sage/​resources/​views/​components/​card.blade.php Makes image ratio configurable.
web/​app/​themes/​sage/​resources/​views/​blocks/​theme/​section.blade.php Renders Section blocks.
web/​app/​themes/​sage/​resources/​views/​blocks/​theme/​group.blade.php Renders Group blocks.
web/​app/​themes/​sage/​resources/​views/​blocks/​theme/​card.blade.php Renders Card blocks.
web/​app/​themes/​sage/​resources/​views/​blocks/​theme/​banner.blade.php Renders Banner blocks.
web/​app/​themes/​sage/​resources/​views/​blocks/​theme/​back-button.blade.php Moves Back Button rendering to Blade.
web/​app/​themes/​sage/​resources/​views/​blocks/​theme/​article.blade.php Renders Article blocks.
web/​app/​themes/​sage/​resources/​styles/​editor.css Loads theme-block editor styles.
web/​app/​themes/​sage/​resources/​styles/​components/​cards.css Adds configurable card image ratio.
web/​app/​themes/​sage/​resources/​styles/​blocks/​theme/​editor.css Normalizes editor child margins.
web/​app/​themes/​sage/​resources/​styles/​blocks/​group/​shared.css Removes legacy core Group styling.
web/​app/​themes/​sage/​resources/​scripts/​editor/​block-variations.jsx Removes replaced core Group variations.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​style.css Styles Section blocks.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​save.jsx Serializes Section contents.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​index.jsx Registers the Section block.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​icon.jsx Defines the Section icon.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​editor-style.css Styles Section editor layout.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​edit.jsx Implements Section editing.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​section/​block.json Defines Section metadata.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​style.css Styles Group variants.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​save.jsx Serializes Group contents.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​index.jsx Registers the Group block.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​icon.jsx Defines the Group icon.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​editor-style.css Adds Group editor references.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​edit.jsx Implements Group editing.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​group/​block.json Defines Group metadata and variations.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​style.css Styles Card blocks.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​save.jsx Serializes Card contents.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​index.jsx Registers the Card block.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​icon.jsx Defines the Card icon.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​editor-style.css Adds Card editor stylesheet.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​edit.jsx Implements Card editing and media controls.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​card/​block.json Defines Card metadata and attributes.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​style.css Styles Banner blocks.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​save.jsx Serializes Banner contents.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​index.jsx Registers the Banner block.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​icon.jsx Defines the Banner icon.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​editor-style.css Adds Banner editor references.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​edit.jsx Implements Banner editing and media controls.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​banner/​block.json Defines Banner metadata and attributes.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​back-button/​icon.jsx Updates the Back Button icon.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​style.css Adds Article style references.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​save.jsx Serializes Article contents.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​index.jsx Registers the Article block.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​icon.jsx Defines the Article icon.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​editor-style.css Adds Article editor references.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​edit.jsx Implements Article editing.
web/​app/​themes/​sage/​resources/​scripts/​blocks/​article/​block.json Defines Article metadata.
web/​app/​themes/​sage/​config/​gutenberg.php Allows Cards inside core Groups.
web/​app/​themes/​sage/​config/​blocks.php Registers server render callbacks.
web/​app/​themes/​sage/​app/​Blocks/​Section/​Section.php Defines Section rendering metadata.
web/​app/​themes/​sage/​app/​Blocks/​Group/​Group.php Defines Group rendering metadata.
web/​app/​themes/​sage/​app/​Blocks/​Card/​Card.php Defines Card rendering metadata.
web/​app/​themes/​sage/​app/​Blocks/​Block.php Adds the shared block renderer.
web/​app/​themes/​sage/​app/​Blocks/​Banner/​Banner.php Defines Banner rendering metadata.
web/​app/​themes/​sage/​app/​Blocks/​BackButton/​BackButton.php Migrates Back Button to shared rendering.
web/​app/​themes/​sage/​app/​Blocks/​Article/​Article.php Defines Article rendering metadata.
vite.config.js Removes editor stylesheet prefix wrapping.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}
}

.wp-block-group-is-layout-grid {
Comment on lines +11 to +28
.wp-block-theme-card {
@apply flex flex-col gap-(--card-padding) overflow-clip rounded-(--card-radius) bg-(--card-bg-color) p-(--card-padding) shadow-(--card-shadow);
--button-wrapper-block-spacing: 0;
}

.wp-block-theme-card__body {
@apply normalize-child-margin grow flex flex-col space-y-(--theme-card-content-spacing)!;

.wp-block-buttons {
@apply mt-auto!;
}

:has( + .wp-block-buttons ) {
--theme-card-content-spacing: var( --theme-card-buttons-spacing );
}

&:has(.wp-block-heading a) {
@apply relative;
Comment on lines +37 to +40
"name": "group-default",
"title": "Groep",
"isActive": [ "backgroundColor" ],
"isDefault": true,
Comment on lines +30 to +32
* {
@apply col-[2/3];
}
@if (($attributes['imageId'] ?? 0) > 0)
@php($imageSrc = wp_get_attachment_image_url($attributes['imageId'], 'large'))
<div class="{{ $blockDefaultClassname }}__media">
<x-brave-img-focal-point class="{{ $blockDefaultClassname }}__image" :id="$attributes['imageId']" :src="$imageSrc" />
</div>
@if (($attributes['imageId'] ?? 0) > 0)
@php($imageSrc = wp_get_attachment_image_url($attributes['imageId'], 'large'))
<x-brave-img-focal-point class="{{ $blockDefaultClassname }}__image" :id="$attributes['imageId']" :src="$imageSrc" />
Comment on lines 4 to 18

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.

Mag ook weg

Comment on lines +1 to +6
:where(.wp-block-theme-group, .wp-block-theme-section) {
> :last-child,
> :has( + .block-list-appender ) {
@apply mb-0;
}
}

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.

Mag wat bij betreft in het verzamelbestand van /blocks/wp/shared.css

blocks/theme/ is namelijk niet echt een 'block'

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Composer package changes
Prod Packages Operation Base Target Link License
bonny/wordpress-simple-history Upgraded 5.33.0 5.34.0 Compare GPL-2.0-or-later
composer/semver Upgraded 3.4.4 3.5.0 Compare MIT
doctrine/lexer Upgraded 3.0.2 3.0.3 Compare MIT
illuminate/auth Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/bus Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/cache Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/collections Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/conditionable Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/config Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/console Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/container Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/contracts Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/cookie Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/database Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/encryption Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/events Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/filesystem Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/hashing Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/http Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/log Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/macroable Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/pagination Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/pipeline Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/queue Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/reflection Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/routing Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/session Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/support Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/testing Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/translation Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/validation Upgraded v12.69.2 v12.69.3 Compare MIT
illuminate/view Upgraded v12.69.2 v12.69.3 Compare MIT
intervention/image Upgraded 3.11.8 3.11.9 Compare MIT
mck89/peast Upgraded v1.18.0 v1.18.1 Compare BSD-3-Clause
monolog/monolog Upgraded 3.12.0 3.12.1 Compare MIT
nesbot/carbon Upgraded 3.14.1 3.14.2 Compare MIT
phpdocumentor/type-resolver Upgraded 2.0.0 2.1.0 Compare MIT
plugin/yard-gutenberg Upgraded v1.8.0 v1.9.0 Compare EUPL-1.2
roots/wordpress Upgraded 7.0.4 7.0.6 Compare MIT, GPL-2.0-or-later
roots/wordpress-no-content Upgraded 7.0.4 7.0.6 Compare GPL-2.0-or-later
sentry/sentry Upgraded 4.31.0 4.32.0 Compare MIT
sentry/sentry-laravel Upgraded 4.27.0 4.28.0 Compare MIT
symfony/console Upgraded v7.4.19 v7.4.20 Compare MIT
symfony/error-handler Upgraded v7.4.17 v7.4.20 Compare MIT
symfony/finder Upgraded v7.4.19 v7.4.20 Compare MIT
symfony/http-foundation Upgraded v7.4.19 v7.4.20 Compare MIT
symfony/http-kernel Upgraded v7.4.19 v7.4.20 Compare MIT
symfony/polyfill-intl-grapheme Upgraded v1.41.0 v1.43.0 Compare MIT
symfony/polyfill-intl-idn Upgraded v1.42.0 v1.43.0 Compare MIT
symfony/polyfill-intl-normalizer Upgraded v1.42.0 v1.43.0 Compare MIT
symfony/polyfill-mbstring Upgraded v1.38.2 v1.43.0 Compare MIT
symfony/polyfill-php80 Upgraded v1.37.0 v1.43.0 Compare MIT
symfony/polyfill-php83 Upgraded v1.41.0 v1.43.0 Compare MIT
symfony/polyfill-php84 Upgraded v1.38.1 v1.43.0 Compare MIT
symfony/polyfill-php85 Upgraded v1.41.0 v1.43.0 Compare MIT
symfony/routing Upgraded v7.4.18 v7.4.20 Compare MIT
yard/brave-components Upgraded v2.0.0 v2.0.1 Compare MIT
yard/brave-hooks Upgraded v3.1.1 v3.2.0 Compare MIT
Dev Packages Operation Base Target Link License
fidry/cpu-core-counter Upgraded 1.3.0 1.4.1 Compare MIT
friendsofphp/php-cs-fixer Upgraded v3.95.24 v3.95.27 Compare MIT
yard/brave-scaffold Upgraded v4.0.0 v4.0.1 Compare MIT

laravdiemen
laravdiemen previously approved these changes Oct 5, 2026

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

Ik moet het vooral zelf gaan uitproberen of het zou allemaal werkt, maar het ziet er wel goed uit! Dus ben benieuwd om het te gaan gebruiken

</div>
</div>
<InspectorControls>
<PanelBody title={ __( 'Afbeelding', 'sage' ) }>

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.

Ik weet niet helemaal hoe dit nou werkt, maar ik vind het wel een beetje lelijk dat er nu twee panel bodys zijn voor allebei de afbeelding. Zou in mijn ogen mooier zijn als het samen in 1 zit. Het is overigens geen wereldprobleem.

@YvetteNikolov
YvetteNikolov merged commit c5c7415 into main Oct 5, 2026
@YvetteNikolov
YvetteNikolov deleted the feat/custom-group-block branch October 5, 2026 13:37
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.

5 participants