diff --git a/packages/vscode-extension/package.json b/packages/vscode-extension/package.json index a6d380257..84096e932 100644 --- a/packages/vscode-extension/package.json +++ b/packages/vscode-extension/package.json @@ -74,6 +74,24 @@ "title": "Perform Failed Biometric Authorization", "category": "Radon IDE", "enablement": "RNIDE.extensionIsActive" + }, + { + "command": "RNIDE.captureReplay", + "title": "Capture Replay", + "category": "Radon IDE", + "enablement": "RNIDE.extensionIsActive && RNIDE.panelIsOpen" + }, + { + "command": "RNIDE.startRecording", + "title": "Start Recording", + "category": "Radon IDE", + "enablement": "RNIDE.extensionIsActive && RNIDE.panelIsOpen" + }, + { + "command": "RNIDE.captureRecording", + "title": "Capture Recording", + "category": "Radon IDE", + "enablement": "RNIDE.extensionIsActive && RNIDE.panelIsOpen" } ], "keybindings": [ @@ -97,6 +115,21 @@ "command": "RNIDE.performFailedBiometricAuthorization", "key": "ctrl+shift+N", "mac": "cmd+shift+N" + }, + { + "command": "RNIDE.captureReplay", + "key": "ctrl+shift+R", + "mac": "cmd+shift+R" + }, + { + "command": "RNIDE.startRecording", + "key": "ctrl+shift+E", + "mac": "cmd+shift+E" + }, + { + "command": "RNIDE.captureRecording", + "key": "ctrl+shift+T", + "mac": "cmd+shift+T" } ], "configuration": { diff --git a/packages/vscode-extension/src/extension.ts b/packages/vscode-extension/src/extension.ts index 02a222dfe..67ace28d4 100644 --- a/packages/vscode-extension/src/extension.ts +++ b/packages/vscode-extension/src/extension.ts @@ -149,6 +149,10 @@ export async function activate(context: ExtensionContext) { commands.registerCommand("RNIDE.showStorybookStory", showStorybookStory) ); + context.subscriptions.push(commands.registerCommand("RNIDE.captureReplay", captureReplay)); + context.subscriptions.push(commands.registerCommand("RNIDE.startRecording", startRecording)); + context.subscriptions.push(commands.registerCommand("RNIDE.captureRecording", captureRecording)); + async function closeAuxiliaryBar(registeredCommandDisposable: Disposable) { registeredCommandDisposable.dispose(); // must dispose to avoid endless loops @@ -408,6 +412,18 @@ async function performFailedBiometricAuthorization() { Project.currentProject?.sendBiometricAuthorization(false); } +async function captureReplay() { + Project.currentProject?.captureReplay(); +} + +async function startRecording() { + Project.currentProject?.startRecording(); +} + +async function captureRecording() { + Project.currentProject?.captureAndStopRecording(); +} + async function diagnoseWorkspaceStructure() { const appRootFolder = await configureAppRootFolder(); if (appRootFolder) {