fix: cloneNode uses Ctrl+C/V instead of right-click Clone menu

The "Clone" context menu item doesn't exist in Nodes 2.0 mode.
Using Ctrl+C/Ctrl+V works in both legacy and Nodes 2.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
snomiao
2026-03-27 00:22:31 +00:00
parent 722b01a253
commit de810f88a4

View File

@@ -793,13 +793,14 @@ async function executeAction(
break
}
case 'cloneNode': {
await page.mouse.move(step.x, step.y)
// Select node then Ctrl+C/Ctrl+V — works in both legacy and Nodes 2.0
await page.mouse.click(step.x, step.y)
await sleep(300)
await page.mouse.click(step.x, step.y, { button: 'right' })
await page.keyboard.press('Control+c')
await sleep(200)
await page.keyboard.press('Control+v')
await sleep(500)
await clickSubmenuItem(page, 'Clone')
await sleep(500)
console.warn(` Cloned node at (${step.x}, ${step.y})`)
console.warn(` Cloned node at (${step.x}, ${step.y}) via Ctrl+C/V`)
break
}
case 'copyPaste': {