Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 12 months ago

#57584 closed task (blessed) (fixed)

Add Layout controls for children of Flex layout blocks

Reported by: isabel_brison's profile isabel_brison Owned by: flixos90's profile flixos90
Milestone: 6.2 Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords: gutenberg-merge has-patch has-unit-tests
Focuses: Cc:

Description (last modified by hellofromTonya)

In wp_render_layout_support_flag(), adds the PHP code for supporting layout controls for children of flex layout blocks.

References:

Change History (13)

#1 @hellofromTonya
20 months ago

  • Component changed from General to Editor
  • Description modified (diff)
  • Keywords gutenberg-merge needs-patch added
  • Summary changed from Backport Layout controls for children of Flex layout blocks to Add Layout controls for children of Flex layout blocks
  • Version changed from trunk to 5.8

Updating for history and tracking:

  • Add the experimental keyword gutenberg-merg for tracking backports/syncs from Gutenberg into Core.
  • Set version to 5.8, which introduced wp_register_layout_support() function.
  • Remove "Backport" from summary for focusing on what is being introduced into Core.
  • Add more information in the description to the enhancement.

#2 follow-up: @isabel_brison
20 months ago

In looking at all the wp_render_layout_support_flag-related PRs in the list for backporting (https://github.com/WordPress/gutenberg/issues/47187), I'm noticing that the ones flagged for inclusion in this ticket build upon these other two:

Try adding layout classnames to inner block wrapper: https://github.com/WordPress/gutenberg/pull/44600 and
Layout: ensure block content is always returned as a string after processing: https://github.com/WordPress/gutenberg/pull/45330

and all of them ultimately depend on WP_HTML_Tag_Processor, the backport of which is still in progress(https://github.com/WordPress/wordpress-develop/pull/3920).

It might be best to backport them all as a single patch, otherwise we'll have to get the earlier ones done first and then partially undo those changes in the later ones. @hellofromTonya what do you think?

#3 in reply to: ↑ 2 @hellofromTonya
20 months ago

Replying to isabel_brison:

and all of them ultimately depend on WP_HTML_Tag_Processor, the backport of which is still in progress(https://github.com/WordPress/wordpress-develop/pull/3920).

Not sure yet when the HTML API will land. It's still in review and testing. I suspect it'll be next week and possibly close to the 6.2 Beta 1 before it might land.

It might be best to backport them all as a single patch, otherwise we'll have to get the earlier ones done first and then partially undo those changes in the later ones. @hellofromTonya what do you think?

I think in general it's okay if patches build upon each other. One of the ideas of early smaller backports is to gain a more atomic commit history rather than bundling a lot of changes into one commit.

With that said, I lean into your guidance of what you think is the best approach. You are much more familiar with the pieces of what needs to copied into Core and how the pieces fit together.

#4 @isabel_brison
20 months ago

I suspect it'll be next week and possibly close to the 6.2 Beta 1 before it might land.

What are the chances that it won't make it at this point? Because if it doesn't we might have a bit of a problem here :')

The layout controls for flex children are a must-have for 6.2. If there's any chance WP_HTML_Tag_Processor won't make it into Core, then we'll have to look into removing the dependency on it for this feature. I'm not sure at this point how easy that might be - will investigate and report back.

This ticket was mentioned in Slack in #core-editor by hellofromtonya. View the logs.


20 months ago

This ticket was mentioned in PR #3976 on WordPress/wordpress-develop by @isabel_brison.


20 months ago
#6

  • Keywords has-patch has-unit-tests added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/57584

Includes changes from:

which change the layout render filter to add layout classes to the inner block wrapper, instead of the outer, and

which change the layout render filter to allow inner blocks to receive layout classes and styles. This builds on the former changeset, which is why I thought it simpler to backport both pieces together.

I also added some tests for wp_render_layout_support_flag (from https://github.com/WordPress/gutenberg/pull/47719) and updated some of the server block fixtures because the change to add classnames to the inner block wrapper caused the order in which layout classes are added to switch.

#7 @flixos90
20 months ago

  • Owner set to flixos90
  • Status changed from new to reviewing
  • Type changed from enhancement to task (blessed)

@isabel_brison

The layout controls for flex children are a must-have for 6.2.

Changing this issue to a blessed task to indicate that it's critical for 6.2; this means we'll have a bit more time to get it merged into core. However, the WP_HTML_Tag_Processor has now been merged anyway, and I think https://github.com/WordPress/wordpress-develop/pull/3976 is almost good to go, so with one more iteration we can probably commit it sooner than later.

@isabel_brison commented on PR #3976:


20 months ago
#8

Thanks for the feedback folks! I've made all the requested changes, so this should be ready for another round.

@flixos90 commented on PR #3976:


20 months ago
#9

@tellthemachines I tried to fix the merge conflict in the fixtures with latest trunk here, hopefully I did it right 🤞

If there are test failures, I'll check and can hopefully fix it. Apologies, not really familiar with the fixtures.

@flixos90 commented on PR #3976:


20 months ago
#10

Noting that the test failures here are unrelated and intermittent, fixed via https://core.trac.wordpress.org/changeset/55280.

#11 @flixos90
20 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 55282:

Editor: Add layout controls to children of flex layout blocks.

Props isabel_brison, andrewserong, davidbaumwald, flixos90, mamaduka, ntsekouras, hellofromtonya.
Fixes #57584.

This ticket was mentioned in Slack in #core-performance by dmsnell. View the logs.


12 months ago

Note: See TracTickets for help on using tickets.