Skip to content

Patient portal APK + grouped Android dose alarms - #7

Open
yash-learner wants to merge 18 commits into
developfrom
cursor/patient-capacitor-alarms-4f0c
Open

Patient portal APK + grouped Android dose alarms#7
yash-learner wants to merge 18 commits into
developfrom
cursor/patient-capacitor-alarms-4f0c

Conversation

@yash-learner

@yash-learner yash-learner commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Proposed Changes

Working branch for the CARE patient APK + Android alarms increment (PR #8 merged into this PR).

  • Base: yash-learner/develop (not ENG-831)
  • Squash of ohcnetwork/care_fe#16612 (ENG-831): patient home, visits, records, OTP shell
  • Opt-in reminders: Records → prescription → one bell in the header. Shared morning/noon/evening/night (all morning tablets ring together). Each medicine has a switch in that sheet. Alarms are not set automatically on login.
  • Dose log on the medicine: tap the medicine name to expand upcoming / taken / skipped / missed. Snoozed doses stay upcoming at the new time. Take / skip / snooze stay on the native lock screen.
  • Home Upcoming doses is collapsible; the count stays on the header.
  • Android 15 safe area: Capacitor adjustMarginsForEdgeToEdge: auto so the WebView is not drawn under the status bar (Pixel 6a). Prescription back control stays tappable. Requires npx cap sync android and an APK rebuild — Vite alone does not apply this.
  • Capacitor Android app in android/ — WebView starts at /patient/login
  • Exact alarms: Capacitor plugin Alarm.sync / Alarm.cancel. Same-minute medicines share one lock screen (Take all + per-row take/skip). Logout clears the native store.
  • Optional REACT_PATIENT_APK_URL for the web install button once you publish an APK

Everyday APK steps after a pull: npm install then npx cap sync android (see docs/android.md). cap add / apply-android-alarm.sh only if android/ is missing.

Windows + WSL: Keep Vite in WSL. Clone full care_fe onto NTFS and copy @capacitor/android from WSL. android/capacitor-cordova-android-plugins/ is committed. Delete leftover Capacitor splash.png if Gradle reports duplicate drawable/splash. AlarmPlugin.requestPermissions overrides Capacitor Plugin.requestPermissions (Kotlin 2). Ignore the Capacitor flatDir warning.

Requires:

Do not merge this to ohcnetwork yet.

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate the bug or test the new feature.
  • Update product documentation.
  • Ensure that UI text is placed in I18n files.
  • Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • Request peer reviews.
  • Complete QA on mobile devices.
  • Complete QA on desktop devices.
  • Add or update Playwright tests for related changes
Open in Web Open in Cursor 

Bring ohcnetwork#16612 (visits, records, prescriptions,
diagnostic reports) onto current yash-learner/develop as one commit
so Capacitor work can start from fork develop instead of ENG-831.

Co-authored-by: yash.topaz <yash.topaz@gmail.com>
@github-actions

Copy link
Copy Markdown

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

When window.Capacitor is present, POST /api/care_reminders/sync/ with the
OTP Bearer token and pass the calendar to Alarm.sync. Browser sessions
are unchanged. No extra patient tab or frontend federation plug.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@yash-learner
yash-learner marked this pull request as ready for review August 14, 2026 19:34
POST /sync/ now runs in the browser as well as Capacitor so Home can
list the same calendar the phone will ring. Until an APK exists, the
card explains that lock-screen alarms need the Android app.

Co-authored-by: yash.topaz <yash.topaz@gmail.com>
@cursor cursor Bot changed the title Patient portal (ENG-831 squash) for Capacitor alarms Patient portal + upcoming doses on Home Aug 14, 2026
The APK WebView loads /patient/login. Alarm.sync arms one exact alarm
per patient-minute slot so two morning tablets share a lock screen.
Take/skip still POST per occurrence. Logout clears the native store.
Cloud VM has no Android SDK; sideload from Android Studio in the morning.
@cursor cursor Bot changed the title Patient portal + upcoming doses on Home Patient portal APK + grouped Android dose alarms Aug 14, 2026
cap add and apply-android-alarm.sh are only if android/ is missing.
Gradle loads :capacitor-android from ../node_modules. Opening a copy under
StudioProjects makes that path miss even if Maven downloads succeeded.
Windows Studio cannot reliably open Gradle apps under \\wsl$. Clone the
whole frontend onto NTFS and npm install there; leave Django in WSL.
care_fe postinstall/Husky are Linux-oriented. Windows only needs
@capacitor/android so Gradle can resolve the project; Vite stays in WSL.
The fail-fast message used \\\\wsl$\\\\ inside a GString, which Gradle
could not parse. Use a plain concatenated string instead.
The module is generated by cap sync and was gitignored, so a Windows
clone without npm/cap sync failed on cordova.variables.gradle.
mergeDebugResources fails when both drawable/splash.png and splash.xml
exist. Keep the XML splash; delete the template PNG in the overlay script.
Kotlin 2 refuses to hide the superclass method; the JS Alarm API is unchanged.
Four day-part pickers PATCH /api/care_reminders/clocks/. The response
calendar updates Home and Alarm.sync so morning medicines share one ring.
Fix the clocks mutation type. Move day-part times into a Records
sheet with turn on, cancel this medicine, and cancel all.
Tap a medicine name for upcoming, taken, skipped, and missed. The Home
upcoming-doses card keeps a count on the header when collapsed.
Pixel 6a (targetSdk 35) draws edge-to-edge, so the prescription back
control sat under the system bar. Capacitor now insets the WebView on
API 35+, and the shell still pads with safe-area env() for iOS.
Day-part clocks stay patient-wide so two 7:00 tablets still share a lock
screen. The per-medicine bell made those times look independent and
overwrote the other tablet. Header bell, shared pickers, per-medicine
switches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants