Skip to content

feat: browser push notifications for assignment, reopen and mentions - #3755

Closed
Shllokkk wants to merge 2 commits into
frappe:developfrom
Shllokkk:browser-push-notifications
Closed

feat: browser push notifications for assignment, reopen and mentions#3755
Shllokkk wants to merge 2 commits into
frappe:developfrom
Shllokkk:browser-push-notifications

Conversation

@Shllokkk

@Shllokkk Shllokkk commented Sep 4, 2026

Copy link
Copy Markdown

Closes #2942

What

Opt-in browser push notifications for Helpdesk agents, so they are alerted to new ticket activity even when the Helpdesk tab is not focused (e.g. they are working in another tab, window or app).

Triggers

A push is raised for the recipient agent on:

  • Assignment — a ticket is assigned to the agent
  • Reopen — an assigned ticket is reopened (e.g. the customer replies)
  • Mention — the agent is @-mentioned in a ticket comment

Comment emoji-reactions are intentionally not pushed (low signal).

Opt-in

Agents turn it on from a bell button in the Notifications panel header, which requests browser permission. Nothing fires until permission is granted.

Suppression

To avoid double-cueing, a push is skipped when the agent is already looking at a ticket list whose active view would already show the ticket — i.e. the view filters on assignee = me and an open status. This works for the standard "Recently Assigned Tickets" view and for any private/custom view with those filters; all other filters are ignored. Mentions always fire (a mention may be on a ticket the agent is not assigned to).

Architecture

  • BackendHD Notification.after_insert already runs for every ticket event, so it is the single seam. It now also calls notify_via_push(), which publishes a helpdesk:new-notification realtime event scoped to the recipient (user=user_to, after_commit=True). should_push() limits it to assignment / mention / reopen — a reopen is a Reaction with no reference_comment, while an emoji-reaction has one, which cleanly separates the two.
  • Frontend — a usePushNotifications composable subscribes once to helpdesk:new-notification, builds a translatable title, shows a Notification, and routes to the ticket on click. The opt-in state (isSupported / permission / enable) is shared with the Notifications panel header. The realtime payload carries only notification_type, user_from and reference_ticket.

@mergify

mergify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge.

The previous finding is fixed, and no new actionable regressions were found.

Reviews (2): Last reviewed commit: "fix: require explicit open-status filter..." | Re-trigger Greptile

Comment thread desk/src/composables/usePushNotifications.ts
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.36%. Comparing base (c3ae467) to head (81515bc).
⚠️ Report is 45 commits behind head on develop.

Files with missing lines Patch % Lines
...elpdesk/doctype/hd_notification/hd_notification.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3755      +/-   ##
===========================================
+ Coverage    73.76%   74.36%   +0.59%     
===========================================
  Files          148      149       +1     
  Lines        10841    11100     +259     
===========================================
+ Hits          7997     8254     +257     
- Misses        2844     2846       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aerodeval

aerodeval commented Sep 4, 2026

Copy link
Copy Markdown
Member

@Shllokkk #3700 notifications in HD are about to be refactored removing HD notification entirely so not sure if we will be going ahead with this approach. We will be working on it once this scafolding is set

@Shllokkk

Shllokkk commented Sep 4, 2026

Copy link
Copy Markdown
Author

@Shllokkk #3700 notifications in HD are about to be refactored removing HD notification entirely so not sure if we will be going ahead with this approach. We will be working on it once this scafolding is set

ahh i see.... lmk once the refactor is done. would love push notifs this time around. would it support this by design?

@RitvikSardana

Copy link
Copy Markdown
Member

Please write the description properly, it is very verbose

@RitvikSardana

RitvikSardana commented Sep 7, 2026

Copy link
Copy Markdown
Member

Also we are refactoring notifications doctype to move from HD Notification to Notification (Fw)
via => #3700

You can raise the PR once the refactor is done

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.

Push Notifications on Browsers on HD Ticket Events

4 participants