Commit Graph

3 Commits

Author SHA1 Message Date
2105cf861c Fix intimacy add-encounter form and Health Trends loading
Intimacy form: move AddIntimacyForm from an inline LazyColumn card (where
Cancel/Add buttons land below the fold and keyboard) to a ModalBottomSheet
that is always fully visible and slides above the keyboard. Also fix a
race-condition in addIntimacyLog where `_uiState.value = state.copy(isDirty=true)`
used a stale snapshot and could overwrite a concurrent Room Flow update that had
already refreshed intimacyLogs — replaced with the atomic `_uiState.update {}`.

Health Trends: replace `onEach {...}.launchIn()` with `collectLatest {}` inside
a try/catch so any exception during setup or DB query resolves isLoading rather
than leaving the screen stuck on an infinite spinner. collectLatest also cancels
in-flight computations when the user switches the time range, preventing stale
results. Removed unused CycleRepository / CyclePredictionEngine imports.
Update deprecated TrendsRange.values() → TrendsRange.entries in the screen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 23:44:57 -05:00
cd276ed44c Refine period tracking logic and UI feedback in DayDetailScreen.
- Update `DayDetailUiState` to include `hasActiveCycle` and `cycleStartDate` to better track ongoing cycles.
- Replace `periodActive` check with `hasActiveCycle` for displaying the "Period day" badge and toggle icons.
- Improve validation for the "Period ended" action:
    - Enable the chip only if a cycle is active and the current date is after the cycle's start date.
- Update `DayDetailViewModel` to accurately calculate `periodDayNumber` and cycle status by fetching records from the repository.
- Ensure period state is correctly reset or initialized when toggling period start/end.

Signed-off-by: whitlocktech <whitlocktech@gmail.com>
2026-05-22 17:52:18 -05:00
bba09dc131 Initial commit: Implement base health and cycle tracking application.
- Set up Android project structure with Gradle 8.7, Kotlin 2.0, and Hilt.
- Implement Room database with entities for Profiles, Day Logs, Conditions, Cycle Records, and Intimacy Logs.
- Integrate Jetpack Compose for the UI layer including Navigation and Material3.
- Develop a cycle prediction engine to calculate menstruation, fertile windows, and ovulation based on user history.
- Implement core screens:
    - **Onboarding:** Initial profile setup for female/male users.
    - **Calendar:** Monthly view showing cycle phases, logged symptoms, and intimacy records.
    - **Day Detail:** Detailed logging for symptoms (with ratings), period status, notes, and intimacy encounters.
    - **Cycle Insights:** Visualization of cycle phases and historical cycle length trends.
    - **Health Trends:** Frequency and recurrence analysis of logged health conditions over various time ranges.
    - **Settings:** Profile management, data clearing, and app theme configuration.
- Add DataStore for managing user preferences such as active profile and onboarding status.

Signed-off-by: whitlocktech <whitlocktech@gmail.com>
2026-05-22 17:42:09 -05:00