Skip to content

Universal data portability: CSV import/export, clearer backup labels, alarm fixes - #22

Open
nufuturepro wants to merge 1 commit into
FeDeveloper95:mainfrom
nufuturepro:upstream-contribution
Open

nufuturepro wants to merge 1 commit into
FeDeveloper95:mainfrom
nufuturepro:upstream-contribution

Conversation

@nufuturepro

@nufuturepro nufuturepro commented Sep 12, 2026

Copy link
Copy Markdown

Universal data portability, supply tracking, and alarm fixes

Three areas in a single commit:

1. Data portability

  • JSON export/import: full-fidelity backups (all item types, taken history, supply settings); import merges by ID and never duplicates or destroys existing data.
  • CSV export/import: spreadsheet-friendly, with the three supply columns; older CSVs without them import unchanged.

2. Supply tracking & widget

  • Per-medication supply tracker (doses left / refill size / low threshold) with a card badge that turns red at the threshold.
  • Taking or un-taking a dose updates stock through every path: in-app, notification action, and Wear.
  • One-time low-supply notification per entry (own high-priority channel), auto-cancelled on refill, edit, delete, or un-take; re-evaluated on app start, boot, and import.
  • Lowest-supply home-screen widget, refreshed on every data save.

3. Taken-history hardening (the core of this update)

Every path that could silently destroy a logged dose is fixed, with the rules extracted into a pure MedUpdatePlanner covered by an 18-test JVM suite:

  • No-op guard: saving the editor without changes no longer deletes and recreates the entry (which reset takenHistory).
  • Supply-only edits apply in place across the whole group — no entry recreation, no history loss, no fragmentation.
  • Sibling-slot preservation: editing one dose slot of a multi-dose med no longer deletes the other slots and their history; a changed time carries its history to the new time.
  • Range edits ("only this event" / "all following" / date range) no longer wipe takenHistory and no longer leave phantom history-free schedule fragments; history is trimmed to the window each fragment actually covers.
  • Illness renames keep their notes.
  • Stats: adherence counts each medication+time slot once per day, so legacy duplicate fragments can't deflate streaks.
  • Alarm resilience: all dose alarms are re-armed on every app start (previously lost after a force-stop until an unrelated edit).

The importer also un-tracks the accidentally committed local.properties.

@nufuturepro
nufuturepro deleted the upstream-contribution branch September 14, 2026 14:23
@nufuturepro nufuturepro reopened this Sep 14, 2026
@nufuturepro
nufuturepro force-pushed the upstream-contribution branch 2 times, most recently from f714ebf to 47e94f4 Compare September 15, 2026 03:26
Adds JSON/CSV export+import, per-medication supply tracking with
low-supply alerts, a lowest-supply home-screen widget, and hardens every
edit path so taken-dose history can never be silently destroyed
(no-op guard, sibling-slot preservation, history-follows-time-slot,
phantom-fragment dropping) — covered by an 18-test JVM suite
(MedUpdatePlanner). Stats counts each med+time once per day, illness
renames keep their notes, and dose alarms re-arm on app start.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

1 participant