Problem/Motivation
The columns for the different view mode and form mode entity types are not really aligned across entity types and with the introduction of a description column #3364659: Give display modes a description things got a bit more challenging cognitively (*I don't mean the description was the wrong thing to add. I really like it's addition but it jut introduces a potential additional readability problem in case the description gets long and verbose)

If you compare the rows for the different entity types vertically they don't look consistent since their columns aren't horizontally aligned. That way there is sort of a constant visual distraction by having an horizontal shift of the column widths across the different entity types sections. Those shifts also lead to different sized horizontal gaps between the columns. for example in the viewmodes.jpg the gap between "test" (name column) and "description about a test" (description column) is huge, same as the gap to the corresponding edit button. the gap for view modes without any description is even larger. if you try to keep the line visually with the straw test it is challenging (also due to the fact that the separating lines have a color contrast of 1.5:1 which might be too light) . and if you are moving down the operations column with the mouse you dont have to move vertically but also horizontally when you get within a new entity type section to be able to reach any of the new region's edit buttons.
And in general it seems the width of the different columns between entity type sections differs significantly. For content the name column is extra wide compared to other entity types. The width of the description and operations column is more or less the same width.
And one extreme edge case but if you add a long description and you are using a wide screen monitor you will end up with a line length of 648 characters for a 36" monitor. The goal in regards of meeting the AAA WCAG2.1 SC1.4.8 C20 is having a line length of around ~80 characters.

The problem was touched during the discussion of #2721727: Allow user to add display modes from respective field UI's. in todays usability meeting. That issue #3395398: Drupal Usability Meeting 2023-10-27 will have a link to a recording of the meeting. For the record, the attendees at today's usability meeting were @AaronMcHale, @anmolgoyal74, @benjifisher, @rkoller, @shaal, @simohell, and @worldlinemine.
Steps to reproduce
- Go to
/admin/structure/display-modes/view
Proposed resolution
A few suggestion to improve the current state:
- make the column widths consistent across entity types
- try to avoid large gaps
- set a maximum width in particular for the description column to avoid such extreme line lengths illustrated in 36inchdescription.jpg
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screenshot 2023-11-08 at 12.11.57 PM.png | 42.88 KB | smustgrave |
| #11 | Display mode table layout.png | 645.36 KB | utkarsh_33 |
| #10 | columns.jpg | 69.15 KB | rkoller |
| #10 | long_name.jpg | 64.78 KB | rkoller |
| #10 | uninstall.jpg | 99.57 KB | rkoller |
Issue fork drupal-3397291
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3397291-improve-the-readability
changes, plain diff MR !5206
Comments
Comment #2
rkollerComment #3
rkollerComment #4
rkollerComment #7
utkarsh_33 commentedAttaching the screenshots with the current look of the table.
Comment #8
tim.plunkettComment #9
smustgrave commentedTested at various widths/breakpoints and columns remain even through out.
The solution
think could be it's own issue to fix across entire Drupal.
Comment #10
rkollerThanks for working on this. I finally found time to test and write up a reply. I agree with @smustgrave in #9 that the larger gap issue should be tackled for core in general. But i think there are still a few aspects that should be covered within this issue imho:
1. The changes in the MR affect other pages as well. I've just noticed for example a regression on
/admin/modules/uninstallwhile testing something for another issue:2. I wonder if it would make sense to set the column width for name narrower than the one for the description. that the name column is half or two third of the description column? because the odds are high that a name is usually shorter than a verbose description.
3. If you have a long name for a display mode the column extends. would there be an option to wrap a name instead of extending the column width? In german the odds are high that you get long words (one example from a legislative text: "Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz" - it got removed after a few years but still just wanted to illustrate the possibility of the occurance of extra long words - cuz in my screenshot i've simply used a numeric sequence that eases counting)

Comment #11
utkarsh_33 commentedI have added a custom css file that overrides the css of the generic table's css for the current page.I think editing the generic css file for tables makes it difficult to handle different layouts on different pages so i thought that this can be better approach.
with the current changes applied.
We can have a discussion around some other approach , if someone has a better idea to handle these issues at a generic level.
Attaching the SS
Comment #12
utkarsh_33 commentedComment #13
smustgrave commentedAppears feedback has been addressed. I added black border to help see.
Comment #14
rkollerI've also taken a look at the latest changes and a +1 to RTBC from my end as well. Looks real good @utkarsh:33!
@smustgrave also a good idea adding a screenshot illustrating the new column width by adding visible borders to each table cell
Comment #18
lauriiiCommitted 005c0e9 and pushed to 11.x. Also cherry-picked to 10.2.x. Thanks!