Reminders: global repeat toggle + per-dose "Ikke forstyrr"

Two ways to stop the every-10-min nag, per feature request:

- A global "Gjenta påminnelser" switch in Settings. Off → a due dose
  alerts once and goes quiet; only the automatic re-nag chain is gated,
  so an explicit "Utsett 15 min" still gives one more reminder. The gate
  sits at the three automatic arm points (fireOccurrence, escalate
  re-arm, armAll resume-after-reboot), never on Snooze.

- An "Ikke forstyrr" action that appears from the second reminder on
  (nagCount >= 1). It stops nagging this one dose but leaves it PENDING
  so it can still be taken later — distinct from Skip. Implemented by
  jumping to the existing terminal state (nagCount = NAG_CAP) rather than
  a new column, so it needs no migration and survives reboot for free
  (armAll re-arms only nagCount < cap).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-06-29 14:16:16 +02:00
commit 778a6aec27
7 changed files with 82 additions and 3 deletions

View file

@ -15,6 +15,7 @@ import no.naiv.meddetsamme.domain.DoseActions
* - Taken TAKEN, decrement inventory by the *logged* amount, stop escalating.
* - Snooze SNOOZED, next nag in 15 min, keeps escalating (and counting) after.
* - Skip SKIPPED, stop escalating, no inventory change.
* - Mute "Ikke forstyrr": stop escalating, dose stays unresolved.
*/
class DoseActionReceiver : BroadcastReceiver() {
@ -22,6 +23,7 @@ class DoseActionReceiver : BroadcastReceiver() {
const val ACTION_TAKEN = "no.naiv.meddetsamme.action.TAKEN"
const val ACTION_SNOOZE = "no.naiv.meddetsamme.action.SNOOZE"
const val ACTION_SKIP = "no.naiv.meddetsamme.action.SKIP"
const val ACTION_MUTE = "no.naiv.meddetsamme.action.MUTE"
const val EXTRA_LOG_ID = "logId"
}
@ -45,6 +47,7 @@ class DoseActionReceiver : BroadcastReceiver() {
ACTION_TAKEN -> actions.take(logId)
ACTION_SNOOZE -> actions.snooze(logId)
ACTION_SKIP -> actions.skip(logId)
ACTION_MUTE -> actions.mute(logId)
}
}
}