-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Added max-width to DataView columns #70983
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
Added max-width to DataView columns #70983
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @rcrdortiz! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Looks like you committed your personal |
Did you forget adding the fixes (the actual maxWidths...), I don't see it in the diff? |
It got deleted on my second commit, restored the actual fix. |
Yup, thanks for the tip! |
Let's add a dataviews CHANGELOG entry about this change. :) |
…ata without breaking the line
…te text length without breaking the text
Here is a video with what the Table Layout looks like with the most recent changes: latest-table-layout.mp4 |
I think this is worth a try. |
…use more space when the Table layout view has fewer fields
Okay, I've progressed more, but I'm trying to figure out what the best approach is now. I can keep the nowrap-templates.mp4nowrap-storybook.mp4This here is the main issue with not wrapping text: nowrap-issue.mp4When we wrap text, large tables become somewhat easier to read, and are better suited (marginally) to the available screen's real estate without requiring scrolling as much, and we avoid having long cells. The problem is that wrapping kicks in soon once we have a few fields. Here are some examples: wrap-templates.mp4wrapping-storybook.mp4I think I'm more inclined towards the nowrap approach, but we wouldn't be solving the main issue. If we have cells with large chunks of text, the table will look just as bad as it does now. I'm not sure if the changes I've made to the primary column are a good enough tradeoff. What do you all think? |
5c47188
to
2510737
Compare
@rcrdortiz I noticed that the approach was not working properly for primary columns (templates example). The columns was still increasing width as the size of the screen increased. The issue was that max/min width don't work well on td, th. Instead I pushed an alternative approach where I applied the min/max widths to the divs within the cells instead. Let me know what you think. |
Co-authored-by: André <583546+oandregal@users.noreply.github.com>
I'll have a look at @youknowriad changes and fix the issue. Update: Fixed the issue by excluding the media part of the primary column from having a min-width. |
IMHO, the looks-off.mp4
I'll change the max-width from 60 to 90. @youknowriad @jameskoster, please let me know if you have any complaints about it. |
I'll defer to @jameskoster about this, I've just used something that is closed to what we had before. |
Fair enough, feel free to merge the changes once we get confirmation from @jameskoster. |
I agree the empty space isn't ideal at a glance, but when it comes to actually reading the text, the narrower version is more widely legible, and that is what we should optimise for imo. 50-75 characters per line is a rule of thumb though. WCAG guidelines are to avoid exceeding 80, so I'd be happy with 80 or below. |
What?
We're adding a max-width to DataView columns to avoid having infinite-length columns.
Why?
The UI for Table DataViews looks broken when a field is really large, the text doesn't get split into multiple lines and we need to scroll to the end to see other columns.
How?
We're adding a max-width to the cells in the DataView's Table Layout.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast