diff --git a/src/editor/debugHook.ts b/src/editor/debugHook.ts index 669e3d5b..0249511f 100644 --- a/src/editor/debugHook.ts +++ b/src/editor/debugHook.ts @@ -14,6 +14,7 @@ import { Button, currentMenu, isRendering, + Panel, renderCount, requestRender, ui, @@ -215,6 +216,8 @@ export function installDebugHook(app: Application, state: EditorState, editor: E const widget = ui().focus.focused; return widget ? rectOf(widget) : null; }, + /** What a panel dragged shut keeps: its header. Follows the theme, so checks need not. */ + panelHeader: Panel.HEADER_HEIGHT, inspectorInfo: () => inspector.debugInfo(), textColor, overlayTexts, diff --git a/tools/e2e/06-graph.mjs b/tools/e2e/06-graph.mjs index 87850d5b..04a8c483 100644 --- a/tools/e2e/06-graph.mjs +++ b/tools/e2e/06-graph.mjs @@ -128,7 +128,10 @@ export async function graph(t) { // comes before one that merely mentions it in its description. "variable" used to hand // Enter the first row alphabetically, which was `Run behavior`. const beforeRank = await graphCounts(); - await click(bare.x, bare.y, 'right'); + // A fresh spot: the Log node from 6d now sits where `bare` pointed, and whether a click there + // hits it depends on how the layout snaps the node, not on anything this step tests. + const bareRank = await json('__gm.graph.emptySpot()'); + await click(bareRank.x, bareRank.y, 'right'); await typeText('variable'); const ranked = await json('__gm.graph.paletteRows()'); const hits = (row) => `${row.label} ${row.type}`.toLowerCase().includes('variable'); diff --git a/tools/e2e/14-overflow.mjs b/tools/e2e/14-overflow.mjs index 5a78722b..a51e3b90 100644 --- a/tools/e2e/14-overflow.mjs +++ b/tools/e2e/14-overflow.mjs @@ -181,9 +181,10 @@ export async function overflow(t) { ); await drag(lower.splitter.x, lower.splitter.y, lower.splitter.x, lower.splitter.y - 2000, { steps: 10 }); const shut = await column(); + const header = await json('__gm.panelHeader'); check( 'dragged all the way up the asset panel stops at its header', - near(shut.assets.h, 30) && shut.objects.y > shut.assets.y, + near(shut.assets.h, header) && shut.objects.y > shut.assets.y, JSON.stringify(shut), ); await drag(shut.splitter.x, shut.splitter.y, shut.splitter.x, start.splitter.y, { steps: 10 }); diff --git a/tools/e2e/27-console.mjs b/tools/e2e/27-console.mjs index 0dda9aa6..698a847e 100644 --- a/tools/e2e/27-console.mjs +++ b/tools/e2e/27-console.mjs @@ -168,9 +168,10 @@ export async function consolePanel(t) { const bar2 = await json('__gm.console.splitterAt()'); await drag(bar2.x, bar2.y, bar2.x, bar2.y + 400, { steps: 10 }); const shut = await height(); - check('dragged shut it stops at its own header instead of vanishing', shut === 30, shut); + const header = await json('__gm.panelHeader'); + check('dragged shut it stops at its own header instead of vanishing', shut === header, { shut, header }); const bar3 = await json('__gm.console.splitterAt()'); - await drag(bar3.x, bar3.y, bar3.x, bar3.y - (start - 30), { steps: 8 }); + await drag(bar3.x, bar3.y, bar3.x, bar3.y - (start - header), { steps: 8 }); check('and it comes back to the height it started at', (await height()) === start, await height()); const left = await rig.remove();