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

Add support for pausing the recording #1132

Merged
merged 11 commits into from
Oct 27, 2022

Conversation

thethomasz
Copy link
Contributor

@thethomasz thethomasz commented Aug 11, 2022

Tried implementing the feature request #129 to allow pausing a recording.
I'm not entirely sure if adding a "right-click" to the tray icon is a good solution to this, so I just wanted to create the PR first to get some feedback. I'm also not sure what the tray icon should look like when it's paused, and I'm not much of a designer myself. 😅

Fixes #129

@sindresorhus
Copy link
Contributor

I agree with adding it to the right-click menu, but I think we can also add a shortcut so that if you press Option+click it would pause instead of stopping.

@sindresorhus
Copy link
Contributor

I'm also not sure what the tray icon should look like when it's paused

@skllcrn ^

- context menu allows for stopping or pausing/resuming recording
- also added ability to pause recording by holding 'option' key while clicking tray icon
@thethomasz
Copy link
Contributor Author

I've finished implementing the suggested changes, still not sure how the icon should look though. Here's some screenshots on what the context menu looks like during recording or when the recording is paused.

Screen Shot 2022-08-28 at 10 30 59 PM

Screen Shot 2022-08-28 at 10 31 23 PM

@thethomasz thethomasz changed the title Allow pausing when recording #129 Allow pausing when recording Aug 29, 2022
@sindresorhus
Copy link
Contributor

Maybe take the recording icon (■) and reduce opacity to 50%? So it's like a faded out recording icon.

@sindresorhus
Copy link
Contributor

I think Pause should be first in the menu as the user can just click to stop, so pause is the main action you want when right-clicking.

@sindresorhus
Copy link
Contributor

I would also drop the Recording word. Stop Recording => Stop.

@sindresorhus
Copy link
Contributor

And maybe also include a quick way to quit Kap.

Resume
Stop
-----
Quit Kap (Q)

@sindresorhus
Copy link
Contributor

Not required for this pull request, but I think it would be useful to see the recording duration in this menu too.
Screen Shot 2022-08-30 at 16 59 43

@sindresorhus
Copy link
Contributor

We also need to document the Option-click and right-click menu behavior.

@sindresorhus sindresorhus changed the title #129 Allow pausing when recording Add support for pausing the recording Aug 30, 2022
main/tray.ts Show resolved Hide resolved
@thethomasz
Copy link
Contributor Author

Not required for this pull request, but I think it would be useful to see the recording duration in this menu too. Screen Shot 2022-08-30 at 16 59 43

I tried to figure this out for a bit, but I couldn't seem to get it working. My idea was to keep the overall duration (in ms) and the start time of the current segment of the recording (which I need in case the user pauses recording), then set an interval that would update the tray's context menu every second. But I couldn't seem to get the menu item to update dynamically while it's open. I think I'll just keep this out of the current PR for now, and we can create a new issue to track it.

@thethomasz
Copy link
Contributor Author

Here's what the context menu looks like with all the current changes:
Screen Shot 2022-09-04 at 6 37 21 PM

@thethomasz
Copy link
Contributor Author

We also need to document the Option-click and right-click menu behavior.

Hmm, I wasn't really sure where to document this behaviour, I don't really see a "How To" guide or something in the README. An idea I had was to put a small page in the preferences window that could show users how to use the app. And something else we could also do is add a small walkthrough for when the user installs the app that teaches them how to use it.

@sindresorhus
Copy link
Contributor

I tried to figure this out for a bit, but I couldn't seem to get it working. My idea was to keep the overall duration (in ms) and the start time of the current segment of the recording (which I need in case the user pauses recording), then set an interval that would update the tray's context menu every second. But I couldn't seem to get the menu item to update dynamically while it's open. I think I'll just keep this out of the current PR for now, and we can create a new issue to track it.

When you open a menu on macOS, it switches to a different run loop (it's complicated), so it blocks all timers. I'm not aware of any way to work around this with Electron, but it's fine. The timer doesn't need to update while the menu is open. It's just a convenience to see the current duration at the time of opening the menu.

@skllcrn
Copy link
Member

skllcrn commented Sep 6, 2022

This is looking fantastic @thethomasz, the icon too, thanks both of you!

@sindresorhus
Copy link
Contributor

Hmm, I wasn't really sure where to document this behaviour, I don't really see a "How To" guide or something in the README. An idea I had was to put a small page in the preferences window that could show users how to use the app. And something else we could also do is add a small walkthrough for when the user installs the app that teaches them how to use it.

I think was can just add a simple tip:

Tip: While recording, Option-click the menu bar icon to pause or right-click for more options.

main/aperture.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 9d2255f into wulkano:main Oct 27, 2022
@sindresorhus
Copy link
Contributor

Great work, @thethomasz 👍

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.

Allow to pause recording
3 participants