fix(alarms): settle and show the alarm-set notice where it can't be lost

The repeat-day settle ran on the editor's scope, so leaving mid-settle
needed a flush that a cleared scope could still race. The announcer now
owns the settle on the application scope. Screens show the notice only
while resumed, so a cross-fade never shows it twice and a backgrounded
app does not use it up unseen. The editor shows only notices about its
own alarm, since the sentence names none.

Deleting an alarm, or the AlarmClock chooser dismissing it, takes its
notice back. Freshness is measured on the monotonic clock, one instant
is used for both ends of the countdown, and an identical countdown
keeps the standing notice instead of flickering it.

Refs #19
This commit is contained in:
makiolaj committed 2026-10-21 19:10:42 +02:00
1 parent 207475ef37
commit fa5ce55503
8 files changed
+220 -84

No files matched your search

+7 -2
View File
@@ -1126,8 +1126,13 @@ at once, but waits for repeat-day taps to settle for a second, so Mon–Fri is
one snackbar rather than five. `AlarmSetAnnouncer` is an app-wide singleton
holding the notice as *state* until a screen has shown it to the end: pick →
OK → back disposes the editor's snackbar a moment after it appears, and the
list underneath picks the same notice up. A notice older than ten seconds is
dropped unshown rather than shown with a stale countdown.
list underneath picks the same notice up. The settle runs on the application
scope, so leaving the editor mid-settle still announces; a screen shows the
notice only while resumed, so a cross-fade never shows it twice; the editor
shows only notices about its own alarm; deleting an alarm, or the `AlarmClock`
chooser dismissing it, takes its notice back. A notice older than ten seconds
on the monotonic clock is dropped unshown rather than shown with a stale
countdown.
`upcoming(refresh: Flow<Unit>)` takes its **re-read cadence as a parameter**.
The resolver needs a `now`, and `upcoming` reads one inside a `combine` of the