Skip to content

Enforce homogenous multi-selections #4887

@abey79

Description

@abey79

Currently, the multi-selection (using ctrl/cmd-click) is unrestricted and can be fully heterogenous in item types (e.g. it can contain both a container and component). This is problematic in at least two areas:

We should change how the multi-selection behaves to make the above easier to implement and more predictable for the user.

TL;DR: do like figma

Export-1706004828461

First, we should distinguish two classes of items:

  • Layout items: container and space views
  • Data items: entity tree and components

Given this definition, we should introduce two major restrictions to what a multi-selection can contain:

  • It must be homogenous in layout vs. data items (ie. can't contain both a container and an entity).
  • It must only contain items leading to disjoint subtrees (ie. you can't select both a container, and a space view contained in said container).
    • In particular, when the user multi-selects A that is some parent of already-selected B, this should happen:
      • A is added to the selection
      • B is removed to the selection...
      • ...but B is implicitly selected by virtue of being a direct or indirect child of A

The UI should reflect the above by introducing a "subdued" selected state for children of selected items (basically like Figma).

Related:

Blocked by:

Finally, we should introduce an "extend selection" behaviour (shift-click) that is aware of the above.

Export-1706005434047

Metadata

Metadata

Assignees

No one assigned

    Labels

    uiconcerns graphical user interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions