Repository navigation
body cycle recovery
Kotlin counterpart: app/src/test/kotlin/tech/mmarca/openvitals/features/body/BodyDisplayDerivationsTest.kt (readings list, tracked metrics, per-day series, over the extracted hasAnyBodyData / newestFirst() / onDate() seams) and BodyPresentationMapperTest.kt (summary)
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| an empty period has no data, no readings and no tracked metrics | PORTED | BodyDisplayDerivationsTest.kt: an empty period has no data, no readings and no tracked metrics
|
needed the hasAnyBodyData seam |
| the summary takes the latest reading, and the first weight | PORTED | BodyDisplayDerivationsTest.kt: the summary takes the latest reading, and the first weight
|
firstWeightKg/weightChangeKg/ffmi/adjustedFfmi now asserted |
| the daily series keeps one value per day: that day's latest | PORTED | BodyDisplayDerivationsTest.kt: the daily series keeps one value per day, that day's latest
|
values + dayValues (intraday) + trackedMetrics |
| BMI has a series only when a height is known | PORTED | BodyDisplayDerivationsTest.kt: BMI has a series only when a height is known
|
series presence/absence + FFMI needs body fat too (its own series: FFMI has a series of its own, one point per body-fat reading) |
| readings are newest first, indexed by day, and only OpenVitals ones are editable | PORTED | BodyDisplayDerivationsTest.kt: readings are newest first, indexed by day, and only OpenVitals ones are editable
|
needed newestFirst()/onDate() seams |
| a period with a latest value but no entries still has data | PORTED | BodyDisplayDerivationsTest.kt: a period with a latest value but no entries still has data
|
hasAnyBodyData + empty readings + metric latest |
Kotlin counterpart: app/src/test/kotlin/tech/mmarca/openvitals/features/body/BodyViewModelTest.kt
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| a loaded period lands with its display precomputed | DIVERGED | BodyViewModelTest: load success populates weight entries, initial load clears loading and produces no error
|
entries/loading/error covered; no precomputed readings-list equivalent in Kotlin state |
| a permission failure becomes ScreenErrorPermissionDenied | PORTED | BodyViewModelTest.kt: a permission failure becomes ScreenError PermissionDenied
|
toScreenError() now maps a SecurityException (Health Connect's refusal) to ScreenError.PermissionDenied; error type and empty entries asserted |
| an unexpected failure carries its message to the screen | PORTED | BodyViewModelTest: load failure sets error and clears loading
|
|
| deleting an entry rebuilds the display without waiting for the reload | PORTED | BodyViewModelTest.kt: deleting an entry rebuilds the display without waiting for the reload
|
delete gated so the optimistic pre-reload state is observed, then the FORCE reload verified |
| a failed delete restores the previous display, with an error | PORTED | BodyViewModelTest.kt: a failed delete restores the previous display, with an error
|
no failed-delete rollback test |
| navigating to a new range clears the stale display mid-load | DIVERGED | BodyViewModelTest.kt: navigating to a new range keeps the previous display until the new one lands
|
blocked on behavior decision - Flutter blanks the display mid-load, Kotlin deliberately keeps it (no chart flash); the test pins Kotlin's actual behavior |
| a same-range refresh keeps the display (no loading flash) | PORTED | BodyViewModelTest.kt: a same-range refresh keeps the display (no loading flash)
|
no refresh-keeps-display test |
| a stale load cannot overwrite the newer one it lost to | PORTED | BodyViewModelTest.kt: a stale load cannot overwrite the newer one it lost to
|
LoadCoordinator single-flight |
Kotlin counterpart: app/src/test/kotlin/tech/mmarca/openvitals/core/presentation/MetricDetailSectionOrderViewModelTest.kt (section reorder only); otherwise none
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| aggregate renders one trend chart per tracked metric, none for empty ones | PORTED | BodyTrendsAndEntriesTest: theAggregateChartsOnlyTheMetricsThatWereActuallyTracked
|
Compose instrumentation; runs on a device, not in CI |
| statistics grid shows every metric with its latest value | PORTED | BodyContentTest: oneTrackedMeasurementIsEnoughToCountAsData
|
Compose instrumentation; runs on a device, not in CI |
| swiping an OpenVitals entry away deletes it through the repo | PORTED | BodyTrendsAndEntriesTest: swipingAnOpenVitalsReadingAwayDeletesItThroughTheRepository
|
Compose instrumentation; runs on a device, not in CI |
| read-only (non-OpenVitals) entries are not swipe-deletable | PORTED | BodyTrendsAndEntriesTest: aReadingThisAppDidNotWriteIsNotSwipeDeletable
|
Compose instrumentation; runs on a device, not in CI |
| empty period renders the body placeholder | PORTED | BodyContentTest: anEmptyPeriodRendersTheBodyPlaceholder
|
Compose instrumentation; runs on a device, not in CI |
| section reorder persists through the preferences repository | PORTED | MetricDetailSectionOrderViewModelTest: moveSectionToTarget_reordersAndPersists, toggleSectionEdit_switchesEditingState
|
reorder+persist+edit-toggle essence fully covered at JVM level |
Kotlin counterpart: app/src/test/kotlin/tech/mmarca/openvitals/features/cycle/CyclePresentationMapperTest.kt, app/src/test/kotlin/tech/mmarca/openvitals/features/cycle/CyclePresentationTest.kt
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| an empty period derives zeroes and no observations | PORTED | CyclePresentationMapperTest.kt: display has no data for empty cycle data
|
latestBbtCelsius-null, sampleCount, sources and observationsFor()-empty added |
| period days count the days a period covers, not the records | PORTED | CyclePresentationMapperTest.kt: period days count the days a period covers, not the records
|
exact 3-day count from one record, plus the exact active dates |
| the summary counts every record, and the latest basal temperature | PORTED | CyclePresentationMapperTest: display has data when cycle records exist + summary counts period days with active menstruation
|
|
| observations from every record type are merged, newest first | PORTED | CyclePresentationTest: observationsFor maps cycle records to sorted display observations
|
Kotlin counterpart: none (underlying logic in CyclePresentationTest / CycleViewModelTest)
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| renders summary + observations once loaded | PORTED | CyclePeriodContentTest: rendersSummaryAndObservationsOnceLoaded
|
Compose instrumentation; runs on a device, not in CI |
| gates the screen when the cycle permission is missing | PORTED | HealthConnectAccessGateTest: insufficientAccess_replacesTheContentAndOffersToGrant
|
Kotlin routes every screen gate through HealthConnectScreenShell, so it is pinned once rather than per screen |
| shows the empty placeholder with no data | PORTED | CyclePeriodContentTest: showsTheEmptyPlaceholderWithNoData
|
Compose instrumentation; runs on a device, not in CI |
Kotlin counterpart: app/src/test/kotlin/tech/mmarca/openvitals/features/cycle/CycleViewModelTest.kt
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| a loaded period lands with its display precomputed | PORTED | CycleViewModelTest: load success populates cycle data and missing permissions + initial load clears loading and sets empty data
|
|
| a permission failure becomes ScreenErrorPermissionDenied | PORTED | CycleViewModelTest.kt: a permission failure becomes ScreenError PermissionDenied
|
a refused read now maps to ScreenError.PermissionDenied; the missingPermissions state stays a separate, successful-load signal |
| an unexpected failure carries its message to the screen | PORTED | CycleViewModelTest: load failure sets error and clears loading
|
|
| refresh reloads the current selection in force mode | PORTED | CycleViewModelTest.kt: resuming the current period refreshes the current selection in force mode
|
Kotlin's refresh entry point is resumeCurrentPeriod(refreshCurrent = true) |
| a stale load cannot overwrite the newer one it lost to | PORTED | CycleViewModelTest.kt: a stale load cannot overwrite the newer one it lost to
|
no single-flight/staleness test for cycle |
Kotlin counterpart: app/src/test/kotlin/tech/mmarca/openvitals/features/recovery/RecoveryViewModelTest.kt
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| buildRecoveryDetailDisplay > a day the lookback never reached is blank, not an error | PORTED | RecoveryViewModelTest.kt: a day the lookback never reached is blank, not an error
|
blank fallback day + mainSleepSession-null + NO_DATA + no error |
| buildRecoveryDetailDisplay > the selected day is picked out of the week, and scored | PORTED | RecoveryViewModelTest: load builds seven day recovery overview from sleep sessions
|
Kotlin computes the score rather than injecting it |
| buildRecoveryDetailDisplay > the main session of a night is the one with the most sleep in it | PORTED | RecoveryViewModelTest: main sleep session uses longest session for sleep schedule
|
same maxBy(sleepDurationMsFromStages) selection logic |
| RecoveryDetailViewModel > a loaded week lands with the selected day precomputed | PORTED | RecoveryViewModelTest: load builds seven day recovery overview from sleep sessions
|
7-day lookback, selectedDate, main session all asserted |
| RecoveryDetailViewModel > a permission failure becomes ScreenErrorPermissionDenied | PORTED | RecoveryViewModelTest.kt: a permission failure becomes ScreenError PermissionDenied
|
error type, cleared loading and empty week asserted, as in the Dart original |
| RecoveryDetailViewModel > a failed reload keeps the week already on screen | PORTED | RecoveryViewModelTest.kt: a failed reload keeps the week already on screen
|
Kotlin onFailure does keep days, but no test asserts it |
Kotlin counterpart: none
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| Recovery renders the stress score card once loaded | PORTED | StressDetailsContentTest: theStressCardRendersItsScoreLevelAndConfidenceOnceLoaded
|
Compose instrumentation; runs on a device, not in CI |
| Recovery shows the access gate when permission missing | PORTED | HealthConnectAccessGateTest: insufficientAccess_replacesTheContentAndOffersToGrant
|
Kotlin routes every screen gate through HealthConnectScreenShell, so it is pinned once rather than per screen |
Kotlin counterpart: none (SleepEfficiencyDetailScreen.kt composable has no test)
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| renders the four sleep-efficiency cards from a fixed estimate | PORTED | RecoveryDetailScreensTest: theSleepEfficiencyScreenRendersItsFourCardsFromAFixedEstimate
|
Compose instrumentation; runs on a device, not in CI |
| tapping a reference button opens the link without throwing | N/A-FRAMEWORK | none | url_launcher platform-channel fallback behavior |
| the calculation card expands and collapses | PORTED | RecoveryDetailScreensTest: theSleepEfficiencyCalculationCardExpandsAndCollapses
|
Compose instrumentation; runs on a device, not in CI |
| a no-data day renders the no-data placeholders | PORTED | RecoveryDetailScreensTest: aNoDataDaySleepEfficiencyStillRendersItsCards
|
Compose instrumentation; runs on a device, not in CI |
Kotlin counterpart: none (SleepScoreDetailScreen.kt composable has no test)
| Flutter case | Status | Kotlin test | Note |
|---|---|---|---|
| renders the four sleep-score cards from a fixed estimate | PORTED | RecoveryDetailScreensTest: theSleepScoreScreenRendersItsFourCardsFromAFixedEstimate
|
Compose instrumentation; runs on a device, not in CI |
| tapping a reference button opens the link without throwing | N/A-FRAMEWORK | none | url_launcher platform-channel fallback behavior |
| the calculation card expands and collapses | PORTED | RecoveryDetailScreensTest: theSleepScoreCalculationCardExpandsAndCollapses
|
Compose instrumentation; runs on a device, not in CI |
| a no-data day renders the no-data placeholders | PORTED | RecoveryDetailScreensTest: aNoDataDaySleepScoreStillRendersItsCards
|
Compose instrumentation; runs on a device, not in CI |
PORTED: 28, DIVERGED: 2, MISSING: 0, N/A-WIDGET: 16, N/A-FRAMEWORK: 2
None outstanding.
Generated from docs/engineering/test-parity/body-cycle-recovery.md. Edit it there; changes made here are overwritten.
This wiki mirrors the Markdown in Hale-MTU/OpenVitals on every push to main.
Features
- Features
- Achievements
- Activity And Training Plans
- Activity Metrics
- Apple Health Import
- Beverage Logging And Caffeine
- Bluetooth LE Sensors
- Body Energy
- Body Metrics
- CoMaps Navigation Context
- CSV Import
- Cycle Tracking
- Daily Readiness
- Elevation Correction
- Feature Map
- FIT Files Import
- Food Logging
- GPX/KML/KMZ/TCX Route Import
- Health Connect Metrics Dashboard
- Health Report Export
- Heart And Vitals
- Heart Rate Recovery
- Home Screen Widgets
- Hydration
- Manual Entry Of Metrics
- Medical Records
- Metric Detail Customization
- Mindfulness
- Non Health Connect Metrics Dashboard
- Nutrition
- Offline Maps Support
- Onboarding And Permissions
- Preloaded Beverage Nutrition Reference
- Privacy, Support, And Diagnostics
- Recording Of Activity
- Reminders
- Settings And Preferences
- Share With Other Apps
- Sleep Score And Recovery
- Sleep Tracking
- Statistics
- Sync With Another Phone
How-to
App
- App Guide
- FAQ
- Getting Started
- Health Connect
- Install
- Local And Connected Editions
- Permissions
- Privacy
- Screenshots
- Support
Reference
- Design Reference
- Reference
- Design Guidelines for Offline & Sync
- OpenVitals UI Notes
- Reference: Data Capture
- Reference: Data Display
- Reference: Health Connect Matchmaking
- Reference: Health Connect Onboarding
- Reference: Health Connect Permissions
- Reference: Health Connect UX
- Reference: Promoting Health Connect
Engineering
- Code Analysis
- Engineering
- Flutter ↔ Kotlin test-parity matrix
- apple-health-import
- Architecture
- body-cycle-recovery
- Design system conformance
- Development
- Feature Playbook
- Flutter -> Kotlin test parity: domain/data/core/contract/state/navigation/di/bootstrap/l10n/widget_test
- Flutter → Kotlin test-parity matrix: features section
- Flutter → Kotlin test-parity matrix: ui / goldens / integration / fixtures
- Flutter-to-Kotlin test-parity matrix — dashboard + devicesync
- manual-entry
- Translations
Proposals
- Proposals
- Activity Start Flow Analysis
- Activity Start Flow Simplification Proposals
- Caffeine Detail And Future Sleep Insights
- Cycle Tracking: Design and Status
- Medical Records Through Health Connect
- Medical Records: What Is Left
Releases
- OpenVitals 2.17.0
- OpenVitals 2.16.0
- OpenVitals 2.15.2
- OpenVitals 2.15.1
- OpenVitals 2.15.0
- OpenVitals 2.14.5
- OpenVitals 2.14.4
- OpenVitals 2.14.3
- OpenVitals 2.14.2
- OpenVitals 2.14.1
- OpenVitals 2.14.0
- OpenVitals 2.13.0
- OpenVitals 2.12.0
- OpenVitals 2.11.2
- OpenVitals 2.11.1
- OpenVitals 2.11.0
- OpenVitals 2.10.1
- OpenVitals 2.10.0
- OpenVitals 2.9.1
- OpenVitals 2.9.0
- OpenVitals 2.8.0
- OpenVitals 2.7.3
- OpenVitals 2.7.2
- OpenVitals 2.7.1
- OpenVitals 2.7.0
- OpenVitals 2.6.6
- OpenVitals 2.6.5
- OpenVitals 2.6.4
- OpenVitals 2.6.3
- OpenVitals 2.6.2
- OpenVitals 2.6.1
- OpenVitals 2.6.0
- OpenVitals 2.5.0
- OpenVitals 2.4.1
- OpenVitals 2.4.0
- OpenVitals 2.3.2
- OpenVitals 2.3.1
- OpenVitals 2.3.0
- OpenVitals 2.2.8
- OpenVitals 2.2.7
- OpenVitals 2.2.6
- OpenVitals 2.2.5
- OpenVitals 2.2.4
- OpenVitals 2.2.3
- OpenVitals 2.2.2
- OpenVitals 2.2.1
- OpenVitals 2.2.0
- OpenVitals 2.1.0
- OpenVitals 2.0.4
- OpenVitals 2.0.3
- OpenVitals 2.0.2
- OpenVitals 2.0.1
- OpenVitals 1.9.0
- OpenVitals 1.8.0
- OpenVitals 1.7.7
- OpenVitals 1.7.6
- OpenVitals 1.7.5
- OpenVitals 1.7.4
- OpenVitals 1.7.3
- OpenVitals 1.7.2
- OpenVitals 1.7.1
- OpenVitals 1.7.0
- OpenVitals 1.6.3
- OpenVitals 1.6.2
- OpenVitals 1.6.1
- OpenVitals 1.6.0
- OpenVitals 1.5.1
- OpenVitals 1.5.0
Project