-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Feature/1457 add shorcuts for pause breaks #1468
Feature/1457 add shorcuts for pause breaks #1468
Conversation
app/main.js
Outdated
@@ -1315,26 +1317,31 @@ function getTrayMenuTemplate () { | |||
submenu: [ | |||
{ | |||
label: i18next.t('utils.minutes', { count: 30 }), | |||
accelerator: settings.get('pauseBreaksFor30MinutesShortcut'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not that important but returns [18960:0723/192752.999383:WARNING:accelerator_util.cc(65)] doesn't contain a valid key
when no value set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted. How do I reproduce this error? I tried to start the app (npm run start
) with empty string ""
values for the shortcuts but I don't see this error in the terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try with npm run dev
, it gives more debug info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, the warning only appeared in Ubuntu for me but not in Windows or Mac.
app/utils/pauseBreaksShortcut.js
Outdated
@@ -0,0 +1,44 @@ | |||
const { UntilMorning } = require('./untilMorning') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please what do you think about registering pauseBreaksToggleShortcut
? Haven't had time think myself, but it hits me we have one shortcut left in main.js
regarding to pausing.
Or even put all shortcuts here? (like skipToNextScheduledBreakShortcut, skipToNextMiniBreakShortcut and such).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I've made some comments, let me know what you think :) I can test then on Windows as well. |
The warning "doesn't contain a valid key" was shown in console logs when pause break shortcut was empty. The warning only appread in Linux but not in Windows or Mac.
I've made the improvements you suggested. Also, I managed to install the dev environment on Windows, and tested the shortcuts on all platforms. Let me know if you want to change/improve anything. :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks, looks good :)
I can squash and merge, unless you want to add yourself to the readme :) |
Thanks, squash is ok, I don't need readme mention :D |
Issue: #1457
Requirements
node
version specified inpackage.json
was used (ie using nvm).npm install --no-save
).npm run lint
reports no offenses.npm run test
is error-free.Description of the Change
main.js
intoutils/breakShortcuts.js
.Verification Process
Restart the app.
Use the keyboard shortcuts and see that the breaks are paused: the app icon changes to Pause and when you click the text shows the correct pause duration.
Since I moved the code for other break shortcuts into, I also tested these shortcuts: