Skip to content

Conversation

@gabriellsh
Copy link
Member

@gabriellsh gabriellsh commented Nov 13, 2025

Proposed changes (including videos or screenshots)

Issue(s)

VGA-67

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features
    • Added a new account preference: a toggle to enable/disable desktop notifications for incoming voice calls, with a translated label.
    • Preference is persisted and exposed so it can be set and respected by desktop notification behavior.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 13, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: a8697ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 42 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/i18n Minor
@rocket.chat/rest-typings Minor
@rocket.chat/ui-voip Major
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/api-client Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/http-router Patch
@rocket.chat/models Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-client Major
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/queue-worker Patch
@rocket.chat/presence-service Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/media-calls Patch
@rocket.chat/core-typings Minor
@rocket.chat/apps Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

Adds a new user preference "desktopNotificationVoiceCalls": UI toggle in account preferences, preference read in client hooks, server default setting, REST typing and end-to-end test inclusion, and an English translation key.

Changes

Cohort / File(s) Summary
UI Preferences Component
apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx
Adds a new ToggleSwitch bound to the form field desktopNotificationVoiceCalls with label Notification_Desktop_show_voice_calls.
Client preferences hook
apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts
Adds desktopNotificationVoiceCalls?: boolean to AccountPreferencesData and reads useUserPreference<boolean>('desktopNotificationVoiceCalls'), returning it from the hook.
Desktop notifications logic
packages/ui-voip/src/v2/useDesktopNotifications.ts
Reads desktopNotificationVoiceCalls preference and short-circuits notification dispatch when disabled; adds preference to effect dependencies.
Server settings
apps/meteor/server/settings/accounts.ts
Adds public boolean setting Accounts_Default_User_Preferences_desktopNotificationVoiceCalls with i18n label Notification_Desktop_show_voice_calls.
REST typings
packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts
Adds optional boolean desktopNotificationVoiceCalls to UsersSetPreferencesParamsPOST schema.
Internationalization
packages/i18n/src/locales/en.i18n.json
Adds translation key Notification_Desktop_show_voice_calls: "Show desktop notifications for voice calls".
Tests & Changeset
apps/meteor/tests/end-to-end/api/miscellaneous.ts, .changeset/spicy-radios-sleep.md
Includes desktopNotificationVoiceCalls in allUserPreferencesKeys expectations; adds changeset bump describing the new preference.

Sequence Diagram(s)

sequenceDiagram
  participant UI as Preferences UI
  participant Hook as useAccountPreferencesValues
  participant VOIP as useDesktopNotifications
  participant OS as Desktop Notification API

  UI->>Hook: toggle `desktopNotificationVoiceCalls` (set preference)
  Hook-->>VOIP: preference value (desktopNotificationVoiceCalls)
  alt preference enabled
    VOIP->>OS: dispatch notification for incoming voice call
    OS-->>VOIP: delivered / shown
  else preference disabled
    VOIP--xOS: abort dispatch (no notification)
    note right of VOIP: short-circuited by preference
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Review preference name consistency across UI, hook, server setting, REST schema, tests.
  • Verify effect dependency update and short-circuit behavior in useDesktopNotifications.
  • Confirm i18n key usage in UI matches server setting label.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • tassoevan
  • jeanfbrito

Poem

🐰 I hopped in code with tiny paws,

A toggle born without a pause.
Now voice calls whisper or they call,
As desktop bunnies guard them all.
🥕🔔✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a new user preference to enable/disable desktop voice call notifications.
Linked Issues check ✅ Passed The pull request implements a new user preference for voice call notifications as indicated by the linked issue VGA-67, with UI toggles, backend settings, API endpoints, and internationalization.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the new voice call notification preference feature across the UI, backend, API, and i18n layers with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/voiceNotificationPreference

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gabriellsh gabriellsh added this to the 7.13.0 milestone Nov 13, 2025
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.99%. Comparing base (c390d5c) to head (d9c6872).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37505      +/-   ##
===========================================
+ Coverage    68.98%   68.99%   +0.01%     
===========================================
  Files         3358     3358              
  Lines       114240   114241       +1     
  Branches     20537    20537              
===========================================
+ Hits         78803    78821      +18     
+ Misses       33345    33331      -14     
+ Partials      2092     2089       -3     
Flag Coverage Δ
e2e 57.44% <ø> (-0.04%) ⬇️
e2e-api 43.83% <100.00%> (+1.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

@gabriellsh gabriellsh marked this pull request as ready for review November 14, 2025 17:36
@gabriellsh gabriellsh requested review from a team as code owners November 14, 2025 17:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 67fa491 and d9c6872.

📒 Files selected for processing (6)
  • apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx (2 hunks)
  • apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts (3 hunks)
  • apps/meteor/server/settings/accounts.ts (1 hunks)
  • apps/meteor/tests/end-to-end/api/miscellaneous.ts (1 hunks)
  • packages/i18n/src/locales/en.i18n.json (1 hunks)
  • packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/server/settings/accounts.ts
📚 Learning: 2025-11-07T14:50:33.544Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37423
File: packages/i18n/src/locales/en.i18n.json:18-18
Timestamp: 2025-11-07T14:50:33.544Z
Learning: Rocket.Chat settings: in apps/meteor/ee/server/settings/abac.ts, the Abac_Cache_Decision_Time_Seconds setting uses invalidValue: 0 as the fallback when ABAC is unlicensed. With a valid license, admins can still set the value to 0 to intentionally disable the ABAC decision cache.

Applied to files:

  • apps/meteor/server/settings/accounts.ts
🧬 Code graph analysis (1)
apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts (1)
packages/ui-contexts/src/index.ts (1)
  • useUserPreference (83-83)
🔇 Additional comments (9)
apps/meteor/tests/end-to-end/api/miscellaneous.ts (1)

196-196: LGTM!

The test correctly includes the new desktopNotificationVoiceCalls preference key in the validation array for the /me endpoint response.

packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts (2)

57-57: LGTM!

The type definition correctly adds the optional boolean field for the new voice call notification preference.


269-272: LGTM!

The JSON schema correctly validates the new preference with the appropriate type and nullability settings, consistent with other boolean preferences.

apps/meteor/server/settings/accounts.ts (1)

460-464: LGTM!

The server setting is correctly configured with appropriate type, visibility, and default value. The setting enables desktop notifications for voice calls by default (opt-out model), and the translation key Notification_Desktop_show_voice_calls is properly defined in the i18n files.

apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx (2)

97-97: LGTM!

The ID declaration follows the established pattern used for other form fields in this component.


155-166: All verifications passed—implementation is complete and correct.

  • Translation key Notification_Desktop_show_voice_calls exists at packages/i18n/src/locales/en.i18n.json:3765
  • Server preference Accounts_Default_User_Preferences_desktopNotificationVoiceCalls configured at apps/meteor/server/settings/accounts.ts:460
  • API type definition and schema validation properly updated at packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts:57 and 269-271

The toggle is fully integrated with all backend dependencies properly aligned.

apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts (3)

41-41: LGTM!

The type definition is correct and consistent with other boolean preferences in the interface.


81-81: LGTM!

The preference retrieval correctly uses useUserPreference with proper typing and matches the field name used in the form.


113-113: LGTM!

The new preference is correctly included in the returned object, completing the data flow from user preference to form.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.97%. Comparing base (44ca3b1) to head (a8697ac).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37505      +/-   ##
===========================================
- Coverage    68.98%   68.97%   -0.01%     
===========================================
  Files         3359     3359              
  Lines       114213   114214       +1     
  Branches     20535    20535              
===========================================
- Hits         78788    78780       -8     
- Misses       33334    33344      +10     
+ Partials      2091     2090       -1     
Flag Coverage Δ
e2e 57.41% <ø> (-0.04%) ⬇️
e2e-api 42.92% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

@gabriellsh gabriellsh marked this pull request as draft November 18, 2025 14:31
@gabriellsh gabriellsh marked this pull request as ready for review November 19, 2025 17:26
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/ui-voip/src/v2/useDesktopNotifications.ts (1)

26-26: LGTM! Optional: Consider explicit type parameter.

The hook call correctly reads the new preference. For enhanced type safety and consistency with usage patterns elsewhere in the codebase, you could optionally add an explicit type parameter:

-	const desktopNotificationsEnabled = useUserPreference('desktopNotificationVoiceCalls');
+	const desktopNotificationsEnabled = useUserPreference<boolean>('desktopNotificationVoiceCalls');
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d9c6872 and a8697ac.

📒 Files selected for processing (3)
  • .changeset/spicy-radios-sleep.md (1 hunks)
  • packages/i18n/src/locales/en.i18n.json (1 hunks)
  • packages/ui-voip/src/v2/useDesktopNotifications.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/i18n/src/locales/en.i18n.json
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37505
File: packages/i18n/src/locales/en.i18n.json:3765-3765
Timestamp: 2025-11-17T22:38:48.631Z
Learning: Rocket.Chat i18n copy: Keep sentence case for the value of "Notification_Desktop_show_voice_calls" in packages/i18n/src/locales/en.i18n.json (“Show desktop notifications for voice calls”) per design directive; do not change to Title Case even if nearby labels differ.
📚 Learning: 2025-11-17T22:38:48.631Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37505
File: packages/i18n/src/locales/en.i18n.json:3765-3765
Timestamp: 2025-11-17T22:38:48.631Z
Learning: Rocket.Chat i18n copy: Keep sentence case for the value of "Notification_Desktop_show_voice_calls" in packages/i18n/src/locales/en.i18n.json (“Show desktop notifications for voice calls”) per design directive; do not change to Title Case even if nearby labels differ.

Applied to files:

  • .changeset/spicy-radios-sleep.md
  • packages/ui-voip/src/v2/useDesktopNotifications.ts
📚 Learning: 2025-11-19T12:32:29.673Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.673Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

Applied to files:

  • .changeset/spicy-radios-sleep.md
📚 Learning: 2025-11-17T14:30:36.271Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 37491
File: packages/desktop-api/src/index.ts:17-27
Timestamp: 2025-11-17T14:30:36.271Z
Learning: In the Rocket.Chat desktop API (`packages/desktop-api/src/index.ts`), the `CustomNotificationOptions` type has an optional `id` field by design. Custom notifications dispatched without an ID cannot be closed programmatically using `closeCustomNotification`, and this is intentional.

Applied to files:

  • .changeset/spicy-radios-sleep.md
  • packages/ui-voip/src/v2/useDesktopNotifications.ts
🧬 Code graph analysis (1)
packages/ui-voip/src/v2/useDesktopNotifications.ts (1)
packages/ui-contexts/src/index.ts (1)
  • useUserPreference (83-83)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (4)
packages/ui-voip/src/v2/useDesktopNotifications.ts (3)

1-1: LGTM!

The import is correct and aligns with the pattern used elsewhere in the codebase for reading user preferences.


30-32: LGTM!

The early return correctly prevents desktop notifications when the preference is disabled. The placement before the window.RocketChatDesktop checks is optimal and avoids unnecessary work.


80-80: LGTM!

The dependency array correctly includes desktopNotificationsEnabled, ensuring the effect re-runs when the preference changes. All dependencies are properly tracked.

.changeset/spicy-radios-sleep.md (1)

1-8: LGTM!

The changeset correctly documents the feature addition with appropriate minor version bumps for all affected packages. The description clearly summarizes the new user preference functionality.

@github-actions
Copy link
Contributor

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 367MiB 355MiB +12MiB
omnichannel-transcript-service 141MiB 141MiB -1.3KiB
queue-worker-service 141MiB 141MiB -414B
ddp-streamer-service 127MiB 127MiB -1.5KiB
account-service 114MiB 114MiB -2.8KiB
stream-hub-service 111MiB 111MiB -336B
authorization-service 111MiB 111MiB -358B
presence-service 111MiB 111MiB -35B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 16:53", "11/19 17:52 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.14]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.14]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.36]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 5 days):

  • 📊 Average: 1.4GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37505
  • Baseline: develop
  • Timestamp: 2025-11-19 17:52:38 UTC
  • Historical data points: 5

Updated: Wed, 19 Nov 2025 17:52:38 GMT

@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Nov 19, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 19, 2025
@kodiakhq kodiakhq bot merged commit 035e0c7 into develop Nov 19, 2025
90 of 93 checks passed
@kodiakhq kodiakhq bot deleted the feat/voiceNotificationPreference branch November 19, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants