Repository navigation
feat: port sleep editing, estimated SpO2, phone step source, and bucket/HR time formatting - #152
Open
foureight84 wants to merge 1 commit into
Open
foureight84 wants to merge 1 commit into
foureight84 wants to merge 1 commit into
Conversation
…et/HR time formatting
This branch has not been deployed
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
Ports the remaining Android features/fixes (PulseLoopAndroid PRs #98, #129, #130, #149, #154) to iOS:
SleepRecordExtension,SleepTailSuggestion,SleepView,PulseEventBus):isManuallyEdited(Bool = false) toSleepSession(andArchiveSleepSessionbackward compatibility) and overlap protection inPulseEventBus.persistSleepTimelineso ring re-syncs do not overwrite edited sleep bounds without blocking distinct sessions (e.g. naps) on the same waking day.Edit sleepbutton &SleepEditSheetinSleepViewto extend/trim bedtime and wake bounds (withSleepRecordExtension.computeLimits/editedBlocks) or delete a sleep record.SleepTailSuggestionDetector&SleepTailSuggestionStore(including the manual-edit cap from Android PR #154).EstimatedSpo2,MetricDetailView):EstimatedSpo2heuristic detecting when a ring'shistorySpO₂ values vary deterministically with heart rate alongside respiratory-rate timestamps."Estimated from HR"badge and disclaimer intoMetricDetailViewfor.spo2when detected.StepSourcePrefsStore,DisplaySteps,PhoneStepManager,MeasurementSettingsView,ActivityView,ActivityTrendsView,PulseServices):ActivityDaily.phoneSteps/phoneDistanceMeters(non-destructive alongside ring steps, preserved inDataArchive),NSMotionUsageDescriptioninproject.pbxproj, andCMPedometer-backedPhoneStepManager.refreshToday.Ring/Phone/Auto (Highest)Step Source segmented picker inMeasurementSettingsView.MetricsService.buildTodaySummary,metricRange,ActivityTrendsView, and Coach context throughDisplaySteps.ReadingsTimeFormatter,ActivityBucketSample.durationMinutes,ActivityView,MetricDetailView):durationMinutes: Int?onactivityBucketevents (15m Colmi/JRing, 30m YCBT, 60m RWfit JieLi) andActivityBucketSample.ActivityViewdisplaying formatted time ranges (9:00 AM – 9:15 AM).MetricDetailViewdisplaying seconds for live sub-minute HR streams.Verification
xcodebuild test -project PulseLoop.xcodeproj -scheme PulseLoop -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:PulseLoopTests/SleepEditingAndTailTests -only-testing:PulseLoopTests/EstimatedSpo2Tests -only-testing:PulseLoopTests/StepSourceTests -only-testing:PulseLoopTests/ActivityBucketAndReadingsTests -only-testing:PulseLoopTests/ColmiDecoderTests -only-testing:PulseLoopTests/RWfitDecoderTests -only-testing:PulseLoopTests/YCBTHealthRecordsTests -only-testing:PulseLoopTests/RingDecoderTests -only-testing:PulseLoopTests/LuckRingDecoderTests: 141/141 tests passed.