Table drag's UI is fairly broken. This can be exposed via webform in addition to editing menus within the settings tray.

Testing instructions

  1. To test this, we need to find a tabledrag interface. The easiest way is to enable Olivero as the admin theme (even though we don't support this use case).
  2. You can find this interface at /admin/structure/types/manage/article/display
  3. You'll need to make sure it looks as expected.
  4. You can test the contrast of a link by creating a link within tabledrag using browser Devtools

Comments

mherchel created an issue. See original summary.

kostyashupenko’s picture

Status: Active » Needs review
StatusFileSize
new12.29 KB

Added some styles. Change for `olivero.theme` was taken from Claro.

mherchel’s picture

Status: Needs review » Needs work

This is looking great! Needs some additional minor changes, and then I'll post screenshots.

Requested changes are below.

  1. +++ b/core/themes/olivero/css/components/tabledrag.pcss.css
    @@ -5,12 +5,46 @@
    +tr.draggable:hover {
    ...
    +a.tabledrag-handle,
    

    It looks like the tr element on the selector is unneeded. This can be simplified to .draggable. (this also applies to the other selectors except a.tabledrag-handle, which needs to be match the specificity of the core stylesheet).

  2. +++ b/core/themes/olivero/css/components/tabledrag.pcss.css
    @@ -5,12 +5,46 @@
    +  width: 2.25rem;
    

    Just to keep things consistent, lets use px units here. These will automatically get translated into rem units via the pxtorem postCSS plugin.

  3. +++ b/core/themes/olivero/css/components/tabledrag.pcss.css
    @@ -5,12 +5,46 @@
    +  margin-left: 0;
    

    use margin-inline-start for proper RTL support. Note this will get translated into IE11 compliant CSS by PostCSS

  4. +++ b/core/themes/olivero/css/components/tabledrag.pcss.css
    @@ -5,12 +5,46 @@
    +  background-position: 10px 6px;
    

    I believe the 10px is from the left. Assuming so, we need to add /* LTR */ to the end of this and then create the proper [dir="RTL"] variant.

kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new12.39 KB
new2.78 KB
mherchel’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new59.96 KB

#14 looks great! Screenshot attached.

image

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Issue summary: View changes
StatusFileSize
new41.06 KB

Adding a picture of how it looks (prior to changes)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: 3191725-4.patch, failed testing. View results

benjifisher’s picture

Please do not ask the testbot to try again until #3207086: [HEAD BROKEN] Consistent failure in MonthDatePluginTest is fixed.

alexpott’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Reviewed & tested by the community

Setting back to RTBC per #5

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/themes/olivero/css/components/dropbutton.pcss.css
    @@ -11,6 +11,10 @@
    +.dropbutton-single .dropbutton-widget {
    +  border: none;
    +}
    

    What is this solving?

  2. +++ b/core/themes/olivero/css/components/tabledrag.pcss.css
    @@ -5,12 +5,46 @@
    +a.tabledrag-handle,
    +.touchevents a.tabledrag-handle {
    ...
    +.draggable a.tabledrag-handle {
    

    Nit pick: could we remove the a element from the selector?

  3. +++ b/core/themes/olivero/css/components/tabledrag.pcss.css
    @@ -5,12 +5,46 @@
    +.touchevents .draggable td {
    +  padding-block: var(--sp1);
    +  padding-inline-start: 0;
    +  padding-inline-end: var(--sp1);
    +}
    

    The padding here seems a bit excessive. We would meet the recommendation of 44px touch area with much less padding.

mherchel’s picture

Status: Needs work » Needs review
StatusFileSize
new207.14 KB
new11.54 KB
new2.11 KB

What is this solving?

Yeah, seems unrelated and we have another issue for the dropbutton. It's removed.

Nit pick: could we remove the a element from the selector?

These selectors are needed to override the tabledrag module's CSS (See screenshot below)

The padding here seems a bit excessive. We would meet the recommendation of 44px touch area with much less padding.

Good catch. Fixed.

proeung’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new16.1 KB
new180.84 KB

@mherchel Patch #13 looks good!

The table sort is looking and working as expected (see attached).

The table select sort is showing an overlapping issue, which is caused by the CSS properties coming from the Webform module (see attached). I believe this is out of scope for this particular issue and might not be something that Olivero should be accounted for, however, I just wanted to quickly note this.

Marking this issue as RTBC +1

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
  1. These selectors are needed to override the tabledrag module's CSS (See screenshot below)

    We don't necessarily need to add element to the selector to increase specificity to override the CSS, we could do something like .tabledrag-handle.tabledrag-handle for example but here it probably doesn't make a huge difference so this is probably good as it is.

  2. Let's make sure that the colors used here provide sufficient color contrast. For example, it doesn't seem like the drag-previous background color has enough contrast with links: https://webaim.org/resources/contrastchecker/?fcolor=0D77B5&bcolor=E7EDF1
mherchel’s picture

Status: Needs work » Needs review
StatusFileSize
new46.26 KB
new11.72 KB
new981 bytes

Great catch! Fix added.

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Issue summary: View changes
gauravvvv’s picture

While checking the table drag, I found an a11y color contrast fail at /admin/structure/block.

After the table drag, the link text color updated to #313637, which results in a fail with bg color: #2494DB.

Adding screenshots for the same.

mherchel’s picture

That's a good catch. We can handle the drop-button styling in #3200370: Fix Olivero's drop-button style to conform with new form styles, however.

mherchel’s picture

katannshaw’s picture

Status: Needs review » Reviewed & tested by the community

Just tested this out on the Tugboat instance at https://3191725-tabledrag-safemtjuagapxqgtrynoasiupl4ahux6.tugboat.qa/ and it worked as expected. I'm marking this as RTBC.

Here's a video recording of me using the tabledrag feature on the Article Form Display form and the Admin Menu form.
Monosnap video: https://monosnap.com/file/JN1v5UilMA9MjAaV6bZ1E819ZCqUsa

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new10.89 KB

Should we check with @jwitkowski79 if the designs are acceptable?

I also noticed that the new color rules have a regression with dropbuttons:

jwitkowski79’s picture

Status: Needs work » Reviewed & tested by the community

@mherchel reviewed the above with me and it looks good! It has my sign off

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

@jwitkowski79 thank you for confirming that the design changes look good for you!

We should still address the regression I mentioned in #23.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mherchel’s picture

Version: 9.3.x-dev » 10.0.x-dev

@lauriii I can't seem to find a UI element where I can replicate #23. How do I do this?

mherchel’s picture

Status: Needs work » Needs review
StatusFileSize
new11.7 KB
new872 bytes

To answer the question in #27, this can be found in the Taxonomy UI

Patch and interdiff attached.

kristen pol’s picture

I tested a couple things and am including some screenshots:

  1. /admin/structure/taxonomy as noted in #28
  2. /admin/structure/types/manage/article/display as noted in the issue summary

The taxonomy UI looked okay to me and I was able to drag things fine.

For the manage display page, although dragging works, IMO it seems like:

  1. Everything is too big
  2. There should be some padding in the cells so things don't touch the borders

kristen pol’s picture

StatusFileSize
new220.31 KB

It's hard to tell the sizing in the manage display UI in those screenshots so uploading one more screenshot.

andy-blum’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new56.66 KB
new62.41 KB
new59.95 KB

More screen shots from the taxonomy page. I agree that while functional, things look a bit off. That said, Olivero isn't designed as an admin interface and this issue is about the functionality. For that reason +1 RTBC.

Screenshots attached show taxonomy vocab page, dropbutton in action, and re-ordered taxonomy terms

lauriii’s picture

Issue summary: View changes
StatusFileSize
new94.47 KB

I tested table drag in a quick edit. It seems like there are some issues with overflow. Do we want to resolve that here or move that into a follow-up?

mherchel’s picture

mherchel’s picture

Updating issue credits

  • lauriii committed fac878c on 9.3.x
    Issue #3191725 by mherchel, kostyashupenko, Kristen Pol, andy-blum,...

  • lauriii committed 8fb55a5 on 9.2.x
    Issue #3191725 by mherchel, kostyashupenko, Kristen Pol, andy-blum,...
lauriii’s picture

Version: 10.0.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed fac878c and pushed to 9.3.x and 9.2.x. Thanks!

Status: Fixed » Closed (fixed)

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