Add background audio Pomodoro prototype - #14
Open
Peter7896 wants to merge 1 commit into
Open
Conversation
Author
|
@adrianmurage This submission is ready for review. GitHub did not allow a formal review request from my fork, so I am tagging you here as requested in the submission instructions. |
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.
Bounty Solution Submission
Closes #1
Problem Statement
This submission adds a minimal Chrome-focused Pomodoro prototype for reliable completion alerts when the timer tab is inactive or in the background.
Solution Approach
The app is a single
pomodoro-timer.htmlfile with inline CSS and JavaScript. It unlocks Web Audio from the Start action, uses an absoluteDate.now()deadline so inactive-tab ticks catch up instead of drifting, adds an inline worker tick source, requests desktop notifications asynchronously, and keeps page flash plus document-title fallback active when sound or notification permissions are blocked.The timer starts immediately after the user action. Audio and notification permission work never blocks the core countdown, so denied or delayed browser prompts cannot leave the app stuck before start or at completion.
Technical Implementation
pomodoro-timer.htmldirectly in Chrome or serve the repository as static files.Testing Evidence
0input, 1-minute start flow, pause, reset, full 1-minute completion, audio/notification fallback messaging, title updates, and no console errors.node tests/pomodoro-static-check.js->pomodoro static checks OKgit diff --check-> passed with no output01:00with no console errors.Demo Evidence
Setup Instructions
pomodoro-timer.htmlin recent Chrome desktop.node tests/pomodoro-static-check.jsfrom the repository root.Database Setup
Not applicable. No database, migrations, seeds, or services are required.
Architectural Decisions
The countdown is computed from an absolute deadline rather than interval counts, which avoids drift when Chrome slows inactive-tab callbacks. Completion handling does not wait indefinitely on Web Audio or Notification permission promises; visual completion and reset proceed independently, while audio is attempted with a timeout. The app also uses document-title changes and desktop notifications as fallback signals, and keeps everything self-contained in one HTML app file.
Bun/Yarn Justification
Not applicable. The issue-specific requirement is a standalone HTML file with embedded CSS and JavaScript, so using Bun or Yarn would add unnecessary setup.
Pre-submission Checklist:
I confirm this submission meets all requirements and is ready for review.