Make WordPress Core

Opened 4 years ago

Last modified 12 days ago

#52151 accepted defect (bug)

Post / Page Title Columns broken

Reported by: pascoedj's profile pascoedj Owned by: audrasjb's profile audrasjb
Milestone: 6.8 Priority: normal
Severity: normal Version: 5.6
Component: Administration Keywords: has-patch
Focuses: css Cc:

Description

The posts screen in wp-admin is wrapping the post title vertically so that the page becomes unreadable.

WordPress 5.6 running WP-Blossom theme.

screen cap here
https://1drv.ms/u/s!As8R6Nv2QLWnk9MRrGAJmuNIJ1QDoA?e=dcHWT7
sorry couldn't work out how to upload image ....
https://1drv.ms/u/s!As8R6Nv2QLWnk9MRrGAJmuNIJ1QDoA

Attachments (9)

wp-title-wrap-vertical.png (148.1 KB) - added by pascoedj 4 years ago.
52151.diff (398 bytes) - added by sabbirshouvo 3 years ago.
fix for broken title column in posts & pages admin list table
Screenshot at Oct 18 01-14-08.png (153.0 KB) - added by sabbirshouvo 3 years ago.
Issue test 1
Screenshot at Oct 18 01-14-08.2.png (153.0 KB) - added by sabbirshouvo 3 years ago.
Issue test 2
Screenshot at Oct 18 01-14-21.png (158.8 KB) - added by sabbirshouvo 3 years ago.
Issue test 2
test-with-issue.png (280.8 KB) - added by sylvainnascimento 5 weeks ago.
Test with issue
test-with-patch.png (389.8 KB) - added by sylvainnascimento 5 weeks ago.
Test with patch
test-pr-6226.png (219.0 KB) - added by ltrihan 5 weeks ago.
wp-list-table-wrapper.png (210.8 KB) - added by ltrihan 5 weeks ago.

Download all attachments as: .zip

Change History (39)

#1 @pascoedj
4 years ago

I should add that if I select Drafts(X) to show just the drafts, it works fine, but when I select All(X) the bug shows again. The post breaking the display is a draft.

#2 @sabernhardt
4 years ago

  • Component changed from General to Administration
  • Focuses css added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

@pascoedj Thanks for the report!

The Title column does not have a set width, and I think it needs a min-width. Categories and Tags columns are 15%, Author is 10%, Comments is 5.5em, etc. So having multiple columns added by plugins can make the Title column very narrow.

When looking at Draft posts only, you probably have fewer columns. Until this is fixed, I'd recommend opening Screen Options (at the top) and unchecking any columns you don't need to show.

#3 @mrfoxtalbot
3 years ago

I have also noticed that this is NOT happening when drafts are listed, but I am not sure why.

As @sabernhardt pointed out, the title column needs a minimum width.

#4 @sabernhardt
3 years ago

  • Milestone changed from Future Release to 5.9

Setting min-width did not work for me with the table-layout: fixed, but there could be a better way.

#5 @sabernhardt
3 years ago

#53720 was marked as a duplicate.

#6 @costdev
3 years ago

From what I can see, there are four options:

  1. Add a width to the title (such as 15/20%) - This will result in other columns being wrapped.
  2. Add overflow: hidden, text-overflow: ellipsis, and width: XXXpx to .fixed .column-title, truncating the title to Visible part of titl..., which will also need a title attribute added to the link so that users can hover over to see the full title.
  3. Remove table-layout: fixed from .wp-list-table - This will reduce rendering performance for large tables, in addition to adding a horizontal scrollbar when there are a larger number of columns.
  4. Accept that issue is caused by the number of columns and manage the column count using Screen Options.

Short of additional ideas, I would imagine that the availability of Screen Options allows most users to resolve this issue to their satisfaction, and those with specific needs have one of the other options above.

However, if the core aspect of this issue is that title in particular should never be wrapped and this is a case of tidying up, I think the first option above could be a desirable solution.

Last edited 3 years ago by costdev (previous) (diff)

#7 @mrfoxtalbot
3 years ago

I would also favor the first option you suggest, @costdev. Titles are probably the most important piece of information and the one that tends to be longer so we should prioritize it.

Also, I wonder why titles do not wrap when drafts are listed and whether we should follow that "glitch" for a possible solution.

#8 @costdev
3 years ago

Hi @mrfoxtalbot I've tried switching to "Drafts" and adding in some extra columns, but I still get the wrapping issue.

Can you tell me the setup that you have when "All" wraps the title but "Drafts" doesn't?

  • WP version
  • Active theme
  • Active plugins
  • The columns you have displaying (in order left-to-right)
  • A sample post title that doesn't wrap for you on the "Drafts" page

Thanks!

#9 @sabernhardt
3 years ago

The (main) difference between Drafts and All is the Comments column.

Setting a 15-20% width on the Title column can help with extra columns, but in a default installation, that can make the checkbox column wider.

#52426 is a very similar ticket, and I probably should have closed that one so the discussion there would be included here. Any change would affect both.

#10 @costdev
3 years ago

@sabernhardt Between the CSS solution provided in the related ticket, the 15-20% width on the Title column, and the other solutions mentioned in this ticket, which (if any) seems to move us in the best direction in your opinion, including any accessibility concerns you may have?

I can submit a PR with the solution that seems most appropriate right now and we can put it out for further feedback.

#11 @sabernhardt
3 years ago

If we adjust the column width values, I'm not sure which is the best method. I think a change that helps in one case can be worse than the current layout in another.

Overall, removing the percentage widths from columns (including Date and/or Author, Categories and Tags) might be better than the other options. We may still want to define a width for the Title column in the Extended view:

.fixed.table-view-excerpt .column-title {
    width: 20%;
}

If there is a way to count the shown columns, then keeping the current percentage widths could be better when few columns display.

Truncating the title would be an accessibility/usability concern, but the other suggested solutions are likely no less accessible than a crowded table in the current layout.

#12 @sabernhardt
3 years ago

#52426 was marked as a duplicate.

#13 @lospeso
3 years ago

  • Summary changed from post title broken on posts screen to Post / Page Title Columns broken

For the sake of reference and confirmation there is an issue how WordPress styles the columns in the Post and Page list.

So, for the benefit of this ticket, I copied the content from my other ticket (52426) and post it here since my ticket was closed and referred to this ticket here.

Below: My Report On Columns Widths Issue / Post-Page List

The width of the columns in the Post or Page table list is causing display issues in WordPress. This is especially when plugins, like Yoast, add columns.

The current CSS WordPress uses to display the table list of post or pages ends up creating a poor column layout display because it is trying to restrict the column widths.

The CSS is coming from this WordPress File:

/wp-admin/load-styles.php

These are the "ISSUE" CSS entries:

.fixed .column-author, .fixed .column-format, .fixed .column-links, .fixed .column-parent, .fixed .column-posts {
    width: 10%;
}
.fixed .column-categories, .fixed .column-rel, .fixed .column-response, .fixed .column-role, .fixed .column-tags {
    width: 15%;
}
.fixed .column-date {
    width: 14%;
}

Here is the CSS "FIX" I applied:

.fixed .column-author, .fixed .column-format, .fixed .column-links, .fixed .column-parent, .fixed .column-posts {
width: auto !important;
}
.fixed .column-categories, .fixed .column-rel, .fixed .column-response, .fixed .column-role, .fixed .column-tags {
width: auto !important;
}
.fixed .column-date {
width: auto !important;
}

I had use "Important" because I applied the fix using a browser extension called "Stylus", which allows me to use Custom CSS and apply it to any page the browser displays.

I tested this fix in other WordPress installations and the fix works fine.

The issue is certain columns were given widths of a certain size, instead of allowing the browser to automatically adjust the columns.

You can see the difference in the screenshots I created and named them accordingly (Issue & Fix) to match the above CSS I posted.

Screenshot Images:
(1) 20210102-ISSUE-Current-Columns-Width-Post-List-Page.jpg
See Here: https://prnt.sc/y1r9nc

(2) 20210102-FIX-Current-Columns-Width-Post-List-Page.jpg
See here: https://prnt.sc/y1rd5i

Hope this helps.

Thank-you.

PS: a note to the original poster to this ticket "pascoedj"
He mentioned he did not know how to provide a screenshot capture image.

If he happens to read this, you don't have to upload the image to any ticket here.
The simple method is use a free screenshot image upload provided on the Internet.

I use this one: "Lightshot" > URL: https://prnt.sc

Upload your screenshot there, then get the URL they give you to view the upload.

It is free.

The screenshots I provided above shows that example.

Lightshot works far better than using your OneDrive access and you don't have to worry about when to end the access link to the image, you can leave it at Lightshot permanently.

Last edited 3 years ago by lospeso (previous) (diff)

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 years ago

#15 @sabbirshouvo
3 years ago

I know it's an old ticket. But the same issue still exists. In order to easily regenerate the issue, you only need to install the "Ninja Popup" plugin which is a third-party paid plugin. I had a copy of the plugin and tested it with that. Along with Ninja Popup, I've also installed and enabled the Yoast SEO plugin to make sure the issue always happens.

Ninja popup forcefully occupying 20% of the space in the table & the title column doesn't have a width value like other columns, which is the main reason behind this issue.

Now as we identified the issue if we approach a fix using min-width it won't work. Post/Page listing tables are fixed with and min-width max-width doesn't work well with this. It's a CSS issue since CSS 2.1

for this specific scenario, a solution could be applying table-specific CSS to make sure the Title column gets a fixed width. But this will break the auto-expanding of the title column while there is less column.

I'll be adding a patch for table specific CSS for Posts & Pages table.

@sabbirshouvo
3 years ago

fix for broken title column in posts & pages admin list table

#16 @sabbirshouvo
3 years ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #core-css by sabernhardt. View the logs.


3 years ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 years ago

#19 @audrasjb
3 years ago

  • Milestone changed from 5.9 to Future Release

As per today's Core bug scrub and last week's CSS scrub, let's move this patch to Future Release as it still needs a design and technical decision.

#20 @sabernhardt
8 months ago

#60691 was marked as a duplicate.

This ticket was mentioned in PR #6226 on WordPress/wordpress-develop by @D SIGNED.


4 months ago
#21

  • REMOVED: fixed value for table-layout
  • ADD: min-width to title column

Edit : New Trac ticket: https://core.trac.wordpress.org/ticket/52151

#22 @audrasjb
4 months ago

  • Milestone changed from Future Release to 6.7

#23 @audrasjb
4 months ago

  • Owner set to audrasjb
  • Status changed from new to accepted

This ticket was mentioned in Slack in #core-test by ankit-k-gupta. View the logs.


3 months ago

This ticket was mentioned in Slack in #core by stoyangeorgiev. View the logs.


2 months ago

@sylvainnascimento
5 weeks ago

Test with issue

@sylvainnascimento
5 weeks ago

Test with patch

@ltrihan
5 weeks ago

#26 @ltrihan
5 weeks ago

OK, I reproduced the bug on WP 6.6.2 with Polylang install

Tested the fix with PR https://github.com/WordPress/wordpress-develop/pull/6226/files
cf. https://core.trac.wordpress.org/attachment/ticket/52151/test-pr-6226.png

Last edited 5 weeks ago by ltrihan (previous) (diff)

#27 @sylvainnascimento
5 weeks ago

Bug reproduced in reduced window with plugin Polylang setuped with 9 langs and SEO Press

Fixed with PR : https://github.com/WordPress/wordpress-develop/pull/6226

https://core.trac.wordpress.org/raw-attachment/ticket/52151/test-with-patch.png

#28 @audrasjb
5 weeks ago

Hello and thanks for the patch, its update and for testing the patch.

I also tested the patch and it introduces a change on Post screens since it adds an horizontal scrollbar on medium screen sizes when there is a lot of columns.

I'm fine with the current implementation, but perhaps we could only make the table scrollable instead?

#29 @ltrihan
5 weeks ago

Indeed, it should be better to have table scrollable horizontally.

However, we would need to wrap the .wp-list-table inside a div like .wp-list-table-wrapper which would be styled with overflow: scroll;

See https://stackoverflow.com/questions/19794211/horizontal-scroll-on-overflow-of-table
https://core.trac.wordpress.org/attachment/ticket/52151/wp-list-table-wrapper.png

Last edited 5 weeks ago by ltrihan (previous) (diff)

#30 @davidbaumwald
12 days ago

  • Milestone changed from 6.7 to 6.8

With 6.7 RC 1 releasing today this ticket is being moved to 6.8.

If any maintainer or committer feels the remaining work can be competed in time for 6.7 feel free assume ownership and update the milestone accordingly.

Note: See TracTickets for help on using tickets.