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)

view mode page

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.

a view mode entity type section with an extra long description

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

Issue fork drupal-3397291

Command icon 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:

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Issue summary: View changes
rkoller’s picture

Issue summary: View changes
rkoller’s picture

Issue summary: View changes

Utkarsh_33 made their first commit to this issue’s fork.

utkarsh_33’s picture

StatusFileSize
new543.26 KB

Attaching the screenshots with the current look of the table.

tim.plunkett’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Tested at various widths/breakpoints and columns remain even through out.

The solution

try to avoid large gaps

think could be it's own issue to fix across entire Drupal.

rkoller’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new99.57 KB
new64.78 KB
new69.15 KB

Thanks 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/uninstall while testing something for another issue:

drupal uninstall page with too wide columns

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.

extra long display mode name extends the width of the name column

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)
name description and operations columns having the same column column width

utkarsh_33’s picture

StatusFileSize
new645.36 KB

I 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.
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 display mode table with the current changes applied.

utkarsh_33’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new42.88 KB

feedback

Appears feedback has been addressed. I added black border to help see.

rkoller’s picture

I'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

  • lauriii committed 005c0e91 on 11.x
    Issue #3397291 by Utkarsh_33, rkoller, smustgrave: Improve the...

  • lauriii committed c4db1fe9 on 10.2.x
    Issue #3397291 by Utkarsh_33, rkoller, smustgrave: Improve the...
lauriii’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 005c0e9 and pushed to 11.x. Also cherry-picked to 10.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.