Skip to content

Fix overlapping period entries when logging an already-covered date#134

Merged
mapgie merged 3 commits into
mainfrom
claude/period-logging-overlap-aafsuy
Jun 10, 2026
Merged

Fix overlapping period entries when logging an already-covered date#134
mapgie merged 3 commits into
mainfrom
claude/period-logging-overlap-aafsuy

Conversation

@mapgie

@mapgie mapgie commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Logging a period for a date that already falls within an existing (or ongoing) period now opens that period for editing instead of creating a new, overlapping entry.
  • An ongoing period (no end date) is treated as extending through today when checking whether a date is covered.
  • Added PeriodRepository.periodForDate() and routed both the calendar quick-log tap and the speed-dial "Log Period" action through it.

Context

Reported scenario: logging a period starting 3 June with no end date ("ongoing"), then logging a period for 7 June, created two separate overlapping period entries instead of being treated as the same period. Since 3 June 7 is within the ongoing period's range (3 June through today), tapping "Log Period" for 7 June now edits the existing 3 June period instead of creating a duplicate.

Note: this fixes the entry point going forward. Any duplicate entries already created from this bug need to be manually removed via History.

Test plan

  • Log a period with no end date (ongoing)
  • Tap "Log Period" again for a later date that falls within the ongoing range -> should open the existing (3 June) entry for editing, not create a new one
  • Set an end date on a period, then log a period for a date after that end date -> should create a new entry as before
  • python3 a11y_check.py passes (no new violations)

https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk


Generated by Claude Code

claude added 2 commits June 10, 2026 13:00
… an ongoing period

Tapping "Log Period" for a date that falls within an existing period's
range (including an ongoing period extending through today) now opens
that period for editing instead of creating a duplicate entry.

https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
One-time backfill (gated by a preference flag, same pattern as the
flow/symptoms backfills) that finds period entries with overlapping
date ranges - including ongoing periods, which extend through today -
and merges them into a single entry, combining notes and symptoms.

This cleans up duplicates created by the overlap bug fixed in the
previous commit for users who already hit it.

https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
@mapgie mapgie marked this pull request as ready for review June 10, 2026 17:12
main landed 0.47.2-beta.1 for an unrelated slider fix while this branch
was in progress. Renumber this branch's entries to 0.47.2-beta.2 and
0.47.2-beta.3 (versionCode 103/104) to avoid reusing a version string.

https://claude.ai/code/session_01GExcjNDTjnVRYkCWDcr8sk
@mapgie mapgie merged commit 84624bc into main Jun 10, 2026
4 checks passed
@mapgie mapgie deleted the claude/period-logging-overlap-aafsuy branch June 10, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants