Follow-up to #2949991-31: Add workspace UI in top dialog. Originally fixed in #33 there, but regression happened before the final commit.

Problem/Motivation

There's a WCAG level A issue at narrow breakpoints, for SC 1.4.1 Use of Color.

At narrow breakpoints, the text labels are not visible for toolbar buttons. So a user can only tell the difference between the live and stage workspaces by colour alone. The icon is the same in each case, and the distinguishing text has been removed. Colour is the only distinguishing feature.

Live workpace active. Green is the only clue:
Live workspace at narrow breakpoint. The toolbar just shows a green button.

Stage workspace active. Yellow is the only clue:
Stage workspace at narrow breakpoint. The toolbar just shows a yellow button.

Some users may have considerable difficulty knowing which workspace they are viewing. This impacts scenarios like:

  • People with colour blindness
  • People using tools which adjust the colour-space of their device (Windows/Edge high-contrast theme, iOS white-point adjustment, evening blue-light reduction, ...)
  • People using their device in sunlight (e.g. reviewing changes with a phone, sitting next to the window on a train journey, on a sunny day, just before a client meeting...)

This should be addressed before marking the Workspace module as stable. As a level-A WCAG issue, I'd say it's a stable blocker.

Proposed resolution

Instead of removing text labels from all toolbar buttons, we keep the text label for the workspace. Now it's possible to tell the workspaces apart without relying on colour vision:

There's a risk the workspace name could be too long, but we could truncate it if it would be more than, say half the viewport width.

The intended styles are from .toolbar .toolbar-icon-workspace, at line 189 in core/modules/workspace/css/workspace.toolbar.css.
However these are being overridden by more specific rules from .toolbar .toolbar-bar .toolbar-tab > .toolbar-icon, in toolbar.icons.theme.css

Remaining tasks

Review

User interface changes

Show the name of the workspace in the toolbar at narrow breakpoints. Principally to help people with colour blindness. Long workspace names will be truncated.

API changes

None.

Data model changes

None.

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

This is the follow-up for the regression noted in #2949991-83: Add workspace UI in top dialog, I'll grab the details from the old issue...

andrewmacpherson’s picture

I've grabbed all the details from the previous issue, and made fresh mockups with the final colours chosen there.

This regression seems to be due to selector specificity, so it could be a novice task.

andrewmacpherson’s picture

Issue summary: View changes
amateescu’s picture

Status: Active » Needs review
StatusFileSize
new760 bytes

This should fix it.

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested, this looks to bring back what we had in #2949991-33: Add workspace UI in top dialog.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 5: 2986193.patch, failed testing. View results

andrewmacpherson’s picture

Status: Needs work » Reviewed & tested by the community

Queued a re-test for 8.7.x, test failure due to removing alpha modules from 8.6.x. Back to RTBC in the meantime.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new125.38 KB

Didn't check what is the reason for this but it seems like there's some extra spacing:

amateescu’s picture

Status: Needs work » Needs review
StatusFileSize
new847 bytes
new486 bytes

This should fix it.

gábor hojtsy’s picture

Component: workspace.module » workspaces.module

Fix component following module rename.

sim_1’s picture

Issue summary: View changes
StatusFileSize
new863 bytes
new848 bytes

Had to slightly alter the previous patch to be able to create an interdiff because the file names are no longer the same. The new patch just updates the file name to apply with the change of the module rename, and updates one of the class names for the same reason.

Otherwise, this patch worked when I tested it.

andrewmacpherson’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested in most of our supported browsers, working again.

Thanks for getting this patch back on track @sim_1.

  • lauriii committed 3138933 on 8.7.x
    Issue #2986193 by amateescu, sim_1, andrewmacpherson: Workspace toolbar...

  • lauriii committed 1963c22 on 8.6.x
    Issue #2986193 by amateescu, sim_1, andrewmacpherson: Workspace toolbar...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3138933 and pushed to 8.7.x. Also cherry-picked to 8.6.x. Thanks! ✨

Status: Fixed » Closed (fixed)

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