Problem/Motivation

The right sidebar, Settings, opens when an element is selected and closes on its own: a second click on the selected element, a delete, an undo that takes the element away, Escape. Working on a display, it keeps opening and closing under the user, and since it is a column of the layout, the Canvas reflows each time.

The pin, added in #3620333: Minor fixes for next beta and extended in #3627642: Sidebar second pin when element is deleted, stops some of these: the second click and the delete. Not the undo, nor Escape. It patches an automatic behavior that other builders do not have.

Other tools and guidelines

  • Material 3 side sheets: a standard side sheet is persistent, coexists with the content, and is dismissed by its close button only. A modal side sheet is for small screens: it overlays the content and a click outside dismisses it.
  • Gutenberg: the Settings sidebar stays open across selections, showing the block when one is selected, the document when none is. A toolbar toggle opens and closes it.
  • Figma and Webflow: the properties panel is always there. Elementor: one panel switching between widgets and settings. Divi, GrapesJS and Silex: open by default, Divi with an opt-in close.

Proposed resolution

Make Settings a standard side sheet:

  • A selection changes what it shows, never whether it shows. A second click, a delete, an undo or Escape leave it open.
  • It closes on request only: its close button, a toolbar toggle next to the left sidebar buttons, and a keyboard shortcut. Its state is remembered.
  • With nothing selected, it shows an empty state, "Select an element to edit its settings", rather than closing. Display-level settings could live there later, as Gutenberg's Document tab.
  • Escape deselects. It still closes what is transient: menus and popups.
  • A selection does not reopen a sidebar the user closed, as in Gutenberg. This is the Preview split case: the user closes Settings to make room, and it stays out of the way.
  • The pin goes: it only exists to stop the automatic closing.
  • On a small screen, Settings becomes a modal sheet over the Canvas, which Escape or a click outside dismisses.

The Libraries sidebar follows the same Escape rule. Its toolbar buttons already open and close it on request.

If this is too much for now, the minimal fix keeps the pin and closes its two holes: an undo removing the shown element leaves a pinned sidebar open, empty, as a delete does, and Escape deselects instead of closing a pinned sidebar.

Remaining tasks

  • Decide: standard side sheet, or the minimal fix of the pin.
  • Decide whether a selection reopens a closed sidebar.
  • Pick the shortcut. Check both shortcut lists first: view panels and toolbar buttons.
  • Implement, with the toggle's aria-expanded and the sidebar's name, together with the sidebar child of #3624637: Plan: Builder accessibility and UX.
  • Tests, docs.

User interface changes

The Settings sidebar stays open until closed by the user, shows an empty state when nothing is selected, and loses its pin. A toolbar toggle and a shortcut open and close it.

API changes

None.

Data model changes

None. The secondDrawerPinned localStorage key is no longer read.

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

mogtofu33 created an issue. See original summary.

  • mogtofu33 committed 7fea14d2 on 1.0.x
    feat: #3628842 Settings sidebar: keep it open, close it on request only...
mogtofu33’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)