break: update terminology from "Work" to "Focus"
- change mode from "Work" to "Focus" in server messages
- modify pomodoro configuration to use "Focus" instead of "Work"
- adjust default settings to reflect new terminology
- ensure all references to work duration are updated to focus duration
- update variable names in HTML and JavaScript for clarity
🤖
This commit is contained in:
parent
b3f403cf1a
commit
31179d4af4
9 changed files with 34 additions and 34 deletions
internal
|
@ -26,7 +26,7 @@ func waitForTimer(t Timer) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// RunPomodoro iterates the Pomodoro work/break sessions
|
||||
// RunPomodoro iterates the Pomodoro focus/break sessions
|
||||
func RunPomodoro() {
|
||||
mu.Lock()
|
||||
shared.State.Ongoing = true
|
||||
|
@ -40,9 +40,9 @@ func RunPomodoro() {
|
|||
|
||||
shared.State.Session = session
|
||||
|
||||
// Work
|
||||
shared.State.Mode = "Work"
|
||||
timer.StartAsync(pomodoroConfig.Work)
|
||||
// Focus
|
||||
shared.State.Mode = "Focus"
|
||||
timer.StartAsync(pomodoroConfig.Focus)
|
||||
if !waitForTimer(timer) {
|
||||
break
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ func RunPomodoro() {
|
|||
|
||||
shared.State.Mode = "Idle"
|
||||
shared.State.Session = 0
|
||||
shared.State.TimeLeft = shared.State.Settings.Work
|
||||
shared.State.TimeLeft = shared.State.Settings.Focus
|
||||
}
|
||||
|
||||
func ResetPomodoro() {
|
||||
|
@ -111,6 +111,6 @@ func IsPomodoroPaused() bool {
|
|||
func UpdateSettings(settings models.PomodoroConfig) {
|
||||
if settings != (models.PomodoroConfig{}) {
|
||||
shared.State.Settings = settings
|
||||
shared.State.TimeLeft = settings.Work
|
||||
shared.State.TimeLeft = settings.Focus
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ var DefaultServerConfig = models.ServerConfig{
|
|||
|
||||
// The default pomodoro config if nothing else is set
|
||||
var DefaultPomodoroConfig = models.PomodoroConfig{
|
||||
Work: 25 * 60,
|
||||
Focus: 25 * 60,
|
||||
ShortBreak: 5 * 60,
|
||||
LongBreak: 15 * 60,
|
||||
Sessions: 4,
|
||||
|
|
|
@ -10,7 +10,7 @@ var State = models.ServerMessage{
|
|||
Mode: "Idle",
|
||||
Settings: DefaultPomodoroConfig,
|
||||
Session: 0,
|
||||
TimeLeft: DefaultPomodoroConfig.Work,
|
||||
TimeLeft: DefaultPomodoroConfig.Focus,
|
||||
Ongoing: false,
|
||||
Paused: false,
|
||||
ProtocolVersion: metadata.ProtocolVersion,
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func checkSettings(settings models.PomodoroConfig) bool {
|
||||
return settings.Work > 0 && settings.ShortBreak > 0 && settings.LongBreak > 0 && settings.Sessions > 0
|
||||
return settings.Focus > 0 && settings.ShortBreak > 0 && settings.LongBreak > 0 && settings.Sessions > 0
|
||||
}
|
||||
|
||||
// Listens for commands from a client and handles them
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue