Problem/Motivation

This is the implementation issue for #2732081: WI: Phase G2: Full-site preview with Workspace UI.

Must-have:

Should-have:
#2940677: Support prefers-reduced-motion in off-canvas dialog

Proposed resolution

Following the designs from https://marvelapp.com/2db8i71/screen/26360612, implement the Workspace list builder in a top dialog.

Remaining tasks

User interface changes

There are many changes to the Workspace UI which is experimental.
The concerning changes are those to off canvas CSS which is stable.

API changes

None

Data model changes

None

CommentFileSizeAuthor
#81 stylelint.txt2.31 KBplach
#74 Fullscreen_16_07_18_23_24.png43.89 KBplach
#72 2949991-72.patch26.07 KBamateescu
#71 2949991-71.patch26.14 KBanmolgoyal74
#68 interdiff.txt2.31 KBlauriii
#68 2949991-68.patch26.14 KBlauriii
#66 2949991-66.patch26.71 KBtimmillwood
#66 interdiff-2949991-66.txt1.4 KBtimmillwood
#63 interdiff.txt11.25 KBlauriii
#63 2949991-63.patch26.65 KBlauriii
#59 2949991-59.patch26.83 KBtimmillwood
#59 interdiff-2949991-59.txt3.32 KBtimmillwood
#52 2949991-52.patch26.96 KBtimmillwood
#52 interdiff-2949991-52.txt2.43 KBtimmillwood
#50 interdiff-2949991-50.txt12.47 KBdoublealpha
#50 2949991-50.patch27.12 KBdoublealpha
#46 interdiff-2949991-46.txt10.41 KBdoublealpha
#46 2949991-46.patch26.79 KBdoublealpha
#44 Screenshot-2018-7-6-desktop-viewport.png150.1 KBdoublealpha
#44 Screenshot-2018-7-6-mobile.png56.28 KBdoublealpha
#44 interdiff-2949991-44.txt10.41 KBdoublealpha
#44 2949991-44.patch10.41 KBdoublealpha
#41 Screenshot-2018-7-3 Workspaces Site-Install.png70.91 KBtimmillwood
#40 2949991-40.patch23.42 KBtimmillwood
#40 interdiff-2949991-40.txt1.19 KBtimmillwood
#39 2949991-39.patch23.27 KBtimmillwood
#39 interdiff-2949991-39.txt8.42 KBtimmillwood
#38 2949991-38.patch19.56 KBtimmillwood
#38 interdiff-2949991-38.txt5.7 KBtimmillwood
#38 Screenshot-2018-7-1 Workspaces Site-Install.png37.32 KBtimmillwood
#33 2949991-33.patch18.46 KBtimmillwood
#33 interdiff-2949991-33.txt1.53 KBtimmillwood
#33 Screenshot-2018-6-27 Welcome to Site-Install Site-Install(2).png11.21 KBtimmillwood
#33 Screenshot-2018-6-27 Welcome to Site-Install Site-Install(1).png21.44 KBtimmillwood
#33 Screenshot-2018-6-27 Welcome to Site-Install Site-Install.png21.68 KBtimmillwood
#32 2949991-workspace-ui-toolbar-button-narrow-breakpoint-text-icon-PROPOSED-WCAG-FIX-stage-yellow.png54.09 KBandrewmacpherson
#32 2949991-workspace-ui-toolbar-button-narrow-breakpoint-text-icon-PROPOSED-WCAG-FIX-live-green.png53.6 KBandrewmacpherson
#31 2949991-workspace-ui-toolbar-button-narrow-breakpoint-icon-only-stage-yellow.png53.17 KBandrewmacpherson
#31 2949991-workspace-ui-toolbar-button-narrow-breakpoint-icon-only-live-green.png53.2 KBandrewmacpherson
#27 2949991-after-patch-25-workspace-top-dialog-close-button-focus-opera.png6.92 KBandrewmacpherson
#26 Screenshot-2018-6-19 Workspaces Site-Install.png10.54 KBtimmillwood
#25 interdiff-25.txt2.25 KBamateescu
#25 2949991-25.patch18.42 KBamateescu
#20 interdiff-20.txt3.1 KBamateescu
#20 2949991-20.patch19.09 KBamateescu
#19 2949991-19.patch20.16 KBamateescu
#17 2949991-17-combined.patch53.63 KBtimmillwood
#17 interdiff-coding-standards.txt535 bytestimmillwood
#17 interdiff-failing-test.txt602 bytestimmillwood
#15 2949991-15-combined.patch53.29 KBtimmillwood
#14 interdiff-2949991-14.txt8.32 KBdoublealpha
#14 workspace-dialog2.gif1.23 MBdoublealpha
#6 Screenshot-2018-3-26 Content Site-Install.png34.16 KBtimmillwood
#6 Screenshot-2018-3-26 Welcome to Site-Install Site-Install.png54.57 KBtimmillwood
#6 2949991-6-combined.patch289.51 KBtimmillwood
#6 2949991-6.patch13.83 KBtimmillwood
#6 interdiff-2949991-6.txt13.13 KBtimmillwood
#2 workspace_dialog.gif363.9 KBtimmillwood
#2 2949991-2.patch5.99 KBtimmillwood

Comments

timmillwood created an issue. See original summary.

timmillwood’s picture

Title: Add workspace UI in top dialog » [PP-2] Add workspace UI in top dialog
Status: Active » Needs review
StatusFileSize
new5.99 KB
new363.9 KB

Here's a very crude initial implementation:

It still needs a lot of work on CSS because off-canvas overrides a load of stuff. It also needs to work well no matter what the theme. The table needs converting into boxes.

Going back to #2916781: Allow off-canvas dialog to be rendered at the top of the page to make the dialog height a setting would be good too.

andrewmacpherson’s picture

I'd like to treat #2940677: Support prefers-reduced-motion in off-canvas dialog as a should-have for the Workspace UI.

WCAG 2.1 brings in a new "animations from interactions" success criteria, to support users who have difficulty with vestibular disorders, etc.. The off-canvas dialog is probably a high-risk animation for users affected by these - I'm going by the fact that it involves a large portion of the viewport, especially the top edge demos we've seen for Workspace UI. Easing effects would also be a contributing factor.

Now it's coming in at WCAG level AAA, which is beyond our target of AA which our accessibility QA gate requires. So that means it's NOT a must-have blocker. But it is high impact for affected users, and looks like it will be easy to implement. So we should ;-)

Is this the right issue to track the must/should/could issues for the Workspace UI stability roadmap?

Over at #2928103: [policy, no patch] Use "prefers-reduced-motion" media query to disable animations we're forming a more detailed plan about how to standardize our approach to supporting reduced motion. I think we ought to have a principle of making sure our UI designs don't rely on animations, just as they shouldn't require full-colour vision, say. From what I've seen so far, the Workspace UI doesn't have anything which relies on animation to to convey important animation.

Note that Settings Tray is already marked stable, and has an animation when opening. I was thinking about prefers-reduced-motion as a nice-to-have for stabilizing that module. But some of the next round of experimental modules for the authoring experience are proposing to make more use of the off-canvas, using bigger portions of the viewport too. So that's why I'd like to start treating support for prefers-reduced-motion as a should-have issue. (I'll make a similar argument about the proposal to use bigger off-canvas dialogs for creating blocks in the layout builder initiative.)

timmillwood’s picture

@andrewmacpherson - Thanks for that. This is a good place to track Workspace UI issues relating to the top dialog, but overall workspace issues should be in #2732071: WI: Workspace module roadmap or #2732081: WI: Phase G2: Full-site preview with Workspace UI I guess.

timmillwood’s picture

timmillwood’s picture

Title: [PP-2] Add workspace UI in top dialog » [PP-3] Add workspace UI in top dialog
StatusFileSize
new13.13 KB
new13.83 KB
new289.51 KB
new54.57 KB
new34.16 KB

Latest version of the patch:

You'll notice when rendered which the admin theme it looks a little different, notable the font sizes and the position of the dialog close button. Any suggestions or fixes for this are welcome:

Todo:
- Fix CSS issues (above).
- Change deploy button name to "Deploy to %target".
- Show the last 4 active workspaces for the current user.

timmillwood’s picture

Issue summary: View changes

Status: Needs review » Needs work

The last submitted patch, 6: 2949991-6-combined.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

andrewmacpherson’s picture

Issue tags: +Accessibility

There are some WCAG issues relating to colour in the workspace UI designs. I made a long comment about this at #2910673-10: Workspace UI usability review.

  • SC 1.4.1 Use of color - the "view all workspaces" screen seems to convey workspace status by colour alone.
  • SC 1.4.3 Contrast (minimum) - we'll need to ensure that all the workspace status colours provide sufficient contrast wherever they are used a text. It could be tricky to find colours which have sufficient contrast when paired with white AND dark grey.
  • WCAG 2.1 introduces SC 1.4.11 Non-text contrast. Where the status icons are presented on their own (without the status text label) they'll need at least 3:1 contrast. That's less than the text contrast requirement, so if the colours satisfy the text contrast, we've probably got this one covered too.

Question: can site-builders define their own custom workspace statuses? If users define the colours, we can't be sure the UI will satisfy either of these WCAG criteria. All we can do in that case is provide good default colours.

ckrina’s picture

Adding this feature is a really good improvement because it can add a useful and well know pattern along the web and in apps. My main concern though is how it looks/behaves in small/thinner devices. I'm trying to reproduce it locally but since I don't have enough experience in Workspaces I don't know how to set everything to see it working live. Maybe an screnshot/gif for small and/or medium devices would help.

Also, related to #2916781: Allow off-canvas dialog to be rendered at the top of the page as this is the implementation, do you think that a pattern or direction could be set down here (in terms of using columns or responsive behaviour) for any other modules or future feature to follow later on?

timmillwood’s picture

Title: [PP-3] Add workspace UI in top dialog » [PP-2] Add workspace UI in top dialog
Issue summary: View changes

@ckrina - We have not given too much thought yet about how this will behave in a smaller device, but my current thought is that the workspace tabs on the left would decrease in number until, one a screen like a smart phone, there are no workspace tabs, and only the "current workspace" block taking up the whole dialog. This has the "Manage workspaces" link which allows you to switch to any of the available workspaces. @doublealpha is currently helping with some of the CSS, so hopefully we can put together an updated patch soon. He's at DrupalCon if you want to track him down today or tomorrow.

In regards to the parent patch #2916781: Allow off-canvas dialog to be rendered at the top of the page, I believe it's up to whoever is implementing the dialog to make sure their content is responsive. The height of the dialog is set to a fixed number of pixel in the link data settings, then the width is set to 100%. The content will need to scale and change for each viewport.

#2896535: Create a helper trait for Forms in ajax dialogs is in so reducing the number of dependencies this is postponed on, but not tagging for re-roll because there are many other thing that need to happen before a re-roll is needed, and also only the combined patch needs a re-roll, not the "real" patch.

dixon_’s picture

Component: other » workspace.module
Priority: Normal » Major
timmillwood’s picture

Title: [PP-2] Add workspace UI in top dialog » [PP-1] Add workspace UI in top dialog
Issue summary: View changes

Only blocked on one issue now: #2916781: Allow off-canvas dialog to be rendered at the top of the page.

@doublealpha is still working on CSS on this, making great progress. Hopefully we can get a progress patch up next week.

doublealpha’s picture

StatusFileSize
new1.23 MB
new8.32 KB

Workspace dialog gif

Here is the latest theming progress. It includes improvised styles for the mobile viewport as seen above, but no breakpoints in between at this time.

interdiff-2949991-14.txt

timmillwood’s picture

Status: Needs work » Needs review
StatusFileSize
new53.29 KB

Here's a combined patch including the changes from #14 and #2916781: Allow off-canvas dialog to be rendered at the top of the page.

Status: Needs review » Needs work

The last submitted patch, 15: 2949991-15-combined.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

timmillwood’s picture

Status: Needs work » Needs review
StatusFileSize
new602 bytes
new535 bytes
new53.63 KB

Fixing failing tests and all non css or js coding standards issues.

timmillwood’s picture

Title: [PP-1] Add workspace UI in top dialog » Add workspace UI in top dialog

Blocker just got in!!!

amateescu’s picture

StatusFileSize
new20.16 KB

Rerolled the patch from #17 so it can be applied cleanly after #2916781: Allow off-canvas dialog to be rendered at the top of the page.

amateescu’s picture

StatusFileSize
new19.09 KB
new3.1 KB

Cleaned up a few things that weren't necessary.. I think.

amateescu’s picture

martijn de wit’s picture

amateescu’s picture

@Martijn de Wit, I don't see what that has to do with Workspaces using the top off-canvas dialog :) That's just a bug in the dialog's code, not in the workspace UI implementation.

martijn de wit’s picture

Yes it isa bug in the off-canvas implementation. Not in the dialog itself. Changed the issue title.
Don't think it is blocking for the Workspaces UI. But would be very nice if you can drag the off-canvas dialog smaller or bigger.

amateescu’s picture

StatusFileSize
new18.42 KB
new2.25 KB

The issues mentioned in #21 will take care of the 1px border and the "wrapping" one, so we can remove a bit more stuff from this patch :)

timmillwood’s picture

Status: Needs review » Needs work
StatusFileSize
new10.54 KB

I've been testing on mobile, here's some thoughts:
- On the live workspace the top dialog looks good on mobile.
- On the stage workspace the top dialog has a white border on the left. This is due to a left: 25.6px; element style on the workspace-dialog div.
- When on mobile the dialog comes down from the toolbar, therefore the close arrow should point up.
- I kept wanting to click the workspace icon in the toolbar to close, maybe it should do that too?
- The workspace switching tabs should be closer to the top, there looks to be too much space.
- Everything should be aligned left.


Here's a screenshot of what I have been looking at for the point above.

andrewmacpherson’s picture

A few things about that close arrow...

Does it need to be an arrow? All our other dialogs and off-canvas use a cross for the close button. If workspace UI uses an arrow, but settings-tray uses an cross, the design inconsistency could be confusing.

Maybe we should consider using the arrow style for all uses of off-canvas, and change that in a follow-up? I don't have an opinion which shape is better, but it should be consistent. The arrow wouldn't make sense for closing centred dialogs though; those should continue to use a cross.

Patch #25 has a serious accessibility problem with the focus style for the close button:

+.ui-dialog.workspace-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close,
+.ui-dialog.workspace-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close:hover,
+.ui-dialog.workspace-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close:focus {
+  background-image: none;
+  border: solid;
+  border-color: transparent #ffffff #ffffff transparent;
+  border-width: 0 3px 3px 0;

In the usual cross style for dialog and off-canvas, the icon is a background-image, and a border is added to convey focus. The approach here takes over the border to create the arrow shape, and has killed the focus indicator. There must be a clear focus style, whichever shape the icon uses.

Note that we do still have the default focus style from the user agent. But we can't rely on this - the default focus styles vary considerably between user agents, and the won't always be clear enough. For instance, in Blink-based browsers, the blue outline only has a contrast ratio of 1:2 against the dark grey background in the off-canvas dialog. This doesn't satisfy WCAG SC 1.4.11 Non-text contrast:
Workspace UI dialog close button, with blue focus outline.

I recommend we go back to the approach of using an image for the close icon, and use the border as the focus (and hover) style, like settings tray.

andrewmacpherson’s picture

The "manage workspaces" link doesn't satisfy WCAG contrast requirements (screenshot in #27). The combination of #53b0eb blue on #444444 grey has a contrast ratio of 1:4.07. The contrast needs to be at least 1:4.5 to satisfy WCAG at level AA.

Is this is a completely new colour for workspace UI? I can't find 53b0eb in existing code, but maybe it's in another format.

We have several shades of grey background in workspace UI. I think the lightest one is #555. The blue link will also need to have sufficient contrast there too.

How about #7AD4FE for the blue links? It has a contrast of 1:4.5 against #555, and 1:5.8 against #444. I used the Tanaguru contrast finder to find this. It helps you tweak it so it's just over the threshold, to minimize disruption to existing designs.

The links will also need a focus outline which passes WCAG too. An easy way to do this is to fix the text contrast, then use outline-color: currentColor so the focus outline passes with the same ratio.

Currently links in the workspace UI dialog have no focus indicator when Seven is the main page theme, because they inherit a:focus { outline:none; } from core/themes/seven/css/base/elements.css. But when Bartik is the main page theme, links in the workspace UI have a the default style form the user agent. The page theme styles are leaking through to the workspace UI.

andrewmacpherson’s picture

The yellow and green workspace icons satisfy WCAG SC 1.4.11 Non-text contrast, with a contrast ratio of 1:3.

Yellow #e09600 on #555 - 1:3.02
Yellow #e09600 on #444 - 1:3.95
Green #7dba6e on #555 - 1.3.23
Green #7dba6e on #444 - 1:4.23

Great!

andrewmacpherson’s picture

The coloured workspace buttons on the toolbar don't provide enough contrast for the white text. These both fail WCAG contrast requirements for text at level AA:

The buttons also get a translucent gradient which further reduces the contrast, for the hover and focus states. This will need to be taken into account when improving these colours, the text needs to have 1:4.5 minimum contrast in all states.

It could be tricky finding shades of green and yellow which provide sufficient contrast against both white text and the grey dialog backgrounds.

andrewmacpherson’s picture

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:
Screen shot of live workspace at narrow breakpoint. The toolbar just shows a green button.

Stage workspace active. Yellow is the only clue:
Screen shot of 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. We don't have to fix it immediately here in this issue, but I'm adding it to the must-haves in the summary here.

andrewmacpherson’s picture

Here's an idea of how to address the WCAG use-of-color issue in #31. Instead of removing text labels from all toolbar buttons, we keep the text label for the workspace?

In these mock-ups it's possible to tell the workspaces apart without relying on colour vision:

 live.

 stage.

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.

This can fixed in a follow-up issue. It might also have some utility outside of workspace module itself. We could introduce priority levels for toolbar button labels, like the responsive table column priorities we already use. It would be a hint that "this text label is really important at all breakpoints" versus "this text label can be hidden at narrow breakpoint".

timmillwood’s picture

Status: Needs work » Needs review
StatusFileSize
new21.68 KB
new21.44 KB
new11.21 KB
new1.53 KB
new18.46 KB

I've started to take a look at some of the items @andrewmacpherson mentions:

Here's the workspace name back in the toolbar on mobile:

Here's what it looks like if you have a really long workspace name:

And finally, the default close button is back:

webchick credited plach.

webchick credited yoroy.

webchick’s picture

Status: Needs review » Needs work

We reviewed this today on a call with @yoroy and some other folks. Here are the overall notes: https://www.drupal.org/project/drupal/issues/2732071#comment-12668564

Pursuant to that, a few things we need in this patch to get it out of the "beta blocker" zone:

  • Make the space usage of the toolbar more compact; since much of the functionality of the full mocks isn't implemented yet, the extra space for looks confusing. Remove the space between active workspace name and the button/links below it. [must have]
  • Add a link to show list of more Workspaces (another compact tab to the right of the 4 inactive workspaces with "Show all") so there's a way to get to all workspaces. [must have]
  • Remove "Status" column from overview page; relabel "Set active" to e.g. "Switch to $workspace" [must have]

Other things that were mentioned; probably best split off as follow-up issues so we don't add any more twists and turns to this one's feasibility for 8.6:

  • Put the active workspace "sticky" at the top + highlighted in the overview table. [should have]
  • Remember the page you were on and take you back there when switching Workspaces. [should have]
  • Recent Workspaces section should be "per user"; many editors work on different parts of the site/different workspaces at the same time. [needs issue] [should have]
  • Search/filter box takes up a lot of the design, given > 4 workspaces is an edge case for the vast majority of users. May need more design work. [should have]
timmillwood’s picture

Status: Needs work » Needs review
StatusFileSize
new37.32 KB
new5.7 KB
new19.56 KB

Taking an initial stab a the must-have items.

timmillwood’s picture

StatusFileSize
new8.42 KB
new23.27 KB
  • - Updated the "All 2 workspaces" link to "View all 2 workspaces" to follow the original design.
  • - Updated the "All 2 workspaces" link to be white to follow the original design.
  • - Removed underline from "Manage workspaces" because this patten is not used anywhere else.
  • - Changed the colour of the "Manage workspaces" link to #7AD4FE as suggested in #28.
  • - Added div.workspace-dialog a:focus { outline:none; } as suggested in #28 to make the dialog more consistent across themes.
  • - Moved the "current" workspace to the top of the table and given it a "burlap" background color: https://groups.drupal.org/node/283223#Color
  • - Redirect back to previous page after switching workspace.
  • - #2983105: Recent Workspaces section should be "per user"
timmillwood’s picture

StatusFileSize
new1.19 KB
new23.42 KB

Moved the "active workspace at top of the list" to the load method on the entity list builder to simplify and make it more readable.

timmillwood’s picture

I thought an updated screenshot might be useful:

timmillwood’s picture

+++ b/core/modules/workspace/workspace.module
@@ -148,32 +146,25 @@ function workspace_toolbar() {
+      '#url' => $active_workspace->toUrl('collection', ['query' => ['destination' => \Drupal::destination()->get()]]),

There's a bug here that the destination query string gets cached in the toolbar, so doesn't change on each page like we need it to.

timmillwood’s picture

Status: Needs review » Needs work

Talking to @berdir he suggested doing something similar to \Drupal\Core\Access\RouteProcessorCsrf and alter the query string there.

doublealpha’s picture

  • fixed left margin on mobile viewport when admin theme is active (see comment #26)
  • aligned ‘View all workspaces’ link left
  • removed customized blue link color (#7AD4FE) to now use system tray default (#85bef4)
  • workspace buttons aligned to left of viewport since no search field currently
  • toolbar tab link and icon changed to black as originally designed to improve contrast
  • fixed padding top issues of the current workspace element on mobile
  • updated green and orange icon colours


doublealpha’s picture

doublealpha’s picture

StatusFileSize
new26.79 KB
new10.41 KB

Sorry, I incorrectly outputted the patch and interdiff in #44. Please use these.

timmillwood’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 46: 2949991-46.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

timmillwood’s picture

Looks like workspace.overview.css is missing from the latest patch.

doublealpha’s picture

StatusFileSize
new27.12 KB
new12.47 KB

Here's an updated patch that includes workspace.overview.css.

doublealpha’s picture

Status: Needs work » Needs review
timmillwood’s picture

StatusFileSize
new2.43 KB
new26.96 KB

Thanks @doublealpha, looking awesome!

Moving the #2984938: Remember the page you were on and take you back there when switching Workspaces functionality to a follow up issue, and updating this patch to just redirect to <front> after switching workspace.

manuel garcia’s picture

Some comments on the CSS:

+++ b/core/modules/workspace/css/workspace.toolbar.css
@@ -12,43 +12,250 @@
+div.workspace-dialog #drupal-off-canvas .active-workspace label {
...
+div.workspace-dialog #drupal-off-canvas .active-workspace a.manage {
...
+div.workspace-dialog #drupal-off-canvas .active-workspace .actions {
...
+div.workspace-dialog #drupal-off-canvas .active-workspace .actions a.button {
...
+div.workspace-dialog #drupal-off-canvas .active-workspace .actions a.button:hover {
...
+div.workspace-dialog #drupal-off-canvas .all-workspaces {
...
+div.workspace-dialog #drupal-off-canvas .active-workspace label:before,
...
+div.workspace-dialog #drupal-off-canvas .active-workspace.default label:before,
...
+div.workspace-dialog #drupal-off-canvas .active-workspace label:before {
...
+  .toolbar .toolbar-bar .toolbar-tab > .toolbar-icon.toolbar-icon-workspace {
...
+  .toolbar .toolbar-bar .toolbar-tab > .toolbar-icon.toolbar-icon-workspace:before {
...
+  div.workspace-dialog #drupal-off-canvas .active-workspace .actions {

These seem to be overly qualifying css selectors, for instance, div.workspace-dialog #drupal-off-canvas could probably be just #drupal-off-canvas. I've not tested the patch manually, but could we simplify these? I picked these out of instict, but there might be others - also if there is a reason why we need to be so specific then never mind :)

timmillwood’s picture

#drupal-off-canvas would target the settings tray dialog too, so I think we need all the things just to make sure these workspace styles don't bleed anywhere else.

manuel garcia’s picture

humm isn’t qualifying with .active-workspace etc after that good enough?

timmillwood’s picture

humm isn’t qualifying with .active-workspace etc after that good enough?

Maybe 🙂

amateescu’s picture

Status: Needs review » Needs work

Here's a review for the non-css parts:

  1. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -54,8 +61,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
    +    $header['id'] = $this->t('ID');
    
    @@ -65,12 +72,19 @@ public function buildHeader() {
    +      'id' => $entity->id(),
    
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +    $rows = array_slice($build['table']['#rows'], 0, 4);
    +    foreach ($rows as $row) {
    +      if ($active_workspace->id() !== $row['data']['id']) {
    +        $url = Url::fromRoute('entity.workspace.activate_form', ['workspace' => $row['data']['id']]);
    +        $default_class = $row['data']['id'] === WorkspaceInterface::DEFAULT_WORKSPACE ? 'default' : 'not-default';
    

    \Drupal\Core\Entity\EntityListBuilder::render() keys $build['table']['#rows'] by the entity ID, so we don't need to add it as an additional column.

    However, the array_slice() call will re-key the array, so we need to use a regular for () instead.

  2. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +   * @param array $build
    ...
    +  protected function offCanvasRender(array &$build) {
    

    Needs a proper doc block :)

  3. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +   * @throws \Drupal\Core\Entity\EntityMalformedException
    

    I don't see this thrown in the method..

  4. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +        '#prefix' => $this->t('<span>Current workspace:</span>'),
    

    Do we really need to put the <span> element inside t(), can't we use #prefix or '#wrapper_attributes' to add a class to the wrapper element?

  5. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +      'manage' => [
    +        '#type' => 'link',
    +        '#title' => $this->t('Manage workspaces'),
    +        '#url' => $active_workspace->toUrl('collection'),
    +        '#attributes' => [
    +          'class' => ['manage'],
    +        ],
    +      ],
    

    We now have a View all X workspaces link, so this one is redundant and can be removed.

  6. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +    if (!$active_workspace->getRepositoryHandler() instanceof NullRepositoryHandler) {
    

    Let's play nice with #2958752: Refactor workspace content replication plugin system to three services and use !$active_workspace->isDefaultWorkspace() instead :)

  7. +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -107,4 +121,115 @@ public function getDefaultOperations(EntityInterface $entity) {
    +    $build['workspaces'] = [
    +      '#theme' => 'item_list',
    +      '#items' => $items,
    +    ];
    

    This is missing the #cache parts from \Drupal\Core\Entity\EntityListBuilder::render().

timmillwood’s picture

Status: Needs work » Needs review
StatusFileSize
new3.32 KB
new26.83 KB

1. Fixed - didn't need for(), setting the 4th parameter in array_slice() should do the trick.
2. Done
3. PHPStorm assures me it's thrown, but I've removed it.
4. This is already in a prefix and I couldn't get #wrapper_attributes to work, so leaving it as it is,
5. Yes, they were both on the design, but the View all x workspaces linked to a slightly different view. I'd suggest we leave them both in for now and remove after UX review if needed.
6. Done as part of my local re-roll.
7. Added.

amateescu’s picture

Thanks @timmillwood, the PHP part of the patch looks good to me. We still need a proper frontend review, but here's a thing that stood out for me:

+++ b/core/modules/workspace/css/workspace.toolbar.css
@@ -12,43 +12,250 @@
+  height: 140px;
...
+    height: 140px;

We probably don't need this since we specify the height of the dialog in workspace_toolbar().

tedbow’s picture

This is looking really good. I did notice a couple weird thing about the UX problems. Both these problems seem to happen without workspaces installed and are problems with the off-canvas dialog top. I created issues for them.
1. #2985324: The position of the toolbar moves above the off-canvas top dialog if a modal dialog is opened
2. #2985330: When the toolbar tray and the off-canvas top dialog link are both open links in the dialog are not clickable - this issue stops the user from clicking on workspace name to switch and from clicking the View all X workspaces

+++ b/core/modules/workspace/src/WorkspaceListBuilder.php
@@ -106,4 +116,121 @@ public function getDefaultOperations(EntityInterface $entity) {
+    if ($row_count > 1) {
+      $build['all_workspaces'] = [
+        '#type' => 'link',
+        '#title' => $this->t('View all @count workspaces', ['@count' => $row_count]),
+        '#url' => $active_workspace->toUrl('collection'),
+        '#attributes' => [
+          'class' => ['all-workspaces'],
+        ],
+      ];
+    }

Since the active workspace is not shown in the rows should this be > 2.

If I have only 2 workspaces, the default active 1 and the "stage" I still see "View all 2" but I can already see both.

lauriii’s picture

  1. +++ b/core/modules/workspace/css/workspace.overview.css
    @@ -0,0 +1,8 @@
    +/**
    + * @file
    + * Styling for the Workspace overview table.
    + */
    +
    +tr.active-workspace {
    +  background-color: #ebeae4;
    +}
    

    This should probably be located in Seven. We should add a comment to move this there before marking the module stable. Wondering also if there should be some other way to show the active workspace than just the styles.

  2. +++ b/core/themes/stable/css/core/dialog/off-canvas.base.css
    @@ -4,8 +4,7 @@
    -#drupal-off-canvas *,
    -#drupal-off-canvas *:not(div) {
    +#drupal-off-canvas {
    

    This seems like a quite big change for Stable. Why is this change needed? Would it be possible to do this in a separate issue and not block this issue by that?

  3. Besides this, it seems like there's still a few other things that could be improved on the CSS. Given the timeline of this issue, I will work on a patch that fixes most of the feedback I would have.
lauriii’s picture

StatusFileSize
new26.65 KB
new11.25 KB

Some CSS clean-up. Will do another review based on this on Monday.

timmillwood’s picture

Only one issue I noticed, otherwise, we're good to go:

+++ b/core/modules/workspace/css/workspace.toolbar.css
@@ -148,39 +145,35 @@ div.workspace-dialog #drupal-off-canvas .item-list a:before {
-  #toolbar-bar {
-    margin-top: 0 !important;
-  }

The removal of this is causing the toolbar to display underneath the top dialog, which is 100% height, therefore the toolbar is not seen.

amateescu’s picture

@timmillwood, we still have #60, #61 and #62.1 and .2 to address :) And @lauriii is still working on the patch as far as I understand.

timmillwood’s picture

StatusFileSize
new1.4 KB
new26.71 KB
  • +++ b/core/modules/workspace/src/WorkspaceListBuilder.php
    @@ -106,4 +116,126 @@ public function getDefaultOperations(EntityInterface $entity) {
    +    $rows = array_slice($build['table']['#rows'], 0, 4, TRUE);
    

    This should be 5, not 4.

  • #60 - Removing this breaks the active workspace box, I guess it's because it's position:fixed;.
  • #61 - Updated the row count to 2.
  • #62.1 - Added comment
  • #62.2 - This was changed so that the whole off canvas dialog gets a background, rather than just the things in the dialog. It also allows more easily set a different background color on things within the dialog such as out workspace tabs and active workspace box.
timmillwood’s picture

lauriii’s picture

StatusFileSize
new26.14 KB
new2.31 KB

#64 The problem with that selector is that it affects toolbar outside the scope of Workspaces. We probably have to find some JavaScript to override the default Toolbar behavior to fit the Workspace design, or make the off-canvas behave like Workspace expect by default.

In overall this looks good now and there isn't any beta blocking issues from my point of view.

lauriii’s picture

+++ b/core/modules/workspace/css/workspace.toolbar.css
@@ -156,6 +168,7 @@
+

Can be removed on next patch or on commit whichever comes next.

effulgentsia’s picture

Status: Needs review » Needs work

#68 needs a reroll, probably due to me committing #2975334: Prevent changes that would leak into the Live workspace a few moments ago.

anmolgoyal74’s picture

Status: Needs work » Needs review
StatusFileSize
new26.14 KB

#68 re-rolled.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new26.07 KB

#71 seems to contain some unwanted changes, at least a missing newline at the end of workspace.overview.css - didn't look further than that, so I rerolled #68 as well and fixed #69 while I was there.

Thanks @lauriii for helping get this CSS in good shape! I think we're finally done here :)

timmillwood’s picture

I second the RTBC, I just completed a manual test and it's looking as it should.

plach’s picture

Issue tags: +Needs followup
StatusFileSize
new43.89 KB

This is looking good to me as well, code-wise, and it's also looking good after manually testing the patch. I only found a minor visual glitch that doesn't need to block commit:

+++ b/core/modules/workspace/css/workspace.overview.css
@@ -0,0 +1,9 @@
+/** @todo Move to Seven theme before Workspace is marked stable. */

Can we create a follow-up for this, if it doesn't already exist and link it to this issue? Also it seems to me that we need to create follow-up issues for most of the should-have tasks listed in #37.

plach’s picture

We had signoff from @lauriii in #68 and all the must-haves @webchick and @yoroy pointed out are addressed, backend code looks good as well as manual testing.

Congrats to everyone putting effort into this, let's get it in!

  • plach committed 538a934 on 8.7.x
    Issue #2949991 by timmillwood, amateescu, doublealpha, lauriii,...

  • plach committed e5d744f on 8.6.x
    Issue #2949991 by timmillwood, amateescu, doublealpha, lauriii,...
plach’s picture

Status: Reviewed & tested by the community » Fixed
amateescu’s picture

Issue tags: -Needs followup

Woohoo!

@plach, the @todo pointed out in #74 has an issue already: #2986055: Move Workspace overview list current workspace highlight color to Seven theme

As for the should-haves in #37, two of them were already implemented in the patch, and we have #2984938: Remember the page you were on and take you back there when switching Workspaces and #2983105: Recent Workspaces section should be "per user" for the other two.

plach’s picture

Sounds good, missed the existing issues, sorry.

plach’s picture

StatusFileSize
new2.31 KB

I almost forgot: stylelint listed a set of coding standard issues for the committed patch and couldn't autofix them all, so it would be good to open a follow-up to address them (see the attached list).

plach’s picture

It would also be good to open a follow-up for the visual issue I found in #74, if there isn't one already.

andrewmacpherson’s picture

Issue summary: View changes

The WCAG "Use of color" failure from #31 is still an issue. I can see Tim addressed it in #33, and the screenshot in #44 shows the fix too.

But there was a regression somewhere between #44 and the final commit, because now we're back at the problem from #31. It looks like the selector clean up in #63 broke this. The .toolbar .toolbar-icon-workspace selector is present in the final commit, but it gets over-ridden by .toolbar .toolbar-bar .toolbar-tab > .toolbar-icon in toolbar.icons.theme.css from Stable.

EDIT: the follow-up issue is #2986193: Workspace toolbar item fails WCAG Use-of-color at narrow breakpoint.

It's a must-have blocker for stability, so I'll add it to #2732071: WI: Workspace module roadmap.

amateescu’s picture

Component: workspace.module » workspaces.module

Fix component following module rename.

Status: Fixed » Closed (fixed)

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