dose-android icon indicating copy to clipboard operation
dose-android copied to clipboard

Make duration optional for ongoing medications

Open Copilot opened this issue 3 months ago • 0 comments

Users taking medication indefinitely had no way to skip adding an end date. The date picker would crash when trying to set far-future dates like 2100.

Changes

Data Layer

  • Made endDate nullable in Medication domain model and MedicationEntity
  • Added Room auto-migration v4→v5 for schema change

UI

  • Added "Ongoing (no end date)" checkbox with proper accessibility (toggleable + Role.Checkbox)
  • Shows single date picker for start date when ongoing is selected, date range picker otherwise
  • New StartDatePickerDialog component

ViewModel

  • For ongoing medications, creates 1 year of reminders initially (extendable in future)
  • endDate stored as null in database for ongoing medications

Confirmation Screen

  • Displays "ongoing" instead of end date for ongoing medications
  • Added all_set_ongoing plural string resource
// Medication model now supports nullable endDate
data class Medication(
    ...
    val endDate: Date?,  // null = ongoing medication
    ...
)

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/gradle-launcher-8.7.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/agents/gradle-instrumentation-agent-8.7.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.7 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Make duration optional</issue_title> <issue_description>For medicine I need to take for life, there's no easy solution to skip adding a duration. If I try to enter a future date, it states the latest year I can set is 2100 but then the app crashes and won't let me click "confirm" to add itScreenshot_20251202-201418_Dose.jpg

</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes waseefakhtar/dose-android#174

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Dec 03 '25 09:12 Copilot