From 24c7260327895ac5b39e75a79bc146cc30be39bb Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 3 Jul 2024 15:26:04 -0700 Subject: [PATCH] ctrl-c is copy, we should not bind to copy or paste or any common shit (#2895) * ctrl-c is copy, we should not bind to copy or paste or any common shit Signed-off-by: Jess Frazelle * fix tests Signed-off-by: Jess Frazelle --------- Signed-off-by: Jess Frazelle --- e2e/playwright/flow-tests.spec.ts | 18 +++--------------- src/components/CommandBar/CommandBar.tsx | 2 +- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/e2e/playwright/flow-tests.spec.ts b/e2e/playwright/flow-tests.spec.ts index 8bb1a034b..bcf2eaff3 100644 --- a/e2e/playwright/flow-tests.spec.ts +++ b/e2e/playwright/flow-tests.spec.ts @@ -3418,11 +3418,7 @@ test.describe('Command bar tests', () => { await expect(cmdSearchBar).not.toBeVisible() // Now try the same, but with the keyboard shortcut, check focus - if (process.platform !== 'linux') { - await page.keyboard.press('Meta+K') - } else { - await page.locator('html').press('Control+C') - } + await page.keyboard.press('Meta+K') cmdSearchBar = page.getByPlaceholder('Search commands') await expect(cmdSearchBar).toBeVisible() await expect(cmdSearchBar).toBeFocused() @@ -3470,11 +3466,7 @@ test.describe('Command bar tests', () => { await page.locator('.cm-content').click() // Now try the same, but with the keyboard shortcut, check focus - if (process.platform !== 'linux') { - await page.keyboard.press('Meta+K') - } else { - await page.locator('.cm-content').press('Control+C') - } + await page.keyboard.press('Meta+K') let cmdSearchBar = page.getByPlaceholder('Search commands') await expect(cmdSearchBar).toBeVisible() @@ -3539,11 +3531,7 @@ test.describe('Command bar tests', () => { await page.getByRole('button', { name: 'Extrude' }).isEnabled() let cmdSearchBar = page.getByPlaceholder('Search commands') - if (process.platform !== 'linux') { - await page.keyboard.press('Meta+K') - } else { - await page.locator('html').press('Control+C') - } + await page.keyboard.press('Meta+K') await expect(cmdSearchBar).toBeVisible() // Search for extrude command and choose it diff --git a/src/components/CommandBar/CommandBar.tsx b/src/components/CommandBar/CommandBar.tsx index 865fc392e..0cd9fa3f5 100644 --- a/src/components/CommandBar/CommandBar.tsx +++ b/src/components/CommandBar/CommandBar.tsx @@ -24,7 +24,7 @@ export const CommandBar = () => { }, [pathname]) // Hook up keyboard shortcuts - useHotkeyWrapper(['mod+k', 'ctrl+c'], () => { + useHotkeyWrapper(['mod+k'], () => { if (commandBarState.context.commands.length === 0) return if (commandBarState.matches('Closed')) { commandBarSend({ type: 'Open' })