From 5a0f70fcedd7a02a159de1819082981a6fd6244f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 14 Sep 2026 17:42:04 -0700 Subject: A reply or a mention on nostr can buzz your phone. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The push notifier now watches kind 1 for the user's pubkey beside DMs and zap receipts, and pushes who, what, and an excerpt. The worker shows "New reply to your post" or "You were mentioned" with the text, and a tap lands in the Notifications list — as ?open=notifs when a window has to be opened, or as a worker message when one already is. It has its own switch, "Replies and mentions on nostr", in Settings → Notifications, on by default like payments and DMs. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01QYJfZ4A1TDCEY4Foq3CApR --- build.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build.js') diff --git a/build.js b/build.js index ae9aee9..0f2373e 100644 --- a/build.js +++ b/build.js @@ -219,11 +219,15 @@ const SW_WAKE_ONLY = `self.addEventListener('push', (e) => { }); self.addEventListener('notificationclick', (e) => { e.notification.close(); + const d = (e.notification && e.notification.data) || {}; e.waitUntil((async () => { const all = await self.clients.matchAll({ type: 'window', includeUncontrolled: true }); const open = all.find((c) => 'focus' in c); - if (open) return open.focus(); - if (self.clients.openWindow) return self.clients.openWindow('./'); + if (open) { + if (d.view) { try { open.postMessage({ type: 'open', view: d.view }); } catch (_) {} } + return open.focus(); + } + if (self.clients.openWindow) return self.clients.openWindow(d.url || './'); })()); });`; -- cgit v1.2.3