Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor screen recording and add key bindings #875

Merged

Conversation

filip131311
Copy link
Collaborator

@filip131311 filip131311 commented Dec 23, 2024

This PR aims to add screenshot functionality, keybindings for capturing replays, starting an capturing the recording and capturing screenshots.

To achieve that we moved the logic for starting and ending recording from webview to the extension code.

the proposed keybindings are:

  • capture replay: shift+cmd+R
  • toggle recording: shift+cmd+E
  • capture screenshot: shift+cmd+A

fix #868

How Has This Been Tested:

  • Run extension and check if commands and previously existing buttons work as expected
  • change MAX_RECORDING_TIME_SEC to 10 and check if the logic for closing stoping works
  • check screenshot buton and its effects
Screen.Recording.2024-12-23.at.17.12.46.mov

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 1:13pm

This PR adds screenshot functionality introduced to the simulator server
in
software-mansion-labs/simulator-server@d86dcc5


### How Has This Been Tested: 

run the project and make a screenshot
},
{
"command": "RNIDE.captureRecording",
"title": "Capture Recording",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if End recording wouldn't be more readable. Or maybe just one command for toggle recording?

@@ -97,6 +121,26 @@
"command": "RNIDE.performFailedBiometricAuthorization",
"key": "ctrl+shift+N",
"mac": "cmd+shift+N"
},
{
"command": "RNIDE.captureReplay",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like those shortcuts. Usually, the keys used are somehow related to what they do, and I think shift is used for something special for given base shortcut cmd+z -> undo, cmd+shift+z -> redo. All that we use doesn't seem to have any meaning, or I don't see one.
I was thinking about something like:

ctrl + b/a -> biometric/authorization
ctrl + shift + b/a -> perform failed biometric/authorization
ctrl + r -> toggle recording
ctrl + shift + r -> show replay
ctrl + s -> screen shot

wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately api you proposed clashes with existing keybindings (file save/ resent workspaces)

I refactored my api to look like this
cmd+shift+r capture replay
cmd+shift+e toggle recording
cmd+shift+a capture screenshot

packages/vscode-extension/src/devices/preview.ts Outdated Show resolved Hide resolved
packages/vscode-extension/src/project/project.ts Outdated Show resolved Hide resolved
@@ -185,28 +193,60 @@ export class Project
throw new Error("No device session available");
}
this.deviceSession.startRecording();
this.eventEmitter.emit("isRecordingChanged", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This event name is a bit confusing for me, maybe we can come up with something better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isRecording? RECORDING_STATE_CHAGNED?

@filip131311 filip131311 merged commit 85e5b4c into main Jan 9, 2025
4 checks passed
@filip131311 filip131311 deleted the @Filip131311/RefactorScreenRecordingAndAddKyeBindings branch January 9, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Screenshot support
2 participants