Overview

  1. It should be possible to select multiple components
  2. It must be possible to create “Sections” by selecting multiple components and saving them as a single Section.
  3. It must be possible to Copy/Paste multiple components simultaneously
  4. It must be possible to Drag and drop multiple components simultaneously

This issue is to address the first of those 4 requirements

Multi select of components is needed for different purposes. Once you have selected a group you may want to copy/paste, dragging/rearrange them, or save them as a "Section".

Proposed resolution

First step is to come up with a plan on how we can achieve changing the "Selected" component to be an array of selected components. Both from a how do we do that in the code but also what does that user interaction feel like and what does it look like - how do we show it in the UI etc.

Currently the selected component is defined in the React Router url as a UUID. This might prove technically challenging to change to being an array of selected components.

The right hand panel will show a new UI when multiple components are selected. The design screenshot below shows a suggestion from the design team on what we should show.

I propose we introduce a way of distinguishing between different types of multi-selections:
a) One or more consecutive sibling components.
b) Non-consecutive siblings (e.g., a random set of components from across the page).

There is a third type, that I think we need to prevent (c) being allowed/avoid being able to do.

c) Complex nested selections e.g. Selecting a parent and one of its children/grandchildren at the same time

When a user adds a new item to the selection, we must check:

  1. Is the newly selected item a descendent (child/grandchild etc) of an already selected item
  2. Is the newly selected item a parent/grandparent of an already selected item.

In either of the above cases, the existing item should be removed from the selection and replaced with the item being added.

Being able to determine if a selection is (a), (b) or (c) type is will allow us to base behaviours on the type of selection - e.g. You can only "Save as section" when the selection is (a) type.

User interface changes

Working multi select!

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

jessebaker created an issue. See original summary.

wim leers’s picture

Priority: Normal » Major
Issue tags: +stable blocker

Once you have selected a group you may want to copy/paste, dragging/rearrange them, or save them as a "Section".

This literally came up twice at DrupalCon!

jessebaker’s picture

Issue summary: View changes
jessebaker’s picture

Issue summary: View changes
StatusFileSize
new704.78 KB

jessebaker’s picture

Assigned: jessebaker » Unassigned
Status: Active » Needs review
wim leers’s picture

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

hooroomoo’s picture

Status: Needs review » Needs work

Manually tested and works great.

Left some comments and the multi-select e2e test has a fail

jessebaker’s picture

Issue summary: View changes
StatusFileSize
new128.37 KB

Adding demo gif to summary.

jessebaker’s picture

Status: Needs work » Needs review

Addressed feedback on the first review, would like a approval on those updates

  • jessebaker committed 534ffcb0 on 0.x
    Issue #3483485 by jessebaker, hooroomoo: Selecting multiple components
    
jessebaker’s picture

Status: Needs review » Fixed

Fixed and merged!

As this is just phase one, I have hidden multi select behind the isDevMode flag which can be enabled by installing the "Experience Builder dev mode" Drupal module.

Multi select currently allows for selecting multiple components at once but does not yet allow a user to perform "bulk" actions like dragging multiple or copy, save, duplicate etc.

Status: Fixed » Closed (fixed)

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