Originally submitted on Github

Problem/Motivation

Recent interviews and research exposed pain points around Drupal's admin experience of looking and feeling dated.

Proposed resolution

Implement new table styles to create a favorable first impression of Drupal for evaluators and a better user experience for site authors. No functional differences.

Specification

Quick overview

This image is just a quick overview for Table list specs. Please use the Figma link to full specification as the main resource for specks.
Table quick specification
Color palette

Quick overview

FIGMA: https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Design-system?node-i...
This link is anchored to the board with the full specification. As an anonymous user you can see the design, but to actually be able to pick colors and sizes please login on Figma.

Remaining tasks

  • Create new design
  • Update patch with new styles
  • Accessibility review
  • RTL and LTR review

User interface changes

All Table styles will be changed, no functional differences.

Test Pages

  • /admin/content
  • /admin/content/files
  • /admin/content/comment
  • /admin/people
  • /admin/reports/dblog
  • /admin/structure/block/block-content/manage/basic/form-display
CommentFileSizeAuthor
#77 Screen Shot 2019-02-12 at 18.33.38.png5.57 KBlauriii
#71 claro-table-3021388-71.patch17.04 KBhuzooka
#66 claro-table-3021388-66.patch1.48 KBhuzooka
#62 interdiff-3021388-58-61.txt3.95 KBhuzooka
#62 claro-table-3021388-61.patch16.13 KBhuzooka
#58 interdiff-3021388-53-58.txt9.08 KBhuzooka
#58 claro-table-3021388-58.patch16.04 KBhuzooka
#56 Screen Shot 2019-01-31 at 11.39.41.png107.15 KBlauriii
#53 Table-screenshots.zip4.29 MBhuzooka
#53 interdiff-3021388-45-53.txt1.88 KBhuzooka
#53 claro-table-3021388-53.patch17.37 KBhuzooka
#51 table_active.png67.48 KBsaschaeggi
#50 Screenshot 2019-01-29 at 21.38.35.png153.98 KBhuzooka
#49 table_highlight.png101.28 KBsaschaeggi
#45 interdiff-3021388-42-45.txt727 byteshuzooka
#45 claro-table-3021388-45.patch16.84 KBhuzooka
#43 Screen Shot 2019-01-29 at 15.34.39.png77.97 KBlauriii
#42 Screenshot 2019-01-29 at 14.29.08.png246.27 KBhuzooka
#42 interdiff-3021388-38-42.txt4.71 KBhuzooka
#42 claro-table-3021388-42.patch16.82 KBhuzooka
#39 Table-osx-and-mobile-browsers.zip2.47 MBhuzooka
#38 claro-table-3021388-38.patch16.67 KBhuzooka
#34 table_specs.png257.01 KBsaschaeggi
#32 Screenshot 2019-01-29 at 10.52.38.png648.68 KBhuzooka
#31 Screen Shot 2019-01-29 at 11.38.10.png111.87 KBlauriii
#30 Screen Shot 2019-01-29 at 10.52.46.png133.42 KBlauriii
#26 claro-table-3021388-26.patch15.46 KBhuzooka
#17 interdiff-3021388-11-17.txt15.56 KBhuzooka
#17 claro-table-3021388-17.patch15.56 KBhuzooka
#11 Claro-Table-Screenshots.zip4.4 MBhuzooka
#11 claro-table-3021388-11.patch15.14 KBhuzooka
#10 02--Field-UI-form--MAC--chrome--merged.png102.38 KBhuzooka
#10 01--Content-form--Android--Chrome--he--merged.png69.88 KBhuzooka
table.png17.56 KBckrina

Issue fork claro-3021388

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

ckrina created an issue. See original summary.

ckrina’s picture

Issue summary: View changes

ckrina’s picture

Crediting @antonellasevero as she initially created the issue on Github.

ckrina’s picture

Issue summary: View changes
antonellasevero’s picture

Issue summary: View changes
ckrina’s picture

Issue summary: View changes
huzooka’s picture

Version: » 8.x-1.x-dev
Assigned: Unassigned » huzooka
saschaeggi’s picture

Related issues: +#3021388: Table style update
huzooka’s picture

Attaching Seven screenshots as a reference.

Field UI form on OSX Chrome Content form on Android Chrome, hebrew

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs review
StatusFileSize
new15.14 KB
new4.4 MB

Missing:
* Tabledrag (example: Field UI form)
* Available translation updates table (/admin/reports/translations)
* Extend / Uninstall table (/admin/modules, /admin/modules/uninstall)
* warning and error states of table rows (/admin/reports/updates)

Status: Needs review » Needs work

The last submitted patch, 11: claro-table-3021388-11.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
huzooka’s picture

Issue tags: +Needs reroll
huzooka’s picture

Related issues: -#3021388: Table style update
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new15.56 KB
new15.56 KB

Status: Needs review » Needs work

The last submitted patch, 17: claro-table-3021388-17.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
modulist’s picture

https://www.drupal.org/files/issues/2018-12-03/table.png

Increased row height

An increased row height will display fewer items per screen and require more scrolling, creating a greater cognitive load for some users.

Recommendation:

Provide an affordance to choose alternative settings for table cell padding to vary the row height, like Gmail's Comfortable/Cozy/Compact settings.

modulist’s picture

ckrina’s picture

Thanks again @modulist! I think it's a really nice feature to have, but to not block this basic table theming issue I've created a new one to address it and improve the implementation: https://www.drupal.org/project/claro/issues/3026547. Feel free to post further comments there :)

ckrina’s picture

Kami Amiga’s picture

  1. +++ b/css/src/components/tablesort-indicator.css
    @@ -4,23 +4,43 @@
    +  margin-top: -8px;
    ...
    +  width: 14px;
    +  height: 16px;
    

    Shouldn't these values be converted in rem ?

  2. +++ b/images/src/sort--asc.svg
    @@ -0,0 +1,9 @@
    +  width='14'
    +  height='12'
    +  viewBox='0 0 10 12'>
    
    +++ b/images/src/sort--desc.svg
    @@ -0,0 +1,9 @@
    +  width='14'
    +  height='12'
    +  viewBox='0 0 10 12'>
    

    Cannot the differences of values between the width and the viewport be a problem ? (alignments for instance)

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
Issue tags: +Needs reroll
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new15.46 KB

Status: Needs review » Needs work

The last submitted patch, 26: claro-table-3021388-26.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
lauriii’s picture

Where has the hover effect come from? It is not described in the design system. We should either update the design system or change the implementation.

lauriii’s picture

StatusFileSize
new133.42 KB

Here's a screenshot of the hover effect for anyone wondering:


lauriii’s picture

Issue summary: View changes
StatusFileSize
new111.87 KB
huzooka’s picture

lauriii’s picture

Status: Needs review » Needs work

Thank you for pointing that out. I must have missed it somehow 😇

There was some discussion on Slack and as a result, @saschaeggi and @ckrina changed the styles for hover and active states of the sortable table headers. We should implement that change before committing this.

saschaeggi’s picture

StatusFileSize
new257.01 KB

@lauriii about the hover state, see the specification below:
Table specs
Cheers

huzooka’s picture

#33 #34 This is already implemented.

huzooka’s picture

Status: Needs work » Needs review
huzooka’s picture

Status: Needs review » Needs work
huzooka’s picture

StatusFileSize
new16.67 KB
huzooka’s picture

Status: Needs work » Needs review
StatusFileSize
new2.47 MB
lauriii’s picture

Status: Needs review » Needs work
  1. +++ b/claro.theme
    @@ -431,3 +433,63 @@ function claro_preprocess_radios(&$variables) {
    +      /* For 8.6.x and below. */
    

    Good job on testing this with both versions. We should add a @todo to remove this after 8.6.x is out of support.

  2. +++ b/claro.theme
    @@ -431,3 +433,63 @@ function claro_preprocess_radios(&$variables) {
    +              $header_cell['attributes']->addClass('th--sortable');
    ...
    +          $header_cell['attributes']->addClass('th--sortable');
    ...
    +          $header_cell['attributes']->addClass('th--sortable');
    

    If we provide th--sortable class, we should have th class as well. Maybe it could be changed to something like sortable or sortable-heading instead?

  3. +++ b/css/src/components/tables.css
    @@ -14,101 +19,137 @@ caption {
    +.th--sortable > a {
    ...
    +[dir="rtl"] .th--sortable > a {
    ...
    +.th--sortable > a::before {
    ...
    +.th--sortable > a::before {
    ...
    +.th--sortable > a::after {
    ...
    +.th--sortable > a:focus::before,
    +.th--sortable > a:hover::before {
    ...
    +.th--sortable > a:focus::after,
    +.th--sortable > a:hover::after {
    ...
    +.th--sortable.is-active > a {
    ...
    +.th--sortable.is-active > a::before {
    ...
    +.th--sortable.is-active > a::after {
    

    Did you consider adding class to the link itself? It seems like it could be done in the template.

  4. +++ b/css/src/components/tables.css
    @@ -14,101 +19,137 @@ caption {
    +  border-bottom: 0.1875rem solid transparent;
    

    For the hover state, this should 2px.

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.82 KB
new4.71 KB
new246.27 KB

#40.1 Done. I also switched comment styles.

#40.2 It's sortable-heading from now.

#40.3 It's theoretically possible.
The problem is that we should completely refactor Views table implementation (eg removecolumn.url and generate column.content as a link renderable) and since it's impossible to generate a query-only url what views provides there, I'm afraid of having issues in that case.

#40.4 I don't think so.
Hover and active state both have 3px border

lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new77.97 KB

It seems like it wasn't updated everywhere. If you look at the component spec, it has a clearer explanation of the design:

huzooka’s picture

Assigned: Unassigned » huzooka

omg... I always miss something :/

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.84 KB
new727 bytes

Status: Needs review » Needs work

The last submitted patch, 45: claro-table-3021388-45.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review

The last submitted patch, 38: claro-table-3021388-38.patch, failed testing. View results

saschaeggi’s picture

Status: Needs review » Needs work
StatusFileSize
new101.28 KB

@huzooka there is another thing we should add. The Highlight color (hover) for the table row. See https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Design-system?node-i...
Table highlight
Sorry for that!

huzooka’s picture

StatusFileSize
new153.98 KB

Seven provides a bg color for a selected table row, don't we want to do something equivalent?

Table select row states in Seven theme

saschaeggi’s picture

StatusFileSize
new67.48 KB

Yes we want to do something similar. I've added the active state.
See https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Design-system?node-i...
Table active row

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new17.37 KB
new1.88 KB
new4.29 MB

Hover + active state updated.

New 'after' screenshots attached.

Status: Needs review » Needs work

The last submitted patch, 53: claro-table-3021388-53.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
lauriii’s picture

Status: Needs review » Needs work
StatusFileSize
new107.15 KB

The active column is missing background on active rows:

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.04 KB
new9.08 KB

Status: Needs review » Needs work

The last submitted patch, 58: claro-table-3021388-58.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
Issue tags: +Needs reroll
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.13 KB
new3.95 KB

Status: Needs review » Needs work

The last submitted patch, 62: claro-table-3021388-61.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
Issue tags: +Needs reroll
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.48 KB

Status: Needs review » Needs work

The last submitted patch, 66: claro-table-3021388-66.patch, failed testing. View results

huzooka’s picture

huzooka’s picture

Assigned: Unassigned » huzooka

The recently applied autocomplete patch contains the improvements of this issue.

andrewmacpherson’s picture

Issue tags: -Needs accessibility review +accessibility

Removing the needs accessibility review tag, I think @modulist's proposal in #20 is great, and it has a follow-up issue filed.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
Issue tags: -accessibility +Accessibility
StatusFileSize
new17.04 KB

Status: Needs review » Needs work

The last submitted patch, 71: claro-table-3021388-71.patch, failed testing. View results

huzooka’s picture

Status: Needs work » Needs review
andrewmacpherson’s picture

A couple more feature requests to make the table styles more future-proof. The patch here is already quite big so I made them follow-ups to this.

huzooka’s picture

Why needs work?

andrewmacpherson’s picture

Status: Needs work » Needs review

No idea, wasn't intended. I might have had the form open at #72

lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs reroll
StatusFileSize
new5.57 KB

One more problem I could find is that the tabledrag handle is not aligned with text in a table row:

huzooka’s picture

Status: Needs work » Needs review

I don't really see the advantages of re-arranging the tabledrag handle until we miss Table drag styles (especially only the dragging and the last-dragged colors are missing if we can assume that the handle icon is final here).

huzooka’s picture

Another follow-up for table drag: #3032365: Table drag style update

  • lauriii committed 0b84db4 on 8.x-1.x
    Issue #3021388 by huzooka, lauriii, saschaeggi, ckrina, andrewmacpherson...
lauriii’s picture

Status: Needs review » Fixed

This looks good now! Thank you!

Status: Fixed » Closed (fixed)

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

idebr’s picture

+++ b/css/src/components/tables.css
@@ -4,9 +4,14 @@
 table {
-  width: 100%;
-  margin: 0 0 10px;
+  min-width: 100%;
+  margin-top: var(--space-l);

This changes causes some admin modals to display over the full viewport width. I have filed #3021388: Table style update to fix this.

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