Tasks/doro 010 adjust durations#67
Open
dnim wants to merge 23 commits into
Open
Conversation
- Add workDuration, shortBreakDuration, longBreakDuration to Settings. - Read durations from config into TimerStateMachine. - Use 22, 5, 12 as defaults for work, short break, and long break.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-TUI duration editor: arrow keys (or +/-/=/_) adjust the current mode's minutes, with a brief blinking display, a 2-second auto-save that writes through to settings, and a "saved" confirmation banner. Defaults are extracted to shared constants and the timer state machine gains an updateConfig method that re-bases remainingSeconds by the duration delta.
Changes:
- New
editDurationflow inDoroApp(state, blink ticker instepClock,handleDurationEdit/saveDurationEdit/clearDurationEdit) wired throughUiRenderStateand rendered as a special banner inDoroUi. - New
increaseDuration/decreaseDurationcontrol commands mapped to up/down/left/right and +/-/=/_ ininput.ts, plusTimerStateMachine.updateConfigthat adjustsremainingSeconds. - Settings extended with
workDuration/shortBreakDuration/longBreakDuration(defaults exported fromconfig.ts, consumed byconstants.tsandDoroAppconstructor); test fixtures and VRT scenarios updated for the new state shape.
Reviewed changes
Copilot reviewed 44 out of 93 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app.ts | Adds duration-edit state machine, blink counter, save/clear timeouts, settings persistence, and routes new commands. |
| src/ui.ts | Rewrites banner selection as if/else chain with editing/saved states; exports splitAtVisible for tests. |
| src/stateMachine.ts | New updateConfig that mutates config and adjusts remainingSeconds by the duration diff. |
| src/input.ts | Adds increaseDuration/decreaseDuration and maps arrow keys plus +/-/=/_ to them. |
| src/constants.ts | DEFAULT_TIMER_CONFIG now derived from shared DEFAULT_*_MINS constants in config.ts. |
| src/config.ts | Adds duration default constants and per-mode *Duration settings fields with defaults. |
| src/tests/ui.test.ts | Adds splitAtVisible test and adds new editDuration* fields to all render-state fixtures. |
| tests/visual.spec.mts | Adds VRT scenarios for edit/blink/saved states; switches pty.spawn to process.execPath. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.