Skip to content

feat(settings): send a test notification, and make the notifications switch real - #355

Open
kYem wants to merge 1 commit into
mainfrom
kes/eng-119-reminders-a-send-test-notification-button-so-people-can-see
Open

kYem wants to merge 1 commit into
mainfrom
kes/eng-119-reminders-a-send-test-notification-button-so-people-can-see

Conversation

@kYem

@kYem kYem commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Fixes ENG-119

What

Send test under Settings → Goals & alerts → Notifications. It sends a notification with the exact shape a reminder has — same title, Done / Snooze buttons, sticky — so what you see is what a real one will look like. Before sending it asks the notifier for its permission and, on denied, says where to fix it instead of sending. After sending it hedges: "Nothing appeared? Check your system's notification settings — the browser or app itself may be muted", because macOS can mute Chrome without Chrome knowing. The id is reminder-test, which the worker's click/button handlers already resolve to dismiss-and-clear, so Done / Snooze on the test just close it — no worker change.

The Notifications switch now does something. enableNotifications was read by nothing; reminders and Pomodoro notified regardless. The worker fire path, the page fallback (fireDueReminders where there is no background host) and the Pomodoro completion now honour it. A failed settings read fails open — a storage hiccup must not silence reminders. Recurrence still advances and notified is still stamped when the switch is off; only the OS notification is withheld, in-app toasts are unaffected.

Port: Notifier.permission()'granted' | 'denied' | 'unknown'. Chrome → getPermissionLevel(); web → Notification.permission; Tauri → isPermissionGranted() (not-yet-granted reports unknown, since the next notify prompts).

Dropped from the ticket: the per-reminder Preview — the Settings button already shows the shape.

Review

The one thing no test can check: what the notification actually looks like on your screen. Load the branch build, Settings → search "test notification" → Send test.

Verification

  • lint, type-check 12/12; shared 460 / app 2062 / macOS 196 / extension 209 tests
  • e2e/test-notification.spec.ts: the built extension, Settings search → Send test → a reminder-test entry in chrome.notifications.getAll() — green
  • Unit: the three callers skip notify() when the switch is off and still advance state; fail-open on an unreadable read; both notifier permission mappings; the row's off / blocked / sent / failed / filtered states; the section surfaces for a "test notification" search

…switch real

Settings → Goals & alerts gains a Send test button under the Notifications
switch. It sends a notification shaped exactly like a reminder through the
platform notifier, checks the permission first and says where to fix a
block, and hedges after sending because an OS-level mute of the browser is
invisible to the extension. Its id is reminder-test, which the worker's
handlers already resolve to dismiss.

The Notifications switch was read by nothing. The worker fire path, the page
fallback and the Pomodoro completion now honour it via getSettings (field-wise
defaults, fail-open on a rejection). The Notifier port gains permission() for
all hosts. Four review rounds folded in.

Fixes ENG-119
@kYem
kYem force-pushed the kes/eng-119-reminders-a-send-test-notification-button-so-people-can-see branch from d8189f5 to 2c21721 Compare September 20, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant