diff --git a/app/gui2/e2e/collapsingAndEntering.spec.ts b/app/gui2/e2e/collapsingAndEntering.spec.ts index bb831c617f6..aba9ac26e29 100644 --- a/app/gui2/e2e/collapsingAndEntering.spec.ts +++ b/app/gui2/e2e/collapsingAndEntering.spec.ts @@ -27,18 +27,20 @@ test('Leaving entered nodes', async ({ page }) => { await actions.goToGraph(page) await enterToFunc2(page) - await locate.graphEditor(page).dblclick() + await page.mouse.dblclick(100, 100) await expectInsideFunc1(page) - await locate.graphEditor(page).dblclick() + await page.mouse.dblclick(100, 100) await expectInsideMain(page) }) test('Using breadcrumbs to navigate', async ({ page }) => { await actions.goToGraph(page) await enterToFunc2(page) - await locate.graphEditor(page).dblclick() - await locate.graphEditor(page).dblclick() + await page.mouse.dblclick(100, 100) + await expectInsideFunc1(page) + await page.mouse.dblclick(100, 100) + await expectInsideMain(page) // Breadcrumbs still have all the crumbs, but the last two are dimmed. await expect(locate.navBreadcrumb(page)).toHaveText(['main', 'func1', 'func2']) await expect(locate.navBreadcrumb(page, (f) => f.class('inactive'))).toHaveText([ @@ -61,9 +63,19 @@ test('Collapsing nodes', async ({ page }) => { const initialNodesCount = await locate.graphNode(page).count() await mockCollapsedFunctionInfo(page, 'final', 'func1') - await locate.graphNodeByBinding(page, 'ten').click({ modifiers: ['Shift'] }) - await locate.graphNodeByBinding(page, 'sum').click({ modifiers: ['Shift'] }) - await locate.graphNodeByBinding(page, 'prod').click({ modifiers: ['Shift'] }) + // Widgets may "steal" clicks, so we always click at icon. + await locate + .graphNodeByBinding(page, 'ten') + .locator('.icon') + .click({ modifiers: ['Shift'] }) + await locate + .graphNodeByBinding(page, 'sum') + .locator('.icon') + .click({ modifiers: ['Shift'] }) + await locate + .graphNodeByBinding(page, 'prod') + .locator('.icon') + .click({ modifiers: ['Shift'] }) await page.keyboard.press(COLLAPSE_SHORTCUT) await expect(locate.graphNode(page)).toHaveCount(initialNodesCount - 2) @@ -77,7 +89,10 @@ test('Collapsing nodes', async ({ page }) => { await customExpect.toExist(locate.graphNodeByBinding(page, 'sum')) await customExpect.toExist(locate.graphNodeByBinding(page, 'prod')) - locate.graphNodeByBinding(page, 'ten').click({ modifiers: ['Shift'] }) + locate + .graphNodeByBinding(page, 'ten') + .locator('.icon') + .click({ modifiers: ['Shift'] }) // Wait till node is selected. await expect(locate.graphNodeByBinding(page, 'ten').and(page.locator('.selected'))).toHaveCount(1) await page.keyboard.press(COLLAPSE_SHORTCUT) @@ -118,6 +133,8 @@ async function expectInsideFunc2(page: Page) { async function enterToFunc2(page: Page) { await mockCollapsedFunctionInfo(page, 'final', 'func1') await locate.graphNodeByBinding(page, 'final').dblclick() + await expectInsideFunc1(page) await mockCollapsedFunctionInfo(page, 'f2', 'func2') await locate.graphNodeByBinding(page, 'f2').dblclick() + await expectInsideFunc2(page) } diff --git a/app/gui2/src/bindings.ts b/app/gui2/src/bindings.ts index 4643b2cea50..0f96b8ee510 100644 --- a/app/gui2/src/bindings.ts +++ b/app/gui2/src/bindings.ts @@ -28,7 +28,7 @@ export const graphBindings = defineKeybinds('graph-editor', { deleteSelected: ['OsDelete'], zoomToSelected: ['Mod+Shift+A'], selectAll: ['Mod+A'], - deselectAll: ['Escape', 'PointerMain'], + deselectAll: ['Escape'], copyNode: ['Mod+C'], pasteNode: ['Mod+V'], collapse: ['Mod+G'], diff --git a/app/gui2/src/components/CircularMenu.vue b/app/gui2/src/components/CircularMenu.vue index 11afe43e18f..b5dcb5f9124 100644 --- a/app/gui2/src/components/CircularMenu.vue +++ b/app/gui2/src/components/CircularMenu.vue @@ -18,7 +18,12 @@ const emit = defineEmits<{