Make WordPress Core

Opened 2 years ago

Last modified 19 months ago

#52151 new defect (bug)

Post / Page Title Columns broken

Reported by: pascoedj's profile pascoedj Owned by:
Milestone: Future Release 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 (5)

wp-title-wrap-vertical.png (148.1 KB) - added by pascoedj 2 years ago.
52151.diff (398 bytes) - added by sabbirshouvo 20 months 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 20 months ago.
Issue test 1
Screenshot at Oct 18 01-14-08.2.png (153.0 KB) - added by sabbirshouvo 20 months ago.
Issue test 2
Screenshot at Oct 18 01-14-21.png (158.8 KB) - added by sabbirshouvo 20 months ago.
Issue test 2

Download all attachments as: .zip

Change History (24)

#1 @pascoedj
2 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
2 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
2 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
23 months 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
23 months ago

#53720 was marked as a duplicate.

#6 @costdev
22 months 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 22 months ago by costdev (previous) (diff)

#7 @mrfoxtalbot
22 months 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
22 months 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
21 months 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
20 months 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
20 months 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
20 months ago

#52426 was marked as a duplicate.

#13 @lospeso
20 months 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 20 months ago by lospeso (previous) (diff)

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


20 months ago

#15 @sabbirshouvo
20 months 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
20 months ago

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

#16 @sabbirshouvo
20 months ago

  • Keywords has-patch added; needs-patch removed

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


19 months ago

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


19 months ago

#19 @audrasjb
19 months 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.

Note: See TracTickets for help on using tickets.