Problem/Motivation

After switching to the Stage workspace,
when I go to the workspaces listing page /admin/config/workflow/workspaces
'Live' is not listed there, which can be confusing.

(the only way to switch to live is clicking in any page on "stage" on top, and then click on "live")

Proposed resolution

Add a new row to the workspace listing which allows users to switch to Live.

Remaining tasks

Review.

User interface changes

After the patch (Live workspace is active)

After the patch (Stage workspace is active)

API changes

Nope.

Data model changes

Nope.

Release notes snippet

None.

Comments

shaal created an issue. See original summary.

amateescu’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: -Workspaces core
StatusFileSize
new1.12 KB
new30.61 KB

Workspaces provides a "Workspace switcher" block for this purpose, but how about adding an additional Switch to Live action button on that page?

amateescu’s picture

dixon_’s picture

StatusFileSize
new619 bytes
new1.05 KB

I've come across this myself as well, the inability to switch to Live from the overview is indeed annoying.

I think the ideal solution would be to:

  • add the Live workspace to the list of workspace (some sort of custom table row I guess, since it's not an actual workspace)
  • provide a single operation button just for the ability to "Switch the Live"

This way, the user interface is fully consistent for the user.

However, the above solution would result in lots of tricky/custom code which isn't ideal. The current patch is really simple, so perhaps we move forward with this as an incremental improvement.

--- a/core/modules/workspaces/src/Form/SwitchToLiveForm.php
+++ b/core/modules/workspaces/src/Form/SwitchToLiveForm.php
@@ -74,6 +74,7 @@ public function getCancelUrl() {
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->workspaceManager->switchToLive();
     $this->messenger()->addMessage($this->t('You are now viewing the live version of the site.'));
+    $form_state->setRedirect('<front>');
   }

I don't think we should redirect to the front page here. It's inconsistent with how the other "Switch" operations work from the overview page.
I think it's better to set a destination on this particular action button we're adding.

I attached a new patch that fixes this.

amateescu’s picture

Issue tags: +Needs usability review

Adding a tag to hopefully get some UX folks to chime in here :)

amateescu’s picture

Issue summary: View changes
Issue tags: -Needs usability review
StatusFileSize
new4.25 KB
new54.9 KB
new58.74 KB

This issue and #2986055: Move Workspace overview list current workspace highlight color to Seven theme were discussed in the UX meeting from Jan 16th 2020, so I'm going to merge them and post the outcome of the discussion here. There are two problems that we need to fix on the workspaces listing page:

1. Live workspace is not listed in workspaces page

Agreement from the UX meeting: Add a table row at the top of the table which allows users to switch to the Live workspace

2. The current highlight color (grey) for the table row which contains the active workspace is very unclear and it doesn't really achieve its purpose

Agreement from the UX meeting: replace the grey highlight row with a bold effect of the active workspace label, as well as a (Active) suffix

This patch implements both suggestions, and it also adds the "dot + space" pattern for hierarchies that is being proposed to be used throughout core in #2384203: Improve indentation in hierarchical select lists .

Here's a couple of "after" screenshots:

Live is the active workspace:

Local 2 is the active workspace:

amateescu credited ckrina.

amateescu’s picture

Adding credit to everyone who participated in the UX meeting :)

amateescu’s picture

Title: Live workspace is not listed in workspaces page » Improve the Workspaces listing UI

Changing to a more generic title since we're now handling more things in this issue.

dixon_’s picture

Status: Needs review » Reviewed & tested by the community

This is a really nice set of improvements from the previous patch! And the custom row for the Live workspace didn't even end up being that much custom code :)

Based on the notes from the UX call the patch nicely fixes all points. I think this is good to go!

dixon_’s picture

Issue tags: +WI critical

Taking the liberty to tag this 'WI Critical' as this is a must-have from a user perspective before marking the module stable.

xjm’s picture

Title: Improve the Workspaces listing UI » Add a row for switching to the live workspace in the Workspaces listing UI, improve the visual indication for which workspace is active, and improve the indentation in the workspace hierarchy
Status: Reviewed & tested by the community » Needs review

Retitling to capture the specific changes here.

Surprisingly, this still applies even to 9.1.x. Since Workspaces is in beta, a UI change is backportable to the production branch (which is 8.8.x for the moment and will shortly be 8.9.x). That said, don't we need to invalidate the form cache for this page? Otherwise strange things might happen.

I'm not sure about including the indentation changes here. #2384203: Improve indentation in hierarchical select lists hasn't had signoff or been adopted, so I think it'd be better to wait to adopt a new pattern until there's consensus on what's best core-wide for usability and accessibility?

amateescu’s picture

Title: Add a row for switching to the live workspace in the Workspaces listing UI, improve the visual indication for which workspace is active, and improve the indentation in the workspace hierarchy » Add a row for switching to the live workspace in the Workspaces listing UI and improve the visual indication for which workspace is active
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.79 KB
new2.4 KB

@xjm, this page is not a form, it's only a table as provided by the entity list builder :) Sadly.. reverted the indentation bits.

xjm’s picture

s/form/render/g in my comment then. ;)

xjm’s picture

Queued the 9.0 and 9.1 tests in environments that are actually supported by D9.

xjm’s picture

Title: Add a row for switching to the live workspace in the Workspaces listing UI and improve the visual indication for which workspace is active » Add a row for switching to the live workspace in the Workspaces listing UI
Issue tags: +Needs followup

Much easier issue scope to understand. I'd suggest filing a followup if you want to improve the indentation in the future, possibly postponed on whatever the outcome is for that other issue. That followup will also need accessibility review.

Edit: Actually, I would just title the followup "Make Workspace list indentation accessible". I'd imagine this might involve some aria or such, since what the indentation is trying to communicate is actually hierarchy.

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

The updated patch looks good. It occurred to me though that we should probably have a browser test for the new "Switch to live" row.

Also, is bold text sufficient to communicate which workspace is active? That also seems like an accessibility issue. (It might be better from a design standpoint than the background color, but it's still not sufficiently accessible to be the sole thing conveying the information about which workspaces is active.) So we need an accessibility bug for that as well. I'm OK with that being a followup, and making the "switch to live" row the scope of the focus here (since the background color could cause confusion with that also). So, two followups, both major bugs (and WI critical, because of the accessibility gate):

  1. Make Workspace list indentation (hierarchy) accessible
  2. Make indication of the active workspace on the Workspace list accessible
xjm’s picture

Priority: Normal » Major

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

amateescu’s picture

Version: 8.9.x-dev » 9.1.x-dev
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new3.78 KB
new41.92 KB
new45.12 KB

Ok, let's keep this issue focused only on adding the row for switching to Live. Here's a new patch with test coverage, and an updated issue summary.

amateescu’s picture

Issue tags: -Needs followup

Here's the followup for "Make indication of the active workspace on the Workspace list accessible": #3207233: Improve the visual indication of the active workspace in the Workspaces listing UI

Note that Workspaces is currently using core's standard indentation mechanism, so a 'WI critical' followup for "Make Workspace list indentation (hierarchy) accessible" is not needed.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC - looks great to me

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 23: 3092553-23.patch, failed testing. View results

amateescu’s picture

Status: Needs work » Reviewed & tested by the community

Looks like a random fail.

larowlan’s picture

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

9.1 has had it's last bugfix release, so moving this to 9.2

larowlan’s picture

Queued testing on 9.3 and 9.2

the patch looks good to me, if the tests come back green I'll commit this sometime this week

  • larowlan committed 00465f2 on 9.2.x
    Issue #3092553 by amateescu, dixon_, shaal, xjm, ckrina, jrockowitz,...
  • larowlan committed ea475b4 on 9.3.x
    Issue #3092553 by amateescu, dixon_, shaal, xjm, ckrina, jrockowitz,...
larowlan’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Bug Smash Initiative

Committed ea475b4 and pushed to 9.3.x. Thanks! Cherry-picked to 9.2.x as the risk of disruption here is low and Workspaces is still experimental.

Status: Fixed » Closed (fixed)

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