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

amateescu created an issue. See original summary.

andrewmacpherson’s picture

In 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.

andrewmacpherson’s picture

Issue tags: +Accessibility
amateescu’s picture

Right, 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 :)

yoroy’s picture

In general this is a good idea, for the reason mentioned: to make it clear that what you are doing impacts the whole site.

andrewmacpherson’s picture

re #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.

amateescu’s picture

The 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 :)

gábor hojtsy’s picture

I 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.

GrandmaGlassesRopeMan’s picture

fwiw, 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.

tedbow’s picture

What if we added another data attribute data-dialog-mode or data-dialog-consumer.

Then when an off-canvas dialog is open this would be automatically passed on to the data-off-canvas-main-canvas element.

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-render and data-dialog-renderer on to the data-off-canvas-main-canvas element.

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.

gábor hojtsy’s picture

@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

timmillwood’s picture

@tedbow - I'm not sure I fully follow what you're saying, but I like the idea of this being an opt-in feature

tedbow’s picture

@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

  1. add an option to data-dialog-options like drupalIsWorkpace: true.
  2. In the JS dialog:beforecreate event check for this option and Drupal.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 if drupalIsWorkpace: true is not set set because dialog:beforeclose is not guaranteed to be called.
  3. In dialog:beforeclose remove 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:

  1. Always add the border when using off_canvas_top.
  2. Add the border on a boolean option like drupalSiteShrink in data-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

Always add the border when using off_canvas_top.

but with a boolean option like drupalNoBorder in data-dialog-options to 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:aftercreate event 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

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.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

Issue tags: +high contrast

Adding reference to Windows High Contrast Mode.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.