Fix period logging: always show Flow/Symptoms, save all tracked categories with defaults#163
Merged
Merged
Conversation
Flow and Symptoms now show unconditionally on the Log Period screen as long as the category exists and is not archived — the showInLogPeriod flag is not user-controllable for system categories, so the guard was unnecessary and created a silent no-show risk. syncFlowToTrackingLog now calls saveLog (upsert) instead of syncFlowLogsForPeriod (insert-only). This means editing an existing period correctly updates the flow level rather than silently keeping the previous value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYPputv2ksYiiz79HNgQ1T
numeric_slider categories now fall back to numericMin when the user has not moved the slider, matching the value the UI displays. increment categories now always write an entry (including 0) since a zero count is meaningful data for a category pinned to period logging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYPputv2ksYiiz79HNgQ1T
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
Flow and Symptoms always appear on the Log Period screen. Previously guarded by
showInLogPeriod, which is not user-controllable for system categories (the toggle is hidden in the UI). Removing the guard makes the behaviour unconditional: these sections show as long as the category exists and is not archived.Editing a period now correctly saves the selected flow level. The previous call to
syncFlowLogsForPeriodskipped any date that already had a flow log, so changing flow while editing a period was silently ignored. Switched tosaveLog(upsert), consistent with how symptoms are already saved.All pinned categories record an entry on save, even with default values.
numeric_slidercategories now fall back tonumericMinwhen the user has not moved the slider (matching the value already displayed in the UI).incrementcategories now always write an entry including a count of 0, since a zero is meaningful data for a category the user chose to track alongside periods. Chip and free-text categories are unchanged — they still require an explicit selection.Changed files
ui/screens/log/LogPeriodScreen.kt— removedshowInLogPeriodguard from Flow and Symptoms sections.ui/screens/log/LogPeriodViewModel.kt—syncFlowToTrackingLogusessaveLog(upsert) instead ofsyncFlowLogsForPeriod(insert-only);syncSymptomsToTrackingLoghas theshowInLogPeriodguard removed;computePinnedValuessaves slider minimum and zero-counts instead of skipping.changelog/unreleased/period-tracking-auto-sync.json— patch changelog fragment.