Mobile File Tree Browser: click outside the component closes only when applicable

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Context

when the file tree browser panel is open, and users click into the page area outside the file tree browser, the panel should automatically close. This is a general web pattern that gives users faster access to the element they are trying to focus/click on (if they're trying to focus outside of the file tree browser panel). See #569507 (comment 2851694452)

Design proposal

See #581018 (comment 2958387035).

  • In moible viewport sizes where the file tree browser panel appears, add a behavior that allows users to click outside the component to close the file tree browser.
  • This behavior only applies to mobile viewport sizes < 768px.

For reference, the viewport breakpoints in #583851 are:

Viewport Proposed

xs

<576px

Mobile. Panel.

mobile-panel.jpg

  • To close the panel, click on the file tree button or click anywhere outside the panel #581018

sm

≥576px

Mobile. Panel.

mobile-panel.jpg

  • To close the panel, click on the file tree button or click anywhere outside the panel #581018

md

≥768px

Side-by-side

768px viewport width.jpg

lg

≥992px

Side-by-side

992px.jpg

xl

≥1200px

Desktop. Side-by-side.

desktop.png

Edited by 🤖 GitLab Bot 🤖