You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(notifications): hide dead "Mark all read" button + add motion toggle
Two related fixes on the notification inbox UX:
1. "Mark all read" button was always a no-op
Opening the bell panel already calls markAllViewed() to clear the
badge (see togglePanel), so by the time the button was visible the
work was done. Clicking it re-ran the same call with no visible
effect — users thought it was broken. Gate the button on
unreadCount > 0 so it only appears when there's actually unread
content (new items arriving via SSE while the panel is open).
2. Motion notifications were un-silenceable
Add a per-org preferences gate (motion / camera transition / node
transition) stored via the existing Setting key/value table. The
gate lives inside create_notification() so every emitter respects
it without duplicating the check. Defaults match previous behaviour
("all on") so existing orgs see no change until an admin flips a
toggle off.
Motion events are still recorded to the database for incidents and
analytics — the gate only suppresses the bell-inbox row. Motion SSE
(dashboard toasts) is intentionally NOT gated: if we ever want to
mute those too it's a separate toggle.
UI: Settings > Notifications > "Motion detection" toggle. Backend
also exposes camera/node transition toggles (same pattern) ready
for a future UI addition.
Tests: 9 new backend tests covering the gate helper, the routes (GET,
POST, admin-only, round-trip), and the /api/settings aggregate. Full
suite: 164 passed (was 155).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments