Skip to content

Commit

Permalink
add keybindings for screen recording and replays
Browse files Browse the repository at this point in the history
  • Loading branch information
filip131311 committed Dec 23, 2024
1 parent 0e39af1 commit f3fcfeb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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": {
Expand Down
16 changes: 16 additions & 0 deletions packages/vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f3fcfeb

Please sign in to comment.