Fix mobile list tables 65743 - #12737
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @nazmulasif. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
I'm confident there are still things missing here, but it's functional, and ready for review. This switches the responsive layout to use flex. It will need some polish on padding; I'm somewhat of the opinion that losing the space to the left, under the checkbox, is actually a good thing, as it gives a bit more width for the additional text. |
|
Reviewed in Playground. All issues seem resolved. I'm still getting used to the collapse of space under the checkbox, but I'm OK with it. |
| border-left: 4px solid var(--wp-admin-theme-color); | ||
| } | ||
|
|
||
| @media screen and ( width < 782px ) { |
There was a problem hiding this comment.
| @media screen and ( width < 782px ) { | |
| @media screen and (max-width: 782px) { |
These styles probably belong within the existing max-width media query later in the file, but the query should include 782.
|
Patch Test Report Patch - https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/12737.diff I tested this issue on trunk using WordPress Playground across narrow/mobile viewports. Testing Results
Observations
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (5)
src/wp-admin/css/list-tables.css:1999
- This selector now applies the
data-colnamepseudo-label to the primary column as well, but the primary cell does not get the matching left padding (only sibling cells after the primary do). That can cause the label to overlap the primary cell’s content. Excluding.column-primaryrestores the intended behavior (label only for secondary cells).
.wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column)::before {
src/wp-admin/css/list-tables.css:1338
- This media query uses the Media Queries Level 4 range syntax (
width < 782px), which is inconsistent with the rest of wp-admin CSS (e.g.@media screen and (max-width: 782px)later in this file) and also excludes the exact 782px breakpoint. Usingmax-width: 782pxkeeps the established breakpoint and avoids support/consistency issues.
@media screen and ( width < 782px ) {
src/wp-admin/css/list-tables.css:1963
align-contenthas no effect here because.wp-list-table thead this a flex item (thetris the flex container), not a flex container. If the intent is vertical centering within the flex row,align-selfis the applicable property.
.wp-list-table thead th {
align-content: center;
}
src/wp-admin/css/list-tables.css:1363
- Inside this mobile breakpoint, the existing left accent on active plugins is cleared on the check-column cells and moved to
tr.active/.plugin-update-tr.active. Borders ontrare not reliably rendered for HTML tables, so the accent can disappear. Keeping the border on the check-column cells matches the existing pattern used elsewhere in this file (e.g.tr.paused ... .check-column).
This issue also appears on line 1999 of the same file.
.plugins .active th.check-column,
.plugins .active td.check-column,
.plugin-update-tr.active td {
border-left: 4px solid transparent;
}
src/wp-admin/css/list-tables.css:1978
- This
nth-child(n+3)rule assumes every list table row has a checkbox column + primary column. Core list tables can omit the checkbox column (e.g.WP_Comments_List_Tablewhen$this->checkboxis false), which would prevent the first non-primary details column from stacking full-width when expanded. Targeting non-primary/non-checkbox cells by class is more robust.
.wp-list-table tr td:nth-child(n+3) {
flex: 0 1 100%;
}
|
Besides @sabernhardt's suggestion, I noticed only a few minor things that I'd consider optional to fix. This PR solves the main issue and looks good. Personally, I'm OK with the removal of the space under the checkbox. 1
2
3 The checkbox of the active plugins is no longer horizontally aligned with the other checkboxes:
4 Pre-existing issue, can be reproduced on 7.0 too: in the Plugins table, the padding of the cell for the checkbox in the table header is different compared to the one for the Posts table. This impacts the alignment of the checkbox with the th text 'Plugin':
Maybe only 3), the horizontal alignment of the active plugins checkbox, is worth fixing. |




Work in progress
Trac ticket: https://core.trac.wordpress.org/ticket/65743
Use of AI Tools
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.