feat(notifications): per-user Do Not Disturb / quiet hours (LC-88) #177
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-88-dnd-quiet-hours"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Per-user Do Not Disturb (LC-88): suppress out-of-app notifications on a recurring schedule (quiet hours in the user's own timezone) or a manual timed pause.
How it works
0021addsdnd_schedule_json(recurring weekday/weekend windows + IANA timezone) anddnd_paused_until(manual pause instant) tousers. The pause auto-expires by being a past instant, so there is no sweeper.crate::dnd:is_suppressed(record, now)is true when a manual pause is in effect, otherwise whennowfalls in the schedule's weekday/weekend window for the user's local day. Windows whose end precedes their start span midnight (e.g. 22:00 to 07:00). An unknown timezone or a degenerate equal-time window fails open. 11 unit tests cover overnight wrap, weekday/weekend split, pause precedence + expiry, and instant parsing.last_digest_sent_at, so the misses roll into the next tick once DND lifts. In-app activity (LC-82) is never gated, only out-of-app delivery.Usergains a computeddnd_activeflag, surfaced through the existing red "do not disturb" avatar badge viaUser::effective_status(). Wired at the DM header (others see a peer's DND) and the user's own sidebar avatar.Acceptance criteria
Notes / deferred
is_suppressedgate means mobile push adds one call site when it lands.User). Message-row author avatars still show stored presence status; widening that projection is a follow-up.Test
just check,just test, andjust test-saasall green. Includes 11 newdndunit tests; auth migration0021added to all 20 test pool helpers (17 array-form, 3 verbose-form) per the test-maintenance notes in CLAUDE.md.🤖 Generated with Claude Code