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

Changed the columns per row from 2 two 3 #14356

Closed

Conversation

antonis
Copy link

@antonis antonis commented Jun 19, 2020

Fixes wordpress-mobile/gutenberg-mobile#2384

Related PRs:

gutenberg WordPress/gutenberg#23314
gutenberg-mobile wordpress-mobile/gutenberg-mobile#2408

Description

This fix changes the number of blocks per line from two to three.
When more than two block rows are rendered we need to change the justify content of the parent block-list component to align the blocks at the beginning of the row.

How has this been tested?

Two columns

  • Create a columns block with columns columns
  • Make sure that you see two blocks in the row sharing the available space

Three columns

  • Create a columns block with more three columns
  • Make sure that you see three blocks in the row

Four columns

  • Create a columns block with more four columns
  • Make sure that you see three blocks in the first row and one in the second one aligned at the start

Generic Test Case

  • Create a columns block with more than two columns
  • Make sure that you see three blocks three blocks per full row and the remaining blocks are aligned at the start of the last row

Screenshots

Simulator Screen Shot - iPhone 11 - 2020-06-19 at 16 13 50
PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 19, 2020

You can test the changes on this Pull Request by downloading it from AppCenter here with build number: 30461. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@peril-wordpress-mobile
Copy link

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@iamthomasbishop
Copy link

Hey @antonis 👋 I took a look at the iOS test build and there is something wonky going on where the columns don't always line up properly if you start a new post/page in any breakpoint larger than the narrow single-column view (not sure what our exact breakpoint values are).

To reproduce this, create a new post or page in wider viewport (landscape iPhone or iPad) and note that you see 2 columns in a row, and the third column pushed to the next row.

Here is what I'm initially seeing when opening first on a wider viewport:

iPad iPhone (landscape)

However, if you rotate iPhone to portrait or adjust the iPad split-view to narrow and then back, the columns will have adjusted to the expected size. In other words:

  • ✅ Open in narrow shows 1 column (👍) => adjust to wider and see 3 columns per row (👍)
  • ❌ Open in wider shows misaligned columns (👎) => adjust to narrow and see 1 column (👍) => adjust back to wide and see 3 columns per row (👍)

@antonis
Copy link
Author

antonis commented Jun 19, 2020

Hello @iamthomasbishop 👋. Thank you for the quick feedback on this 😊.
I will investigate the reported behavior and get back to you. The wrong rendering when starting in large breakpoint is probably already fixed by WordPress/gutenberg#23305

@iamthomasbishop
Copy link

The wrong rendering when starting in large breakpoint is probably already fixed by WordPress/gutenberg#23305

Ah okay, good to know!

@antonis
Copy link
Author

antonis commented Jun 26, 2020

Hello @iamthomasbishop 👋
Sorry for the late response on this. I was hoping to provide you a build but this was delayed due to the monorepo update.
Fortunately the bugs you reported seem to be fixed now by WordPress/gutenberg#23305

I'm attaching some screenshots depicting how the columns block renders in large breakpoint. Let me know if this is the expected way.

A. Large breakpoint with two columns
Simulator Screen Shot - iPhone 11 - 2020-06-26 at 17 45 00
B. Large breakpoint with three columns
Simulator Screen Shot - iPhone 11 - 2020-06-26 at 17 45 42
C. Large breakpoint with four columns
Simulator Screen Shot - iPhone 11 - 2020-06-26 at 17 54 57
D. Large breakpoint with five columns
Simulator Screen Shot - iPhone 11 - 2020-06-26 at 17 54 50

Regarding D and in general when we have two columns after the first row an alternative would be the one bellow.

E. Alternative layout for large break point with five columns
Simulator Screen Shot - iPhone 11 - 2020-06-26 at 17 49 37

We can probably also split the space evenly between the columns but extra implementation is needed for this.

Wdyt?

@iamthomasbishop
Copy link

@antonis This is closely related to the other work we're doing (with @lukewalczak) on Columns, so perfect timing! I think all of the layouts you showed in your screenshots look correct up to D -- which looks correct for five columns.

@antonis
Copy link
Author

antonis commented Jul 13, 2020

Gutenberg PR merged WordPress/gutenberg#23314

@antonis antonis closed this Jul 13, 2020
@jkmassel jkmassel deleted the issue/2384-Set_column_per_row_limitation_to_3 branch July 26, 2024 18:19
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.

2 participants