fix(newspack-plugin): keep admin list-table Title from collapsing#595
Draft
jason10lee wants to merge 6 commits into
Draft
fix(newspack-plugin): keep admin list-table Title from collapsing#595jason10lee wants to merge 6 commits into
jason10lee wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a small admin-only CSS intervention in newspack-plugin to prevent the Title column in WP admin post/page list tables from collapsing to an unreadable sliver when many extra columns are enabled (typically from third-party plugins). It does this by switching the table to table-layout: auto on targeted screens and enforcing a minimum width for the primary column at desktop breakpoints.
Changes:
- Add
Newspack\Admin_List_Table_Layoutto emit scoped admin CSS on matching list-table screens. - Load the new helper from the main Newspack include bootstrap.
- Add unit tests covering screen matching, CSS emission, and min-width validation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| plugins/newspack-plugin/includes/class-admin-list-table-layout.php | New helper that determines eligible screens and outputs desktop-scoped CSS to keep the primary column readable. |
| plugins/newspack-plugin/includes/class-newspack.php | Loads the new helper as part of the plugin bootstrap includes. |
| plugins/newspack-plugin/tests/unit-tests/test-admin-list-table-layout.php | Adds unit tests for screen matching behavior, CSS emission, and min-width filter validation. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Admin list-table screens (Posts/Pages) render the Title column as an unreadable sliver — text stacking one character per line — once enough columns are visible.
Cause: WP admin list tables use
table-layout: fixed, so when many plugins add columns and the declared widths over-subscribe 100%, the width-less Title column is squeezed toward 0px. The width hogs are typically third-party (SEO score/readability, analytics views, consent scan, multi-author) rather than Newspack's own columns — so the fix must be agnostic to which columns trigger it.This adds
Newspack\Admin_List_Table_Layout, which switches Newspack's list-table screens (post/pageby default, plus aregister_screen()/newspack_admin_autolayout_screensfilter surface) totable-layout: autowith amin-width: 35chfloor on the primary column, desktop-scoped (min-width: 783px). Underauto, no column can be starved to 0 regardless of which plugin added it. Screen matching is base-gated (editvsedit-tags) so the Categories/Tags term screens are untouched.Closes NPPM-2989
How to test the changes in this Pull Request:
Other information:
UI-only / non-functional change on a shared admin surface. Verified via multi-model review (design + code) and a live-env A/B (fix on → legible + horizontal scroll on extreme loads; fix off → Title collapses to ~32px). Cross-repo impact review: clean (self-contained to
newspack-plugin). Cross-browser: verified in Chromium; Firefox/Safari spot-check pending. Trade-offs: horizontal scroll on extremely crowded screens (strictly better than collapse, and bounded by the Screen Options mitigation support already recommends); mild column-width variation on sparse tables.