Repository navigation
fix: scheduling boundaries, accurate stats, and review fixes - #7
Merged
Merged
Conversation
… install - Info.plist hardcoded 1.0, so releases ignored the MARKETING_VERSION override - Makefile resolved the built app at parse time, before build ran - CI: drop redundant build step; release: pass dispatch input via env
…s wake - re-evaluate status at the next boundary (work start, lunch, end, pause, vacation) - never schedule a reminder past the current working stretch - wake no longer restarts a still-valid countdown - ignore snooze outside working time; log autoStart only when work starts - clear delivered notifications so stale banners cannot flip posture - flush history on quit and in tests instead of sleeping
- move totals out of MenuPopoverView into PostureStats, clipped to work hours minus lunch and never crossing midnight - popover: TimelineView instead of a stored 1 Hz timer, pause state from status - vacations cover whole days, single-day vacations allowed - launch at login reads SMAppService, stand warning at 45 min - custom mode no longer shows a preset as selected, single settings write for shared hours, hours validation hint, science text fix
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.
Fixes from a full code review of the app.
Root causes and fixes
Scheduling
ScheduleEvaluator.nextStatusChangenow computes the next real status change and a timer re-evaluates at that moment. A reminder that would land after the current working stretch is not scheduled. The unused minute-by-minutenextWorkingMomentis removed.refresh()keeps a countdown that is still valid.autoStartwas logged at midnight and on days off. It is now logged at the first working moment of the day.Stats
PostureStats, clipped to work hours minus lunch. Segments never cross midnight and use their start date as the id instead of a freshUUID.Settings / UI
SMAppServicedirectly, andSettings.launchAtLoginis removed (old saved data still decodes).TimelineViewfor the per-second parts instead of a storedTimer.publish.Build / CI
Info.plisthardcoded1.0, so the app never showedMARKETING_VERSIONand releases were mislabeled. It now uses build-setting variables.make installlooked for the built app before building. It now uses-derivedDataPath build.workflow_dispatchtag from an env var instead of interpolating it into the script.Tests: 33 to 50. New coverage for boundaries, wake, lunch clamping, snooze off-hours, autoStart, whole-day vacations and stats clipping. Removed the sleep-based wait in
HistoryStoreTestsand a leaked UserDefaults suite.Not changed
NSApp.activate(ignoringOtherApps:)is not deprecated at the macOS 13 target, and cooperativeactivate()could regress fix(menu): activate app when opening Settings/History #5.Files changed
Hop/Scheduler/PostureScheduler.swift,ScheduleEvaluator.swift,NotificationManager.swiftHop/Models/PostureStats.swift(new),Settings.swift,Presets.swiftHop/Persistence/HistoryStore.swift,Hop/AppDelegate.swift,Hop/HopApp.swiftHop/Menu/MenuPopoverView.swiftHop/Views/History/HistoryView.swift,TodayChart.swift,WeekChart.swiftHop/Views/Settings/GeneralTab.swift,ScheduleTab.swift,VacationsTab.swift,ScienceTab.swiftHopTests/*(newPostureStatsTests.swift)project.yml,Hop/Info.plist,Makefile,.github/workflows/ci.yml,.github/workflows/release.yml