Skip to content

fix(newspack-plugin): keep admin list-table Title from collapsing#595

Draft
jason10lee wants to merge 6 commits into
mainfrom
fix/nppm-2989-admin-list-table-autolayout
Draft

fix(newspack-plugin): keep admin list-table Title from collapsing#595
jason10lee wants to merge 6 commits into
mainfrom
fix/nppm-2989-admin-list-table-autolayout

Conversation

@jason10lee

Copy link
Copy Markdown
Contributor

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/page by default, plus a register_screen() / newspack_admin_autolayout_screens filter surface) to table-layout: auto with a min-width: 35ch floor on the primary column, desktop-scoped (min-width: 783px). Under auto, no column can be starved to 0 regardless of which plugin added it. Screen matching is base-gated (edit vs edit-tags) so the Categories/Tags term screens are untouched.

Closes NPPM-2989

How to test the changes in this Pull Request:

  1. On a Posts list with several columns enabled — e.g. an SEO plugin's score/readability columns, an analytics "views" column, a consent "scan" column — open Posts at desktop width (≥783px) and note the Title column collapsing / text stacking vertically.
  2. With this change active, reload: the table switches to content-based layout — Title (and every column) stays legible; on extremely crowded screens the table scrolls horizontally instead of collapsing.
  3. Confirm the Categories and Tags term screens are unaffected (no layout change).

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable? (14 unit tests: screen matching incl. the term-screen leak guard, emission, min-width validation)
  • Have you successfully run tests with your changes locally? (14/14 passing; phpcs clean against the root ruleset)

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.

jason10lee and others added 4 commits July 9, 2026 12:12
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>
Copilot AI review requested due to automatic review settings July 9, 2026 19:28
@jason10lee jason10lee self-assigned this Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_Layout to 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.

Comment thread plugins/newspack-plugin/includes/class-admin-list-table-layout.php Outdated
Comment thread plugins/newspack-plugin/includes/class-admin-list-table-layout.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants