Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
workspaces.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Mar 2018 at 10:40 UTC
Updated:
7 Aug 2018 at 12:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
timmillwoodHere'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.
Comment #3
andrewmacpherson commentedI'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.)
Comment #4
timmillwood@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.
Comment #5
timmillwoodComment #6
timmillwoodLatest 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.
Comment #7
timmillwoodComment #9
andrewmacpherson commentedThere 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.
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.
Comment #10
ckrinaAdding 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?
Comment #11
timmillwood@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.
Comment #12
dixon_Comment #13
timmillwoodOnly 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.
Comment #14
doublealpha commentedHere 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
Comment #15
timmillwoodHere's a combined patch including the changes from #14 and #2916781: Allow off-canvas dialog to be rendered at the top of the page.
Comment #17
timmillwoodFixing failing tests and all non css or js coding standards issues.
Comment #18
timmillwoodBlocker just got in!!!
Comment #19
amateescu commentedRerolled 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.
Comment #20
amateescu commentedCleaned up a few things that weren't necessary.. I think.
Comment #21
amateescu commentedOpened two issues which should allow us to remove some custom styling from this patch:
#2976287: The off-canvas dialog should have a 1px transparent border
#2976385: Provide the ability to wrap the entire page with a border when opening off-canvas in the top position
Comment #22
martijn de witThe resizing off the off-canvas is still broken; #2928531 - Off-canvas resize handlers are broken by dialog.css in Classy theme and System tray module
Comment #23
amateescu commented@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.
Comment #24
martijn de witYes 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.
Comment #25
amateescu commentedThe 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 :)
Comment #26
timmillwoodI'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 theworkspace-dialogdiv.- 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.
Comment #27
andrewmacpherson commentedA 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:
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:

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.
Comment #28
andrewmacpherson commentedThe "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: currentColorso 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; }fromcore/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.Comment #29
andrewmacpherson commentedThe 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!
Comment #30
andrewmacpherson commentedThe 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.
Comment #31
andrewmacpherson commentedThere'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:
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.
Comment #32
andrewmacpherson commentedHere'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:
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".
Comment #33
timmillwoodI'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:

Comment #37
webchickWe 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:
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:
Comment #38
timmillwoodTaking an initial stab a the must-have items.
Comment #39
timmillwooddiv.workspace-dialog a:focus { outline:none; }as suggested in #28 to make the dialog more consistent across themes.Comment #40
timmillwoodMoved the "active workspace at top of the list" to the load method on the entity list builder to simplify and make it more readable.
Comment #41
timmillwoodI thought an updated screenshot might be useful:
Comment #42
timmillwoodThere'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.
Comment #43
timmillwoodTalking to @berdir he suggested doing something similar to
\Drupal\Core\Access\RouteProcessorCsrfand alter the query string there.Comment #44
doublealpha commentedComment #45
doublealpha commentedComment #46
doublealpha commentedSorry, I incorrectly outputted the patch and interdiff in #44. Please use these.
Comment #47
timmillwoodComment #49
timmillwoodLooks like workspace.overview.css is missing from the latest patch.
Comment #50
doublealpha commentedHere's an updated patch that includes workspace.overview.css.
Comment #51
doublealpha commentedComment #52
timmillwoodThanks @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.Comment #53
manuel garcia commentedSome comments on the CSS:
These seem to be overly qualifying css selectors, for instance,
div.workspace-dialog #drupal-off-canvascould 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 :)Comment #54
timmillwood#drupal-off-canvaswould 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.Comment #55
manuel garcia commentedhumm isn’t qualifying with
.active-workspaceetc after that good enough?Comment #56
timmillwoodMaybe 🙂
Comment #57
amateescu commentedHere's a review for the non-css parts:
\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 regularfor ()instead.Needs a proper doc block :)
I don't see this thrown in the method..
Do we really need to put the
<span>element insidet(), can't we use#prefixor'#wrapper_attributes'to add a class to the wrapper element?We now have a
View all X workspaceslink, so this one is redundant and can be removed.Let's play nice with #2958752: Refactor workspace content replication plugin system to three services and use
!$active_workspace->isDefaultWorkspace()instead :)This is missing the
#cacheparts from\Drupal\Core\Entity\EntityListBuilder::render().Comment #58
amateescu commentedComment #59
timmillwood1. Fixed - didn't need
for(), setting the 4th parameter inarray_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_attributesto work, so leaving it as it is,5. Yes, they were both on the design, but the
View all x workspaceslinked 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.
Comment #60
amateescu commentedThanks @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:
We probably don't need this since we specify the height of the dialog in
workspace_toolbar().Comment #61
tedbowThis 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
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.
Comment #62
lauriiiThis 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.
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?
Comment #63
lauriiiSome CSS clean-up. Will do another review based on this on Monday.
Comment #64
timmillwoodOnly one issue I noticed, otherwise, we're good to go:
The removal of this is causing the toolbar to display underneath the top dialog, which is 100% height, therefore the toolbar is not seen.
Comment #65
amateescu commented@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.
Comment #66
timmillwoodThis should be
5, not4.position:fixed;.Comment #67
timmillwoodCreated two follow ups for #62 as requested by @lauriii on Slack:
#2986055: Move Workspace overview list current workspace highlight color to Seven theme
#2986056: Off-canvas dialogs have a background for all items in the dialog but not for the dialog
Comment #68
lauriii#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.
Comment #69
lauriiiCan be removed on next patch or on commit whichever comes next.
Comment #70
effulgentsia commented#68 needs a reroll, probably due to me committing #2975334: Prevent changes that would leak into the Live workspace a few moments ago.
Comment #71
anmolgoyal74 commented#68 re-rolled.
Comment #72
amateescu commented#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 :)
Comment #73
timmillwoodI second the RTBC, I just completed a manual test and it's looking as it should.
Comment #74
plachThis 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:
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.
Comment #75
plachWe 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!
Comment #78
plachComment #79
amateescu commentedWoohoo!
@plach, the
@todopointed out in #74 has an issue already: #2986055: Move Workspace overview list current workspace highlight color to Seven themeAs 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.
Comment #80
plachSounds good, missed the existing issues, sorry.
Comment #81
plachI almost forgot:
stylelintlisted 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).Comment #82
plachIt would also be good to open a follow-up for the visual issue I found in #74, if there isn't one already.
Comment #83
andrewmacpherson commentedThe 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-workspaceselector is present in the final commit, but it gets over-ridden by.toolbar .toolbar-bar .toolbar-tab > .toolbar-iconintoolbar.icons.theme.cssfrom 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.
Comment #84
andrewmacpherson commentedComment #85
amateescu commentedFix component following module rename.