IMPLEMENTED: Improve Structure Panel Auto-Scroll Logic

Current Issue

The structure panel’s auto-scroll behavior currently centers selected items regardless of context, which creates significant usability problems:

  • Accidental clicks: When clicking on already-visible items in the structure panel, the auto-scroll moves the element away from the user’s cursor position, often resulting in unintended clicks on other elements
  • Disruptive workflow: The constant repositioning interrupts the user’s flow when working directly within the structure panel
  • Unnecessary movement: Elements that are already in view don’t need to be repositioned

Proposed Solution

Implement conditional auto-scroll logic based on selection context:

When to Scroll (Canvas → Structure Panel)

  • Selection from canvas: Auto-scroll and expand the structure panel to reveal the selected element
  • Out-of-view elements: Scroll only when the target element is outside the visible area (off-screen above or below)
  • Collapsed parents: Expand parent containers to reveal nested elements when selected from canvas

When NOT to Scroll (Structure Panel → Structure Panel)

  • Direct panel selection: No scrolling when clicking directly on visible items in the structure panel
  • Already visible elements: Skip repositioning if the element is currently in view

Example Implementation Logic

if (selectedFrom === "canvas") {
    if (elementNotInView || parentCollapsed) {
        scrollIntoView();
        expandParentIfNeeded();
    }
} else if (selectedFrom === "structurePanel") {
    // No scrolling in structure panel
    // Canvas can still scroll to show off-screen elements
}

This enhancement would significantly improve the user experience by making the auto-scroll behavior more intelligent and less intrusive while preserving its core functionality.

3 Likes

Hi @Cracka,

I’m just informing you that I’ve added the suggestion to our internal task tracker, and it will be implemented. :slight_smile:
Once we implement it, we will update this topic.

Thank you,
Matej

1 Like

We added this imrpovement in Bricks 2.2 RC, now available as a manual download in your account (see changelog).

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production website. It is intended for testing in a local or staging environment only.

1 Like

Awesome! I’ll test it out and give a feedback.

Just tested it and it works great! working in Bricks feels much better now.

Next thing to improve would be to make the left panel code block input or css input remember the width we keep it at, and not expand each time we click on the content tab. I’ll put in an improvement entry for that, too.