Problem/Motivation

When creating a new workspace through the UI, switching into it automatically improves the user experience.

Remaining tasks

Review.

User interface changes

The 'add workspace' form has a new default action: Save and switch. The Save button has been kept as the secondary action.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Nope.

Issue fork drupal-3278377

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

amateescu created an issue. See original summary.

amateescu’s picture

Status: Active » Needs review
StatusFileSize
new4.77 KB

This should do it.

Status: Needs review » Needs work

The last submitted patch, 2: 3278377.patch, failed testing. View results

amateescu’s picture

Status: Needs work » Needs review
Issue tags: +Needs usability review

Fixing those tests will take a bit of effort, so let's gather consensus on the actual proposal before working further on the code.

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.

s_leu’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.43 KB
new627 bytes

Extended the patch with changes in tests which made all tests pass for me locally (didn't run functional JS tests though). From my point of view this is RTBC, as there's no benefit in remaining inside the live workspace when creating a new workspace, or at least it's more beneficial to switch to the created workspace in most scenarios.

rkoller’s picture

hm i am not sure. leaving the user the option might be a good choice. an easy way might be to add a checkbox to the add workspace page. that could be set per default to something like "switch to the new workspace" (not the suggested wording). so the default behavior would be like what the patch is introducing but still there would be the option for the user to uncheck and remain in the current workspace?

s_leu’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new8.14 KB
new12.6 KB

Uploading the right patch...

pooja saraah’s picture

StatusFileSize
new12.79 KB
new485 bytes

Fixed failed commands on #8

amateescu’s picture

@rkoller:

the default behavior would be like what the patch is introducing but still there would be the option for the user to uncheck and remain in the current workspace?

The new feature introduced here is that the new workspace will be activated automatically only if it was created from Live, not from another workspace. If you create a workspace while you're in another workspace, the behavior doesn't change, so my opinion is that the checkbox will be unnecessary clutter :)

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.

Status: Needs review » Needs work

The last submitted patch, 9: 3278377-9.patch, failed testing. View results

s_leu’s picture

Status: Needs work » Needs review

Not sure, but I think it's enough if tests pass on 10.1.x to get this in, right?

amateescu’s picture

Yup, but we still need usability review for it :)

simohell’s picture

Status: Needs review » Needs work

Hi,

I'm afraid this feature as it is in patch #9 is definitely a no-go. There a couple of major issues here that fail Nielsen's #1 usability heurestic:
Visibility of system status: "Communicate clearly to users what the system’s state is — no action with consequences to users should be taken without informing them."

1) The same action "Save" should always render the same result: save. If the button does something else, it should be indicated by the button. This relates also to "recognition rather than recall" principle as there is no information given that a switch would happen.

Possible solution: Add another button saying "Save and switch" but keep the option for user to only "Save" as well

2) Saving and switching does not sufficiently inform the user about switching workspace. When user switches a workspace one of the two status messages is displayed (I don't really understand why the difference between the messages for Live and others):

Status message
Third is now the active workspace.

Status message
You are now viewing the live version of the site.

but neither of these messages are displayed when user creates a new workspace while on Live workspace. In that case the message is same with "normal" save action:

Status message
Workspace Fourth has been created.

Possible solution: display both the creation message and the switching message if user clicks "Save and switch".

3) If user switches workspace there is dialogue confirming that user wants to switch to another workspace. There is no confirmation when user saves a new workspace and is switched automatically. This is inconsistent behaviour and especially important as there is no indication in advance that the workspace would be switched. If there is a separate action button for the double action, then this is mitigated.

(Also there is a technical possibility to create workspaces named "Live" where the only change in UI would be the change of background colour in the workspace indicator - but this is not a real problem, only a theoretical case. Could be an April fools joke but not a real use case...)

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.

amateescu’s picture

Status: Needs work » Needs review

@simohell, thanks for the review! Implemented all the suggestions from #15 by adding a new Save and activate action button (as the default one) when adding a new workspace, and displaying the activation message separately.

amateescu’s picture

Hiding old patches because we have a MR now.

rkoller’s picture

thanks for implementing the suggestions! i've manually tested, overall it looks good, there is only one small detail i've noticed. The newly added button Save and activate is using the verb "activate" while on the workspaces overview page Switch to... is used on the buttons with "switch" as the verb. Technically if you click the Switch to... button on the overview page you get "Activate the ... workspace" on the confirmation page step. For the Save and activate button that confirmation page step is not necessary and the workspace is directly activated which is a good thing. But still that inconsistency of the used verb might be potentially confusing to users and being consistent here might help?

amateescu’s picture

@rkoller, I also debated that a bit with myself and I thought "activate" sounds better, but I don't mind using Save and switch instead. Pushed that change to the MR :)

rkoller’s picture

thanks for the fast turn around! yep i agree technically both variants work and as you said save and activate "slightly" sounds better but in regards of consistency Save and switch is the preferable choice imho. plus i've just noticed back then in the ux review we've also agreed on Save and switch (ref #15). So this issue looks good to go from a manual testing perspective, but not sure if i am eligible to rtbc it or if still someone has to take another look at the code?

amateescu’s picture

Issue tags: -Needs usability review

@rkoller, thank you as well for testing! If you feel comfortable with reviewing the code changes, then you can also RTBC the issue, otherwise you can leave that part for someone else. A core committer will ultimately review the code anyway :)

I'll just remove the tag for now, since the usability part of the issue was reviewed and approved.

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Applied some small suggestions to the MR. Will mark after the tests run.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

All green!

  • catch committed a20e795b on 10.3.x
    Issue #3278377 by amateescu, s_leu, smustgrave, pooja saraah, rkoller,...

  • catch committed d84f2c9d on 11.x
    Issue #3278377 by amateescu, s_leu, smustgrave, pooja saraah, rkoller,...
catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Not entirely convinced by the ::create trick but it does remove a tonne of boilerplate and it's very easily reversible if we want to override the constructor again.

Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!

amateescu’s picture

Issue summary: View changes
smustgrave’s picture

I’ve seen it a few times in contrib modules nothing breaks but phpstorm complains about the typehint

simohell’s picture

Status: Fixed » Closed (fixed)

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