Repository navigation
List Tables: Keep columns readable with horizontal scrolling. - #13866
mattmiklic wants to merge 38 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. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
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. |
ciampo
left a comment
There was a problem hiding this comment.
I don't have further feedback, although I'd feel safer if other folks tagged for review also gave it a look.
|
@westonruter just for awareness -- based on the feedback from @jasmussen I removed the in-cell scrolling when there's plugin-generated wide content in a comments row. The logic is that it's enough of an edge case to leave out unless we discover a real-world case where it's an issue -- the cases I designed for initially were theoretical. There should be plenty of time for this to be tested and iterated upon if it's needed. Let me know if you disagree or have any other feedback here! |
|
I'd love to get this in as early as possible in the 7.3 cycle, so I pinged a few folks! Thank you all for looking. |
Match the fade on the wp-admin list tables (WordPress/wordpress-develop#13866), so both tables show the same cue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a sticky fade cell at the start of every row, mirroring the one at the end of tables without actions, so the columns scrolled past the start fade into the row's background as on the wp-admin list tables (WordPress/wordpress-develop#13866). At the start of the scroll range the cell only covers its own space, so it needs no scroll state. The cell is as wide as the first column's start padding and takes its place, so the first column stays where it was. It is narrower than the trailing fade for that reason. The header button of the first column pulls back by its own padding to keep its label lined up with the cells. The cell gets its own column in the colgroup so the column widths do not shift, and sits below the sticky header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the fade on the wp-admin list tables (WordPress/wordpress-develop#13866), so both tables show the same cue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a sticky fade cell at the start of every row, mirroring the one at the end of tables without actions, so the columns scrolled past the start fade into the row's background as on the wp-admin list tables (WordPress/wordpress-develop#13866). At the start of the scroll range the cell only covers its own space, so it needs no scroll state. The cell is as wide as the first column's start padding and takes its place, so the first column stays where it was. It is narrower than the trailing fade for that reason. The header button of the first column pulls back by its own padding to keep its label lined up with the cells. The cell gets its own column in the colgroup so the column widths do not shift, and sits below the sticky header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the fade on the wp-admin list tables (WordPress/wordpress-develop#13866), so both tables show the same cue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a sticky fade cell at the start of every row, mirroring the one at the end of tables without actions, so the columns scrolled past the start fade into the row's background as on the wp-admin list tables (WordPress/wordpress-develop#13866). At the start of the scroll range the cell only covers its own space, so it needs no scroll state. The cell is as wide as the first column's start padding and takes its place, so the first column stays where it was. It is narrower than the trailing fade for that reason. The header button of the first column pulls back by its own padding to keep its label lined up with the cells. The cell gets its own column in the colgroup so the column widths do not shift, and sits below the sticky header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use a 24px gradient at each overflowing edge so row backgrounds and dividers help reveal hidden content. Remove the per-row fade-color overrides.
|
I've updated this PR to match the implementation from (WordPress/gutenberg#86829), with a 24px fade and extending the fade to the dividers between rows as well. @jasmussen @jameskoster this led me to revisit one question. I'd previously made the text fade but not the row background color, which aesthetically looked nicer but has the problem of not clearly indicating there's hidden content when there's not content visibly being clipped by the edge. For that reason I returned to the fade to white. Let me know if you have differing opinions though. Posts
Comments
|
|
I like the after, even if it's a subtle change. But I also think it's one of those things where this is worth shipping, because there's always another train for iterating based on feedback. |
Match the fade on the wp-admin list tables (WordPress/wordpress-develop#13866), so both tables show the same cue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a sticky fade cell at the start of every row, mirroring the one at the end of tables without actions, so the columns scrolled past the start fade into the row's background as on the wp-admin list tables (WordPress/wordpress-develop#13866). At the start of the scroll range the cell only covers its own space, so it needs no scroll state. The cell is as wide as the first column's start padding and takes its place, so the first column stays where it was. It is narrower than the trailing fade for that reason. The header button of the first column pulls back by its own padding to keep its label lined up with the cells. The cell gets its own column in the colgroup so the column widths do not shift, and sits below the sticky header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Allow URLs in descriptions and email addresses to wrap without pushing neighboring columns offscreen. Set the Plugins screen reader headings when preparing the list so live search returns the same accessible name as the initial page. Exercise overflow fades with the generated RTL styles and compare inline editing rows with the outer edges of the columns they span.
|
@ciampo thanks for the review! Good catches. I've just pushed these changes:
|
| .wp-list-table-scroll > .fixed .column-slug *, | ||
| .wp-list-table-scroll > .fixed .column-locations, | ||
| .wp-list-table-scroll > .fixed .column-locations * { | ||
| overflow-wrap: anywhere; |
There was a problem hiding this comment.
In Media Library list view, a long URL used as the parent post title widens the “Uploaded to” column and pushes Date offscreen. Could we include .column-parent and its descendants in this wrapping rule and add it to the existing long-link test?
Give custom taxonomy columns the same `10em` minimum width as Categories and Tags so long terms can wrap while the column stays readable.
| * | ||
| * @since 7.2.0 | ||
| */ | ||
| jQuery( () => { |
There was a problem hiding this comment.
Can we use DOMContentLoaded and avoid using jQuery here?
| /** | ||
| * Manages overflow indicators and keyboard access for list tables. | ||
| * | ||
| * @since 7.2.0 |
There was a problem hiding this comment.
since notations should now be 7.3.0
|
Thanks for the effort here, I can tell this is a big improvement! I ran some automated accessibility testing on the PR with VoiceOver in Chrome and Safari, before and after the PR, on a site with six extra plugin columns on Posts. I'd love a manual review from @joedolson as well, I'm not certain the flagged issues are valid or worth fixing, eg. the no-js one. Captured screencasts are below in the details section. Claude drove VoiceOver through each scenario and wrote up what it heard:
ScreencastsDetails
safari-table-nav-posts.mp4
vo-table-nav-posts.mp4
heading-region-posts.mp4
walk-plugin-tables.mp4
tab-fitting-comments-nojs.mp4
|





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
Many 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.