Repository navigation
Practice timer: beeps on iPhone, Apple Watch info and controls, ahead/behind (PR7c, PR7d) - #45
Merged
Merged
Conversation
… locked (PR7c) The beeps used Web Audio, which iPhone mutes with the silent switch; the sound was readied on pointerdown, which iOS doesn't count as a tap for audio; an interrupted audio context was never resumed; and no code runs while the phone is locked. Sound now plays through one shared <audio> element (media playback), readied on click/touchend and on Start practice. With "Beep when the phone is locked" on, the run screen renders the rest of the block as one WAV track, silent until each beep, so the beeps come on time when locked. Diagnostics gets sound (Beep, Whistle, Chime, Buzzer), volume, the locked switch, test beeps and a 10-second locked test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
Deploying next5 with
|
| Latest commit: |
80c032d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://886eec7f.next5-4gi.pages.dev |
| Branch Preview URL: | https://claude-loving-keller-3kj4a0.next5-4gi.pages.dev |
…watch (PR7c) While the timer track plays, its Media Session title is the current drill, the artist line is "Next: <drill> · n min", the album is "Block n of m", and the position state spans the block, so the progress bar counts down the time left on the lock screen and Apple Watch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
…(PR7c) - Line 2 on the lock screen and watch is "Ends 4:40 PM · Next: <drill>" (or "Paused · 3:12 left · …"). A time of day stays right while the phone is locked and runs no code; a countdown would go stale. - Album art (512 px canvas): next5 icon, block, each station with its coach, when it ends, and the rotation times or what's next. - Media Session buttons: ⏯ pauses and resumes the practice clock, ⏭ is Next. Both undoable. Cleared when leaving the run screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
…ne (PR7c) Option C: "Block n of m" with a small icon in the corner, ENDS and the time in large type (PAUSED · TIME LEFT while paused), one line per station with the coach (without "Coach") in bold and then the drill, and the rotation times or what's next. Long lines shrink to fit; one station gets a line each for coach and drill; past four stations, three and "+ n more". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
A watch only vibrates for notifications, and with no server nothing can schedule one. iOS does wake the app when its timer track ends, just after the time-up beeps, so the app posts "Time's up: <drill>" (with what's next) through the service worker then; with the phone locked it goes to the watch. Skipped if more than 20 s late. Off by default: a Diagnostics switch asks permission, and the locked test sends one too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
The test read setTrackControls' first call as soon as the Pause button showed, but the screen registers the buttons in an effect after that render, so on a slower CI runner there was no call yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
"1 minute left: <drill>" goes out from the timer track's timeupdate events once they pass the 1-minute beep, since the track is still playing then (time's up still uses its ended event). Each kind has its own tag so one doesn't replace the other. The locked test sends both, and Diagnostics says which was sent last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
When the time-up beeps finished, the track ended, nothing was playing, and iOS suspended the app, so the watch's ⏭ (Next) reached nothing. Now a 5-second silent loop plays on, shown as "Time's up · Next: ...", until Next, Pause or leaving the run screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
practicePace: the target length minus the projected finish from blockEnds (the late warning's projection), in whole minutes; on time within half a minute. The run screen shows the drill's countdown beside a Practice box (green ahead, red behind, ✓ on time, no + or −). The watch album art has the same in a big coloured box beside the end time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
…ics (PR7c) Settings → Practice timer now has the sound, volume, "Beep when the phone is locked" and the Apple Watch switch, with a one-line hint and a "Test the beep" link. Diagnostics keeps only the test beeps, the locked test and the readings. The help tip is shorter too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
…PR7d) Practice now keeps startedAt (optional, no migration) when Start is tapped. The end time is the planned start time plus the length (or the tap plus the length if no time is set or it was over an hour off). While live, blockEnds ends the current block at now plus what's left of it, so paused time and a late start count, in the Practice box and the late warning alike. The box shows the target end time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
The box rounded to the nearest minute and the late warning rounded up, so 2⅓ minutes over showed as 2 and 3. Pace now rounds the cautious way, for a gym booked to a set time: behind up, like the late warning, and ahead down. A property test checks they always agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
Beeps render at full scale, so the phone's volume buttons set how loud. Settings → Practice timer now has Test beep and Test locked, so any coach can check the alerts work on their phone; Diagnostics keeps only the last sound and notification results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
"18m" and "40m" at full size were wider than the box, so they were cut to "18…". The number now shrinks to fit instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vMVHghGSC1psGfSfnQnmv
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.
Why the beeps weren't playing
pointerdown(touch-down). iOS only allows audio after a full tap (touchend/click), so the sound often never got readied.interruptedstate, and nothing resumed it.What changed
<audio>element, as media. It uses the media volume and ignores the silent switch. Where supported, it also setsnavigator.audioSession.type = 'playback'.src/nowPlayingArt.ts) is sized to read on a watch: "Block n of m" with a small next5 icon, ENDS and the time in large type, one line per station (coach, then drill), and the rotation times or what's next. ⏯ pauses and resumes the practice clock, and ⏭ is Next; both can be undone.src/timerNotice.ts, off by default): a watch only vibrates for notifications, and there's no server to schedule one. iOS wakes the app when the timer track ends, just after the time-up beeps, so the app posts "Time's up: " then. "1 minute left: " goes out from the track'stimeupdateevents as they pass the 1-minute beep. iPhone forwards both to the watch while the phone is locked. It's skipped if more than 20 s late. The Diagnostics switch asks permission, and the locked test sends one too.practicePaceis the target length minus the projected finish fromblockEnds, the same projection as the late warning. It goes by the time of day:startedAtis kept when Start is tapped (optional field, no migration), the end time is the planned start (or the tap) plus the length, and pauses and a late start count. The box shows the target end time. The run screen shows Drill and Practice boxes side by side (green ahead, red behind, ✓ on time, no + or −). The watch art has a big coloured box beside the end time ("5m BEHIND").src/domain/beeps.ts(beepPlan,renderBeeps,encodeWav) with example and property tests. Help, REQUIREMENTS (PR7c), STATUS and a changelog note are updated.To try on the beta preview
Trade-off: while the locked track plays, it pauses music from other apps and shows as "Practice timer" on the lock screen. Turning the switch off keeps your music playing but stops beeps while the phone is locked.
Checks
Lint, type check, 518 unit tests and the build pass. The e2e suite passed on Chromium; WebKit isn't installed in this container, so CI runs it.
Generated by Claude Code