Fix keyboard shortcuts to use Control on Windows and Linux (#3620)

* Fix keyboard shortcuts to use Control instead of Meta on Windows and Linux

* Convert more tests to use Playwright built-in
This commit is contained in:
Jonathan Tran
2024-08-22 19:13:27 -04:00
committed by GitHub
parent e624c9b124
commit acbe92d717
14 changed files with 92 additions and 112 deletions

View File

@ -1,4 +1,5 @@
import { isDesktop } from 'lib/isDesktop'
import { platform } from 'lib/utils'
export type InteractionMapItem = {
name: string
@ -24,6 +25,11 @@ export const interactionMapCategories = [
type InteractionMapCategory = (typeof interactionMapCategories)[number]
/**
* Primary modifier key for the current platform.
*/
const PRIMARY = platform() === 'macos' ? 'Command' : 'Control'
/**
* A temporary implementation of the interaction map for
* display purposes only.
@ -38,7 +44,7 @@ export const interactionMap: Record<
Settings: [
{
name: 'toggle-settings',
sequence: isDesktop() ? 'Meta+,' : 'Shift+Meta+,',
sequence: isDesktop() ? `${PRIMARY}+,` : `Shift+${PRIMARY}+,`,
title: 'Toggle Settings',
description: 'Opens the settings dialog. Always available.',
},
@ -53,7 +59,7 @@ export const interactionMap: Record<
'Command Palette': [
{
name: 'toggle-command-palette',
sequence: 'Meta+K',
sequence: `${PRIMARY}+K`,
title: 'Toggle Command Palette',
description: 'Always available. Use Ctrl+/ on Windows/Linux.',
},
@ -159,7 +165,7 @@ export const interactionMap: Record<
},
{
name: 'delete-file',
sequence: 'Meta+Backspace',
sequence: `${PRIMARY}+Backspace`,
title: 'Delete File/Folder',
description:
'Available when a file or folder is selected in the file tree.',