Add background audio pomodoro timer prototype - #12
Open
hummusonrails wants to merge 1 commit into
Open
Conversation
hummusonrails
marked this pull request as ready for review
May 21, 2026 06:10
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
Problem Statement
This PR implements the prototype requested in #1: a minimal single-page timer that keeps accurate countdown time in inactive Chrome tabs and plays a completion chime after the user has unlocked browser audio.
Solution Approach
The app uses a single HTML file with embedded CSS and JavaScript. It unlocks an
AudioContextfrom the Start button click, calculates countdown state from an absolute deadline instead of interval counts, and provides graceful visual fallback messaging if Chrome blocks sound.Technical Implementation
pomodoro-timer.htmldirectly in Chrome or serve it as a static file.Testing Evidence
node -e "const fs=require('fs'); const html=fs.readFileSync('pomodoro-timer.html','utf8'); if(!html.includes('<script>')) throw new Error('missing script'); const js=html.match(/<script>([\s\S]*)<\/script>/)[1]; new Function(js); console.log('embedded JavaScript syntax OK');"->embedded JavaScript syntax OKnode -e "const fs=require('fs'); const html=fs.readFileSync('pomodoro-timer.html','utf8'); const required=['AudioContext','Notification','visibilitychange','role=\"timer\"','aria-live=\"polite\"','min=\"1\"','max=\"999\"']; for (const token of required) if (!html.includes(token)) throw new Error('missing '+token); console.log('static requirement checks OK');"->static requirement checks OKDemo Evidence
Setup Instructions
pomodoro-timer.htmlin recent Chrome desktop.Database Setup
Not applicable.
Architectural Decisions
The timer uses an absolute wall-clock deadline and recalculates remaining seconds on each interval tick,
visibilitychange, and window focus event. That avoids drift caused by Chrome's background timer throttling. The completion chime is generated with Web Audio oscillators, avoiding external assets and keeping the deliverable to one HTML app file.Bun/Yarn Justification
Not applicable; no package manager is needed.
Pre-submission Checklist:
I confirm this submission meets all requirements and is ready for review.