feat: visualize 30 s idle countdown during the reminding phase - #1
Open
mo2g wants to merge 1 commit into
Open
Conversation
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.
Summary
During the reminding phase, the system waits for 30 seconds of inactivity (
ackIdleThreshold = 30) to implicitly acknowledge the break. This countdown was previously invisible to the user. This PR surfaces the countdown in the menu bar and the popover ring so users can see exactly how many seconds remain.Motivation
Users had no way to know how long until their break would auto-acknowledge (or what the orange/red flashing icon meant in concrete terms). Showing a real-time 30→0 countdown closes that gap.
Changes
Core principle: zero modification to existing BreakTimer acknowledgment/rest logic. The countdown is purely read-only — derived from the
idleSecondsvalue already passed into every tick.BreakTimer.swift (3 additions, 0 modifications to existing logic)
lastIdleSecondsfrom the existingidleSecondsparameter intick()remindingCountdownproperty computed insidetickReminding()before any acknowledge call — avoids the timing bug wherecompleteAcknowledge()changesphasebefore the delegate can read the value-1when phase is no longer.remindingAppController.swift
syncViewModel(): readstimer.remindingCountdown→ syncs toviewModel.remindingCountdownAppViewModel.swift
@Published var remindingCountdown: Int = -1timeString: shows bare"Ns"during reminding (ring center readout)menuBarTitle: shows"Break Ns"during reminding (menu bar text)MenuBarController.swift
.iconCountdownstyle now usesviewModel.menuBarTitleRingViews.swift
CountdownArcsubview: pure render layer, semi-transparent arc shrinking 30→0CountdownRinggains acountdown: Int?parameter + spring-bounce animation on activity resetPopoverView.swift
countdownparameter toCountdownRingL10n.swift
"status.countdown":"%ds"(consistent across en / zh-Hans / ja)Not modified
ackIdleThresholdremains 30Verification