Skip to content

Make duration optional for ongoing medications#175

Draft
waseefakhtar with Copilot wants to merge 3 commits into
mainfrom
copilot/make-duration-optional
Draft

Make duration optional for ongoing medications#175
waseefakhtar with Copilot wants to merge 3 commits into
mainfrom
copilot/make-duration-optional

Conversation

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown

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)


💡 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 AI and others added 2 commits December 3, 2025 09:55
Co-authored-by: waseefakhtar <4093820+waseefakhtar@users.noreply.github.com>
Co-authored-by: waseefakhtar <4093820+waseefakhtar@users.noreply.github.com>
Copilot AI changed the title [WIP] Make duration field optional for medication Make duration optional for ongoing medications Dec 3, 2025
Copilot AI requested a review from waseefakhtar December 3, 2025 10:01
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.

Make duration optional

2 participants