Problem/Motivation
The Workspace UI prototype (https://marvelapp.com/2db8i71/screen/26360612) brought up the need to have the off-canvas dialog at the top of the page, a change which was implemented in #2916781: Allow off-canvas dialog to be rendered at the top of the page.
However, there is another aspect of the top off-canvas design proposal which was not considered in that issue: opening a top off-canvas dialog should convey the fact that you are editing something which impacts your whole site, as opposed to the side off-canvas dialog where you edit something related to current page only.
The design choses to make the "site-wide impact" more prominent by wrapping the entire site with a 40px dark gray border.
Proposed resolution
Should we implement this aspect of the design generically in the off-canvas library? The reason would be that any other module which uses the top off-canvas dialog position need to convey a similar message, that you are editing something with a site-wide impact.
Another option is to make this "wrapping" behavior opt-in, allowing developers to specify whether it should be added or not.
Remaining tasks
Discuss, work on a patch.
User interface changes
The top off-canvas dialog also wrap the site content with a border.
API changes
Nope.
Data model changes
Nope.
Comments
Comment #2
andrewmacpherson commentedIn windows high-contrast mode, the 40px border would look very drastic. I'm wondering whether something like an extra page wrapper with a dark grey background, with a mixure of 38px padding and/or margin, plus a 2px dark-grey bordern would be better. It would look just the same in a the full colour space, but in windows high contrast mode you'd have some empty space, and a less drastic border.
Comment #3
andrewmacpherson commentedComment #4
amateescu commentedRight, I should have put quotes around "border". I didn't mean that we should implement this with the CSS border property, any means of adding that empty space will do, either margin or padding :)
Comment #5
yoroy commentedIn general this is a good idea, for the reason mentioned: to make it clear that what you are doing impacts the whole site.
Comment #6
andrewmacpherson commentedre #4 I get you, about the CSS properties used. I'm trying to understand what the UI is supposed to be telling you, so I can think about how to convey that inclusively.
Even if the thick border was just padding/margin, you'd still have the background-color difference. In the full colour space, the "website" part would be a different colour to the empty grey "border" surrounding it. But when a Windows high-contrast theme is being used, it would just look like the content got shrunk. There would be no background colour difference. If the thick border was intended to convey information, then it's a failure of WCAG "use of color".
I think the problem/motivation needs work - what does the thick grey border convey, and what does that have to do with workspaces?
"Site-wide impact" doesn't sound like it's specific to Workspace UI. Let's say I don't have any workflow/workspace modules installed at all, but I do have Settings Tray. If I use the Contextual links to edit a block title in the sidebar, that affects the whole site, but it's nothing to do with workspaces.
So what's different about workspaces that can be conveyed by a thick grey border? How would we convey that to a blind person, using a screen reader, or a sighted person using Windows high-contrast mode?
Edit: Sorry, this was a bit of a rant. My concern is that whitespace can't convey anything specific, it's just a vague separator.
Comment #7
amateescu commentedThe difference between changing a block's title in the sidebar and switching to a different workspace is the impact of the change you are making. The block title change is something.. "minor" (can't find a better word), while switching to a different workspace potentially means that the entire site's content is completely different, for example: other nodes listed on the front page and/or a taxonomy term page, other information listed in an "about us" page, etc.
And whether or not this extra visual helper is a good idea is exactly the point of this issue to decide :)
Comment #8
gábor hojtsyI think the border does help convey the meaning to sighted users. I also believe the content and behavior of the tray itself (as read out) should convey that too. It says you are making a workspace live, etc. The border "just" underscores that, it should not be the only way where this is conveyed and I don't believe it is the only way.
As to where to put it. I think if we want to have common interaction patterns then off-canvas trays opening from the top should have distinctly different roles than trays opening from the side. Looks like we already made the decision that stuff typically used to touch up on things will open from the side and stuff doing more major things will open from the top. I think its fine to encode that assumption in the default styling of the top tray. (People can still undo it if they really want). Given how this affects the reusability of an API item, this could use framework manager feedback as well.
Comment #9
GrandmaGlassesRopeManfwiw, I don’t think this should be part of the off-canvas library. This looks like an implementation detail that is specific to workspaces, and it should be implemented there.
Comment #10
tedbowWhat if we added another data attribute
data-dialog-modeordata-dialog-consumer.Then when an off-canvas dialog is open this would be automatically passed on to the
data-off-canvas-main-canvaselement.So then if workspaces wanted to provide visual border it could just use CSS to target.
[data-off-canvas-main-canvas][data-dialog-consumer='workspaces']This would have actually been use in Settings Tray because we could have controlled edit mode in the same manner.
On the other hand if we want all uses of the top try to have the "site-wide impact" effect then would just pass on the
data-dialog-renderanddata-dialog-rendereron to thedata-off-canvas-main-canvaselement.Then you could simply target
[data-off-canvas-main-canvas][data-open-dailog='dialog.off_canvas_top'].Of course maybe we should be setting these as CSS classes.
Comment #11
gábor hojtsy@drpal: what is different between a top off-canvas library and a side off-canvas library then? should we not be opinionated about what each are for, so its not "randomly picked" based on module developer preference? :)
like, for example, a classic dialog as used in views for example is quite opinionated about graying out the background and disabling controls there, its not just "some markup displayed above the page (that could have just as been side of page)", it has certain styling and behavior to guide its use
Comment #12
timmillwood@tedbow - I'm not sure I fully follow what you're saying, but I like the idea of this being an opt-in feature
Comment #13
tedbow@timmillwood sorry for not responding sooner.
I think as far as "the ability to wrap the entire page with a border" you could do this right now.
One way
data-dialog-optionslikedrupalIsWorkpace: true.dialog:beforecreateevent check for this option andDrupal.offCanvas.isOffCanvas($element)and add a class to[data-off-canvas-main-canvas]element that provides the border. You also want remove the class here ifdrupalIsWorkpace: trueis not set set becausedialog:beforecloseis not guaranteed to be called.dialog:beforecloseremove the class from[data-off-canvas-main-canvas]element.That would be Workspace specific way. I do think though that this is probably something that should be provided by the off-canvas library if we are going to do it because we don't contrib modules trying to do something similar but it looking slightly different.
So it seems like the 2 options are:
off_canvas_top.drupalSiteShrinkindata-dialog-options.If we want to do 1) I think we need to do it before 8.6.0 because #2916781: Allow off-canvas dialog to be rendered at the top of the page was not committed to 8.5.x. So no sites should be using the top dialog yet. Once they do I think automatically adding the border when using the top dialog would be BC break I think because sites would using it without the behavior.
UPDATE: I guess 3rd option I just thought of would be to do
but with a boolean option like
drupalNoBorderindata-dialog-optionsto not do the border. This would mean that we are encouraging it but if they have a dialog that don't want it on they could remove it.I like that because really they could remove it anyways either through CSS that overrides ours or by removing the class in their own
dialog:aftercreateevent listener. Giving the option to remove would hopefully ensure that we don't have multiple contrib modules removing it different possibly conflicting ways.I like this 3rd option best
Comment #24
mgiffordAdding reference to Windows High Contrast Mode.