Repository navigation
alarms: one wake schedule for the strap alarm and the wind-down reminder - #37
Merged
Merged
Conversation
Builds on #36, which moved the per-day wake times under the strap alarm. That left the reminder without any editable wake time while the alarm is off, overwrote the reminder's stored time on every visit, deleted a day's own time when its alarm weekday was deselected, and blanked the hero whenever any per-day time existed. - New "Wake time" card, always visible: the usual wake time plus the per-day times. Both the strap alarm and the reminder read it; it states that it only wakes you when the strap alarm is on. - The strap alarm card keeps the switch, weekdays and arming status, no picker of its own. - One-time merge of the two stored times: the reminder's when only the reminder was on, otherwise the alarm's, so an armed alarm is never re-timed. Replaces the per-visit sync. - Deselecting an alarm weekday keeps that day's own time; the editor lists all seven days. - Schedule edits re-arm the strap only while the alarm is on, so editing the reminder's times never writes a disable to the strap. - Hero and reminder line resolve the next wake, per-day time included, instead of a dash. - Days with their own time sit on an inset fill; the honesty note moves to the end. - One new string, translated into all nine locales. Source-contract tests updated to the single-schedule model; pure tests for the merge rule and next-wake resolution. Analysis migration required: no. Alarm and reminder scheduling only.
# Conflicts: # Strand/Resources/Localizable.xcstrings
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.
What this PR does
Supersedes #36 (by @rodrigosa7) and carries its commit. #36 moved the per-day wake times under the strap alarm. The idea is right, but as written it also:
onAppear), silently re-timing the reminder;AlarmWakeTimeLabellingTestspins, soStrandTestswould fail.This PR keeps the direction (one wake time) and fixes those points:
alarm.wakeTimesUnified). It takes the reminder's time when only the reminder was on, otherwise the alarm's, so an armed alarm is never re-timed. This replaces the per-visit sync.rearmStrapAlarmIfOn), so editing the reminder's times never writes a disable to the strap.WindDownNudge.nudgeMinuteOfDay(forWake:)is extracted as a pure helper. The existing callers return the same output.Analysis migration required: no. This only changes alarm and reminder scheduling.
Type of change
How it was tested
python3 Tools/i18n_audit.py --ci origin/main: passes. The one new string is translated into all nine locales. As a cross-check, the gate fails without the catalog entry.python3 Tools/doc_comment_lint.py: passes.git diff --check: clean.app-build.ymlon head88aec97passed:Strand(macOS) andNOOPiOS(iOS Simulator) both build, andStrandTestspassed on the macOS leg.AlarmWakeScheduleTests: merge rule, next-wake resolution (including the wake-minute edge and the Sat→Sun wrap), andnudgeMinuteOfDay(forWake:)parity with the stored-wake path.AlarmWakeTimeLabellingTestsis updated to the single-schedule model:disableStrapAlarm. Not tested on a strap.Checklist
Strandand/orNOOPiOS): both pass inapp-build.ymlStrandDesigntokens — no hardcoded colors, fonts, or spacingdocs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/signing materialRelated issues
Supersedes #36.
Generated by Claude Code