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:

Stage workspace active. Yellow is the only clue:

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
Comment #2
andrewmacpherson commentedThis 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...
Comment #3
andrewmacpherson commentedI'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.
Comment #4
andrewmacpherson commentedComment #5
amateescu commentedThis should fix it.
Comment #6
timmillwoodManually tested, this looks to bring back what we had in #2949991-33: Add workspace UI in top dialog.
Comment #9
andrewmacpherson commentedQueued a re-test for 8.7.x, test failure due to removing alpha modules from 8.6.x. Back to RTBC in the meantime.
Comment #10
lauriiiDidn't check what is the reason for this but it seems like there's some extra spacing:
Comment #11
amateescu commentedThis should fix it.
Comment #12
gábor hojtsyFix component following module rename.
Comment #13
sim_1Had 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.
Comment #14
andrewmacpherson commentedManually tested in most of our supported browsers, working again.
Thanks for getting this patch back on track @sim_1.
Comment #17
lauriiiCommitted 3138933 and pushed to 8.7.x. Also cherry-picked to 8.6.x. Thanks! ✨