Commit graph

32 commits

Author SHA1 Message Date
94b6786c7c feat: implement asynchronous timer start
- add new StartAsync method to Timer for non-blocking execution
- use new method in RunPomodoro()

🤖
2024-10-30 07:46:29 +01:00
d0b1260f62 doc: add and improve comments 2024-10-30 07:39:30 +01:00
b8823acc97 refacor: replace shared.Message with shared.State
🤖
2024-10-29 18:46:00 +01:00
e2ab19066d format: update import statements order for consistency 2024-10-29 11:05:45 +01:00
3a6be4c187 feat: update settings handling for pomodoro configuration
- add `UpdateSettings()` to update pomodoro configuration
- refactor client command handling to use `UpdateSettings()`

🤖
2024-10-29 11:05:45 +01:00
61b2f71bf3 break: rename ServerMessage.PomodoroSettings -> .Settings 2024-10-26 10:19:41 +02:00
3eae584d6d recator: use timer signals instead of shared.Message.TimeLeft
- remove shared.Message.TimeLeft
- modify Timer struct
  - add TimeLeft signal
  - add End and Abort signals
- add syncronised ticker
- update RunPomodoro to use goroutines for timer starts
  - add waitForTimer function
2024-10-25 23:19:58 +02:00
aa5c24f06d refactor: move timer function to method
- introduce Timer struct to manage timer state
- update RunPomodoro to use Timer methods for starting, stopping, and pausing
- remove unused pomodoro channels
2024-10-25 23:19:53 +02:00
4eedfcb965 feat: send "End"-Message only once
- send "End" once, then fallback to "Idle"
- update README
2024-10-22 13:43:43 +02:00
5bf9753dce fix: ResetPomodoro() resets to current settings not server defaults
- reset shared.Message fields to current values in `ResetPomodoro()` function
- remove `ResetToDefault()`
2024-10-22 10:39:53 +02:00
cb6616f400 break: add updateSettings command to modify Pomodoro settings
- add `updateSettings` command to modify Pomodoro configuration
- remove ability to set Pomodoro configuration in `start` command
- update demo client
- update README

🤖
2024-10-22 08:51:22 +02:00
a0dba673a2 break: enhance server message structure and settings
- add explicit server messages for start and end
- include pomodoro setttings in server messages
- update README

🤖
2024-10-22 08:10:26 +02:00
bf2685a055 fix: send correct server message on pomodoro end
- replace manual state reset with a dedicated ResetToDefault function
- remove locking mechanism during state updates

🤖
2024-10-21 13:42:32 +02:00
b7d03aa1d8 break: empty Message.Mode when no pomodoro ongoing
- change "none" to an empty string for the mode field
- update README to reflect the new mode representation
- ensure consistency across session end/reset and welcome messages

🤖
2024-10-21 13:14:26 +02:00
03ab627729 feat: simplify timer function
- remove "mode" parameter from startTimer function
- update shared.Message.Mode for each pomodoro state
- update comments

🤖
2024-10-21 13:07:19 +02:00
aab6896c7d refactor: move broadcast.Message to shared.Message
- create a new shared state file to manage message state
- replace broadcast.Message with shared.Message in pomodoro logic
- update websocket client handling to use shared.Clients
- remove unnecessary broadcast imports from various files
- ensure consistent message handling across the application

🤖
2024-10-21 13:07:19 +02:00
234f3c17dc feat: simplify pomodoro functions by removing client parameter
- remove clients parameter from RunPomodoro function
- update startTimer to no longer require clients parameter
- modify ResetPomodoro to eliminate clients parameter
- adjust client_commands to reflect changes in function signatures

🤖
2024-10-21 13:07:19 +02:00
9615d4d449 feat: implement permanent broadcast message functionality
- add SendPermanentBroadCastMessage to continuously send updates
- refactor BroadcastMessage to use a shared Message struct
- update pomodoro logic to modify broadcast.Message directly
- adjust client command handling to use broadcast.Clients map
- enhance ServerMessage struct with "Ongoing" and "Paused" fields

🤖
2024-10-21 13:07:19 +02:00
f183686272 break: update ServerMessage model
- rename MaxSession to TotalSession (and JSON struct tags)

🤖
2024-10-20 23:42:25 +02:00
2ac1aecba1 feat: allow clients to send pomodoro config
- allow clients to send custom configuration for pomodoro sessions
- update RunPomodoro to accept a configuration parameter
- modify startTimer to handle session count from config
- add default pomodoro configuration in client command handling

🤖
2024-10-20 23:42:25 +02:00
9149b1a78e refactor: rename GoTomatoTimerConfig to GoTomatoPomodoroConfig
🤖
2024-10-20 22:18:50 +02:00
f098c1f6bf refactor: rename RunPomodoroTimer() to RunPomodoro()
🤖
2024-10-20 22:00:54 +02:00
337e5b0ed3 refactor: rename BroadcastMessage model to ServerMessage
🤖
2024-10-20 21:59:18 +02:00
b46d2469d3 feat: update variable and function name for started pomodoro
- change variable name from pomodoroRunning to pomodoroOngoing
- update function name from IsPomodoroRunning to IsPomodoroOngoing
- modify client command checks to use IsPomodoroActive instead of IsPomodoroRunning

🤖
2024-10-20 18:16:38 +02:00
85923b4469 feat: create model for pomodoro settings
- introduce GoTomatoTimerConfig
- create instance variable with current config
- update code to use the new variable
2024-10-20 14:45:18 +02:00
3d5cb29c54 chore: cleanup pause/resume functions 2024-10-20 11:28:28 +02:00
b62e92b5a4 fix: resolve race condition in pause/resume check
- replace direct check of pomodoroPaused with IsPomodoroPaused function
2024-10-20 11:28:26 +02:00
4471c86a0c fix: prevent concurrent write to websocket connection
- refactor client handling and message broadcasting
- replace Client struct
- implement SendMessage method in Client struct for safer message sending
- update client map to use *models.Client instead of bool
- adjust BroadcastMessage and RunPomodoroTimer functions to use new client type

🤖
2024-10-20 11:06:37 +02:00
ffc6913344 break: change the "stop" command to "reset"
- change stop channel to reset channel
- create ResetPomodoro function
- broadcast reset message to all clients
- rename stop button to reset button in index.html

🤖
2024-10-20 10:03:29 +02:00
bc3a306c00 feat: add pause and resume functionality
- implement pause and resume commands in the Pomodoro package
- modify timer logic to handle paused state
- adjust client command handling for pause and resume actions
- update HTML to include pause/resume button

🤖
2024-10-20 10:03:22 +02:00
c9501c3bbb feat: update timer management
- rename timerRunning to pomodoroRunning
- move function and timer definition to correct source file

🤖
2024-10-19 18:08:54 +02:00
c59f737eb7 feat(server): restructure Pomodoro server into modular components
- move server logic to cmd/server/main.go
- create packages for websocket, pomodoro and broadcast handling
- define models for messages
- remove old GoTomato.go file
- update README

🤖
2024-10-19 16:49:09 +02:00