feat(notifications): native OS notifications for @-mentions - #4019
feat(notifications): native OS notifications for @-mentions#4019adboio wants to merge 4 commits into
Conversation
Poll the task-mentions index from a boot contribution and route new mentions of the current user through the NotificationBus, so they get the same suppression, settings gating, completion sound, and click-through-to-task behavior as agent activity notifications. Generated-By: PostHog Code Task-Id: d77f2cfe-cdea-4bc9-af8a-1d3eea39da59
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
… query cache Watch the channels UI's existing task-mentions query instead of running a second poll: one fetch path, one source of truth. Notifications now live where the spaces layout lives, which is the surface the product is converging on. Generated-By: PostHog Code Task-Id: d77f2cfe-cdea-4bc9-af8a-1d3eea39da59
NotificationDescriptor gains muteSound (skip the completion sound and native chime) and notify() reports the routed channel, so the mention batch mutes every notification after its first delivered one — three mentions in a poll window ring once instead of three times. A suppressed mention (its task is being viewed) hands the sound to the next one. Generated-By: PostHog Code Task-Id: d77f2cfe-cdea-4bc9-af8a-1d3eea39da59
A batch of new mentions is now a single notification — one banner, one
sound — instead of individual notifications sharing a sound. Same-task
batches keep click-through ("Charles mentioned you 2 times in ..."),
mixed-task batches fall back to a count. Reverts the muteSound bus
machinery, which this makes unnecessary.
Generated-By: PostHog Code
Task-Id: d77f2cfe-cdea-4bc9-af8a-1d3eea39da59
|
CI note: the |
|
Hey @adboio, we've migrated this repo into the PostHog/posthog monorepo, so this PR needs to be recreated there. Easiest path: check out the monorepo and run the Shout if you get stuck. |
Problem
When a teammate @-mentions you in a task thread, nothing surfaces outside the Activity feed — and there, one-row-per-task projection means the mention row is often overwritten by the next agent event before it's seen. Agent events (completed, needs input) already fire native desktop notifications; human mentions, the highest-signal event in a thread, do not.
Why
Raised while dogfooding channels: mentions from teammates were effectively invisible unless you happened to be watching the Activity page at the right moment.
Changes
MentionNotificationsContributionwatches the task-mentions query the channels UI already polls (useMentionActivity) and dispatches new mentions through the existingNotificationBus, so mentions get the same tiering (suppressed while viewing the task / toast while focused / native + sound otherwise), notification settings gating, and click-through-to-task as agent activity. No new fetch path — one poll, one source of truth; notifications live where the spaces layout lives.baselineMentionWatch/advanceMentionWatch) lives in@posthog/core/canvas/mentionNotifications: the first page after boot or login baselines silently (the backlog isn't news), updates dedupe by message id, and a batch of several new mentions collapses into a single notification — one banner, one sound (same-task batches keep click-through to the task; mixed-task batches fall back to a count), and the auth-scoped query's removal on logout resets the baseline so another account's backlog stays silent.How did you test this?
biome lint packages/coreshows zeronoRestrictedImports.Automatic notifications
Created with PostHog Code