Skip to content

feat: add distraction counting, timer extensions, and precise breaks - #517

Open
yashcodes161198 wants to merge 9 commits into
Splode:mainfrom
yashcodes161198:codex/upstream-focus-timer
Open

yashcodes161198 wants to merge 9 commits into
Splode:mainfrom
yashcodes161198:codex/upstream-focus-timer

Conversation

@yashcodes161198

Copy link
Copy Markdown

Pomotroid currently has no way to count distractions during a focus round or extend only the current timer, and the break inputs round durations to whole minutes. This adds those controls while using the existing theme styles.

Changes

  • Move remaining time above the dial and add a distraction button inside it. The first click replaces the prompt with 1; subsequent clicks increment the count. The count resets on a new focus round or timer reset and remains visible, but disabled, during breaks.
  • Add a +5 button that extends the current focus or break by 300 seconds without changing elapsed time or the running/paused state. Extensions affect the current round only, and session statistics record the extended duration.
  • Accept M:SS and decimal minutes in the existing duration inputs, with second-resolution break sliders. For example, 0:15 means 15 seconds and 0:00 skips the break. Keep the one-minute minimum for focus rounds.
  • Place the round count and Reset at the bottom left, skip and volume at the bottom right, and Play/Pause below the dial. Remove the backward-style restart button, retaining the existing restart keyboard command.
  • Synchronize timing-sensitive engine tests with emitted events instead of assuming a fixed number of ticks after sleeping.

Verification

  • Windows: 97 Rust tests passed and the NSIS installer built successfully (build run). The native sources in this PR match that build.
  • npm run test:duration: both tests passed.
  • npm run check: zero errors and warnings; npm run build passed.
  • cargo clippy -- -D warnings passed on Linux in the fork's Build / Test run, using the same native sources.
  • Browser checks with mocked Tauri IPC covered distraction counting, keyboard activation, +5 across all round types and running/paused states, duration validation, and five window sizes.

The installer and personal packaging workflow remain in the fork and are excluded from this PR. New strings are supplied in English; other locales use the existing English fallback. Native macOS and Linux interaction has not been manually tested.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants