Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid Layout Improvements #57478

Open
14 of 37 tasks
tellthemachines opened this issue Jan 2, 2024 · 14 comments
Open
14 of 37 tasks

Grid Layout Improvements #57478

tellthemachines opened this issue Jan 2, 2024 · 14 comments
Assignees
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Type] Iteration Scoped iteration of an effort from a tracking issue or overview issue ideally for a major release.

Comments

@tellthemachines
Copy link
Contributor

tellthemachines commented Jan 2, 2024

Part of Design Tools overview and Layout improvements.

The Grid layout type shipped in WP 6.3 and in WP 6.6 a new Grid variation for the Group block was stabilised, along with support for grid children spanning multiple columns and rows, and on-canvas resize handles.

What's this currently look like?

Under Gutenberg > Experiements, enable "Grid interactivity".

When a Grid block is set to Manual mode (in the block sidebar under Layout), it's now possible to drag and drop blocks into specific grid cells, as well as moving them up, down, left and right with the movers:

moving-blocks-around.mp4

Tasks

Needed before we remove experimental flag

Needed for 6.7

Nice to have

@tellthemachines tellthemachines added [Type] Enhancement A suggestion for improvement. [Feature] Layout Layout block support, its UI controls, and style output. labels Jan 2, 2024
@SaxonF
Copy link
Contributor

SaxonF commented Jan 3, 2024

Quick sketch showing what a next iteration of grid might look like. Keeping in mind we still want to push layout forward in general including generic width/height options via #53455.

image

Children fill width/height of column/row by default. I'm showing width/height controls just to illustrate they are different to span and can be included in the separate layout work. We can start with inspector controls and work our way towards on canvas manipulation, including start/end of grid items which can lead to overlapping blocks.

@paaljoachim
Copy link
Contributor

Some free flowing thoughts....
Can we have one grid system that can be used by the Cover block, Group block. Columns block etc? (with some minor adjustments where needed.)

I say this as the "Change Content Position" inside the Cover block can use a nice upgrade. Having one grid system used between the various blocks would be very helpful.

In relation to grid. It would also be helpful to have an icon to turn on/off helper lines. Somewhat like InDesign/Photoshop one can turn on the grid lines to see how things line up.

@tellthemachines
Copy link
Contributor Author

Thinking through what's needed here in light of #58539:

  • Grid children spanning multiple columns with the "auto" grid setting will need some sort of responsive behaviour so the grid doesn't break at smaller breakpoints (see suggestion)
  • The ability to position a child in/starting from a specific column or row (this should only work for the "manual" grid, given that with the "auto" grid column number varies depending on container width) - could be an "offset" input control?
  • Positioning grid items with drag and drop: the drop indicators when dragging over a grid block could show a block dropzone over empty columns.
  • Changing column and row span of grid items with drag to resize
  • Regarding subgrids: they can be made to work for direct descendants of a block with grid layout fairly easily.

it would be interesting to experiment with making the grid configuration match theme content and wide width settings

I played around with this a bit and it doesn’t seem possible to match the current behaviour of content and wide layouts with grid. In any case there’s no real gain in replacing the content sizing and alignment logic with a grid-based implementation.

@noisysocks
Copy link
Member

noisysocks commented Feb 7, 2024

  • Positioning grid items with drag and drop: the drop indicators when dragging over a grid block could show a block dropzone over empty columns.
  • Changing column and row span of grid items with drag to resize

👋 I'm going to try and build a prototype of this stuff.

@noisysocks noisysocks added [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues and removed [Type] Enhancement A suggestion for improvement. labels Feb 27, 2024
@noisysocks
Copy link
Member

@tellthemachines, @SaxonF and I are actively working on this. I updated the issue to be an overview issue and added a few tasks that we've discussed.

#59052 added a new Grid interactivity experiment which you can enable in Gutenberg → Experiments. Currently you can visualise where the grid cells are when you select a Grid block and use a resize handle to set the span of a block within the Grid. I'm looking into drag and drop now.

@andrewserong
Copy link
Contributor

Quick update for anyone following along this tracking issue: with the outstanding interactivity issues now addressed, the grid visualiser and resizers have been stabilised for Gutenberg 18.4, which means folks will be able to try out dragging Grid child blocks to set column and row span, without having to activate the interactivity experiment in the plugin. There are still some pending visual enhancements to explore, but I believe it looks like the feature should now be in the overall shape that it’s intended to be for WP 6.6.

@tellthemachines
Copy link
Contributor Author

Update on grid work

In the past few weeks, most of the functionality intended to ship in 6.7 has been put in place behind the "grid interactivity" experiment flag:

  • Manual mode has been updated to always explicitly place blocks in a column/row, allowing any block to be moved to any grid cell. This also allows blocks to overlap or partially overlap (in the case of blocks that take up multiple grid cells).

  • It's now possible to specify both "Columns" and "Minimum column width" in both Auto and Manual modes. Specifying "Columns" and "Minimum column width" together allows grids to have a maximum column count and resize to less columns in smaller areas.

  • This means that the difference between Auto and Manual modes is now only in the placement of grid children:

    • Auto mode relies on auto-placement, so it's not possible to specify a grid cell for a particular block. New blocks are placed in the first available cell in the grid.
    • In Manual mode, all blocks are manually placed, so new blocks can be placed in a specific cell, and there can be empty cells in the middle of the grid. In this mode, block appenders are shown on hover/focus in each empty cell and blocks can be dragged and dropped into any cell, whether empty or full.

Next steps

Testing of these new features is highly appreciated!

There are a few small bugs and enhancements outstanding (see list in issue description), and once they are fixed, the new Manual grid should be in a good place to stabilize in the plugin.

There's also the alignments feature which would be nice to have in 6.7, but needs some design work first: #62895

@noisysocks noisysocks moved this to 📋 Iteration/Tracking Issues in WordPress 6.7 Editor Tasks Jul 23, 2024
@noisysocks noisysocks changed the title Improvements to Grid Layout Grid Layout Improvements for 6.7 Jul 26, 2024
@noisysocks
Copy link
Member

Did a bit of housekeeping here 🧹

I've:

  • asked a couple of my colleagues for feedback on this feature and opened a few new issues with what they wrote back to me.
  • converted every To do item in the issue description into an issue containing a brief explanation of the task.
  • triaged the issue description into Needed before we remove experimental flag, Needed for 6.7, and Nice to have.

My hope is that it's now much clearer how other contributors can help with development. @tellthemachines is away until October, so any help is much appreciated 🙂

@talldan talldan added [Type] Iteration Scoped iteration of an effort from a tracking issue or overview issue ideally for a major release. and removed [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. labels Jul 31, 2024
@noisysocks noisysocks assigned talldan and unassigned SaxonF and tellthemachines Aug 9, 2024
@noisysocks noisysocks moved this from 📋 Iteration/Tracking Issues to 🏈 Punted to 6.8 in WordPress 6.7 Editor Tasks Aug 29, 2024
@noisysocks
Copy link
Member

Very unlikely this will make it into 6.7 – I've punted it in the project board.

peterwilsoncc added a commit that referenced this issue Sep 3, 2024
Moves the backport changelog file for WordPress/wordpress-develop#6910 from the WordPress 6.7 directory to the WordPress 6.8 directory. These changes are now targeted for a future release and do not need to be merged in to WordPress 6.7 as part of the package update.

See #57478.

Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
@t-hamano
Copy link
Contributor

Could anyone provide additional feedback on #64995, which solves one problem in RTL languages?

@noisysocks noisysocks changed the title Grid Layout Improvements for 6.7 Grid Layout Improvements Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Type] Iteration Scoped iteration of an effort from a tracking issue or overview issue ideally for a major release.
Projects
Status: In Dev
Status: 🏈 Punted to 6.8
Status: 📋 Iteration/Tracking Issues
Development

No branches or pull requests

8 participants