List Tables: Keep columns readable with horizontal scrolling. - #13866
mattmiklic wants to merge 15 commits into
Conversation
Wrap list tables in a named, keyboard-focusable scrolling region and apply minimum widths to desktop text columns. Keep the outer border on the viewport and retain the existing mobile layout.
Retain the existing Comments column width as a desktop minimum so automatic table layout cannot shrink the header enough to wrap its sort arrows.
Overlay a subtle shadow at the inline end of desktop list-table viewports while content remains beyond that edge. Use a scroll-driven CSS animation so the shadow disappears at the end and stays hidden when the table fits. Preserve the existing layout in browsers without support and at mobile widths.
Control the edge shadow through native scroll and resize handling in `common.js` so it no longer depends on CSS scroll-driven animation support. Track right-to-left positions and refresh observers when AJAX replaces a table, while preserving the existing desktop layout and mobile styles.
Show a shadow at each edge when table content is hidden beyond it, including right-to-left layouts. Clamp scroll positions so fitting tables and elastic overscroll do not produce misleading shadows, and suppress horizontal rubber-banding with `overscroll-behavior-x: none` on the desktop wrapper.
Cover initialization, LTR and RTL scroll boundaries, resizing, and cleanup after table replacement. Exercise `common.js` through dedicated QUnit fixtures for normal and minified builds.
Replace edge shadows with full-height buttons that scroll to adjacent columns. Keep their chevrons centered in the visible table area, respect reduced-motion preferences, and return focus to the table when a focused control reaches its boundary. Extend the QUnit coverage for directional paging, labels, focus handling, icon positioning, and cleanup after table replacement. Preserve the existing mobile layout.
Draw focus indicators inside sortable links so the scroll viewport does not clip them. Move the high-contrast outline inward as well.
Keep list table wrappers in the tab order only when they provide horizontal scrolling. Preserve existing focus when overflow disappears, and restore the original `tabindex` attribute when overflow tracking ends. Add regression coverage for resizing, focus retention, visible overflow, and cleanup.
|
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 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. |
|
This has kept coming up for me constantly over the years, I've multiple friends and family I've helped with website, they install a single plugin and on their 14 inch laptops, their columns implode. A contextually available scrollbar feels like such a better choice. I would love if folks could give deep reviews of this one so we can land it. If not in 7.2 then 7.3—it's been an issue for a while and it's worth going straight at it. |
List tables can squeeze columns into an extremely narrow state when they need more space than the table has available. Plugins that add columns can leave little room for content like post titles, producing tall rows that are difficult to scan.
This adds a scrollable wrapper around the existing table. Above the existing mobile breakpoint, tables switch from fixed to automatic layout, with minimum widths for selected Core columns. When the columns exceed the available space, the wrapper scrolls horizontally. Filters, bulk actions, and pagination stay outside the wrapper.
The table's border moves to the new wrapper, and a fade to white inside it indicates that there is hidden content on the right edge. When scrolling, the fade appears on the left as well, when content is hidden on that edge. These are reversed for RTL content. JavaScript in
common.jsupdates the fades during scrolling, resizing, and when tables are replaced or refreshed in place, like when searching Plugins.When there is horizontal scrolling, the wrapper enters the Tab order so it can be focused and scrolled with the arrow keys. When a table's content fits in the viewport, the wrapper isn't included in the Tab order.
Screenshots
Narrow columns
With enough columns enabled, titles and headers become difficult to read. The updated table ensures readable column widths and scrolls to reveal the remaining content.
Columns that fit without scrolling
With fewer columns visible, the table fits without horizontal scrolling. Automatic layout gives the date column more room, reducing wrapping and row height in this example.
Content that prevents wrapping
Preformatted text, text forced onto one line, or a fixed-width widget previously overflowed outside their column, colliding with the content in any that follow. Now, that column expands to contain whatever is in it, and the horizontal scrolling contains it.
Testing
The included tests cover initialization, LTR/RTL scrolling, fractional positions and overscroll, resizing, keyboard focus, and cleanup when tables or wrappers are replaced or moved.
To test in the admin:
Trac ticket: https://core.trac.wordpress.org/ticket/52151
Use of AI Tools
AI assistance: Yes
Tool(s): Codex (ChatGPT)
Model(s): GPT-6 Astra
Used for: Developing and iterating on the implementation, writing regression checks and documentation, researching browser support, and assisting with code review.
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.