WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

DataViews grid layout: Long pattern names are cut off #65134

Open carolinan opened 1 week ago

carolinan commented 1 week ago

Description

Under Appearance > Editor > Patterns, long pattern names are cut off when the grid layout is used. The grid layout is the default. I expect the full name to be visible.

I have searched but was not able to find an existing issue for this, happy to close this if one is found.

Step-by-step reproduction instructions

Create a new pattern with the name "Blog posts for the right aligned blog". View the grid layout on the Patterns screen under Appearance > Editor > Patterns. Confirm if you can see the full name.

Screenshots, screen recording, code snippet

The screenshots show the Patterns screen with the grid layout active.

image image image

Environment info

WordPress 6.6.1 Gutenberg current trunk.

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

t-hamano commented 1 week ago

When the text is long, an ellipsis should be displayed as shown below:

image

Therefore, the current display is considered a bug, and it is possible to fix it.

However, I agree that using ellipsis makes long pattern titles hard to read.

@WordPress/gutenberg-design

What do you think about not clipping the text, for example like this:

image

I think it's also possible to limit the title to two lines without showing the entire title.

jasmussen commented 1 week ago

I'd defer to @jameskoster as he's thought quite a lot about this. But one instinct is that two-lines at most, with ellipsis cutoff before three lines, would be okay if it doesn't affect the row as a whole, i.e. so long as the 2nd row of items in the view still lines up horizontally.

jameskoster commented 1 week ago

Iirc the titles are truncated to a single line to ensure fields are aligned along the x axis, avoiding this:

Screenshot 2024-09-10 at 13 11 44

I don't have a strong opinion about whether that's more important than the titles being fully visible.

jasmussen commented 1 week ago

I'd tend to think the added legibility might be worth it in this case. Also not a strong opinion.