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 advanced option to show break actions in Strict mode #1438

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Estonia and Belarus translations
- Updated flag of Belarus to White-Red-White
- advanced option to show break options (Skip, Pause, Reset) in Strict mode

### Changed
- updated many translations
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ To hide Stretchly icon in menubar/tray, set the value of `showTrayIcon` from `tr

Note that this will disable graphical way of opening Stretchly Preferences. To access Preferences, you will have to use command line options (ie: `stretchly preferences` on Linux).

#### Show break actions (Skip, Pause, Reset) in Strict Mode
If you want to show options 'Skip to next break', 'Pause' or 'Reset Breaks' even while in Strict mode, set `showBreakActionsInStrictMode` to `true`.

## Contributor Preferences

*Stretchly* is free but you can support it by contributing code, translations or money. You will be rewarded by getting access to **Contributor Preferences**, ability to **Sync Preferences**, chat on **Discord** and more!
Expand Down
12 changes: 8 additions & 4 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,9 +1253,11 @@
})
}

if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode')) {
if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode') &&

Check warning on line 1256 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L1256

Added line #L1256 was not covered by tests
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode')) {
} else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode') &&

Check warning on line 1259 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L1259

Added line #L1259 was not covered by tests
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (!(breakPlanner.isPaused || breakPlanner.dndManager.isOnDnd || breakPlanner.appExclusionsManager.isSchedulerCleared)) {
let submenu = []
Expand Down Expand Up @@ -1287,9 +1289,11 @@
updateTray()
}
})
} else if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode')) {
} else if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode') &&

Check warning on line 1292 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L1292

Added line #L1292 was not covered by tests
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode')) {
} else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode') &&

Check warning on line 1295 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L1295

Added line #L1295 was not covered by tests
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (!(breakPlanner.dndManager.isOnDnd || breakPlanner.appExclusionsManager.isSchedulerCleared)) {
trayMenu.push({
Expand Down
3 changes: 2 additions & 1 deletion app/utils/defaultSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ module.exports = {
skipToNextScheduledBreakShortcut: '',
skipToNextMiniBreakShortcut: '',
skipToNextLongBreakShortcut: '',
resetBreaksShortcut: ''
resetBreaksShortcut: '',
showBreakActionsInStrictMode: false
}
Loading