Put the dashboard panels away on a click off the widgets

Mirrors the flow editor's onPaneClick: clicking the canvas margin or the
empty surface closes the widget settings and the dashboard panel. Widget
frames, grid resize handles and menus portalled out of the canvas keep it
open.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1moruzue2kTJd3uVisgNk
This commit is contained in:
2026-08-28 11:19:30 +02:00
co-authored by Claude Opus 5
parent e18a669aa0
commit 7e8fd1182e
2 changed files with 37 additions and 0 deletions
+15
View File
@@ -135,6 +135,21 @@ test("the drag handle moves a widget without selecting it", async ({
await expect(settings).toBeVisible()
})
test("clicking off the widgets puts the settings panel away", async ({
page,
}) => {
await openEditor(page)
const settings = page.getByTestId("widget-settings")
await page.getByTestId("widget-frame").filter({ hasText: "Top" }).click()
await expect(settings).toBeVisible()
// The margin around the canvas is not a widget, the way the flow pane is not
// a node.
await page.getByTestId("dashboard-canvas").click({ position: { x: 8, y: 8 } })
await expect(settings).toBeHidden()
})
test("a widget without its title can still be dragged and picked", async ({
page,
}) => {