feat(notifications): native OS notifications for @-mentions - #4019
Draft
adboio wants to merge 4 commits into
Draft
feat(notifications): native OS notifications for @-mentions#4019adboio wants to merge 4 commits into
adboio 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
Contributor
Author
|
CI note: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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