Skip to content

Conversation

@gabriellsh
Copy link
Member

@gabriellsh gabriellsh commented Dec 24, 2025

Proposed changes (including videos or screenshots)

Issue(s)

VGA-133

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features
    • Call history UI is state-aware: Call buttons and contextual menu items disable automatically when calling isn't permitted (unauthorized, unlicensed, or during active calls) and update in real time.
    • Disabled voice-call actions show an explanatory tooltip/title ("Call in progress").
  • Documentation
    • Added user-facing text: "Call in progress".
  • Chores
    • Story/demo updated to show a disabled voice-call scenario.

✏️ Tip: You can customize this high-level summary in your review settings.

@gabriellsh gabriellsh added this to the 8.0.0 milestone Dec 24, 2025
@gabriellsh gabriellsh requested a review from a team as a code owner December 24, 2025 16:13
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 24, 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 Dec 24, 2025

⚠️ No Changeset found

Latest commit: d98d8a5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

Walkthrough

Flows a MediaCallState (alias for MediaCallExternalState) through the ui-voip context into call-history and contextual-bar UIs; adds isCallingBlocked(state) and uses it to disable voice-call actions and show a "Call in progress" tooltip when calls are not allowed.

Changes

Cohort / File(s) Summary
UI-Voip Context & Exports
packages/ui-voip/src/context/MediaCallContext.ts, packages/ui-voip/src/context/index.ts, packages/ui-voip/src/index.ts
Add MediaCallExternalState (exported as MediaCallState) and new isCallingBlocked(state) helper; re-export isCallingBlocked and extend public type exports to include MediaCallState.
Call History Components (Meteor client)
apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx, apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx, apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
Read media-call state via useMediaCallContext; gate widget toggling for unauthorized/unlicensed; mark voiceCall items disabled when isCallingBlocked(state) and add Call_in_progress tooltip.
Call History Actions & Contextual Bar (ui-voip)
packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx, packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx, packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
Thread state: MediaCallState into getItems and components; disable header Call button and contextual voiceCall items when isCallingBlocked(state) is true and set title/tooltip to localized Call_in_progress; add story demonstrating disabled voiceCall.
Internationalization
packages/i18n/src/locales/en.i18n.json
Add Call_in_progress translation key with value "Call in progress".

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Context as MediaCallContext
    participant Component as CallHistory / ContextualBar
    participant Actions as getItems
    participant UI as Rendered UI

    rect rgba(200,230,201,0.4)
    Context->>Component: provide current MediaCallState
    end

    Component->>Actions: getItems(state)
    Actions->>Actions: evaluate isCallingBlocked(state)
    alt not blocked (state == "new" or "closed")
        Actions->>UI: return enabled voiceCall item
    else blocked (unauthorized / unlicensed / ongoing)
        Actions->>UI: return disabled voiceCall item with tooltip "Call in progress"
    end
    UI->>User: render button/menu with disabled/tooltip
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • tassoevan
  • ggazzo

Poem

🐇 I hop through context, soft and quick,
When calls are busy I keep them slick,
Buttons hush with a quiet line,
"Call in progress" — carrot time,
I wiggle whiskers — all is fine.

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 describes the main regression being fixed: disabling the voice call action when a call is already in progress.
Linked Issues check ✅ Passed The changes comprehensively address VGA-133 by implementing state-based gating to disable the voice call action when calling is blocked or a call is in progress.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the regression: adding state tracking, disabling actions appropriately, and adding required translations.
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 fix/callBackAction

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.

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: 2

🧹 Nitpick comments (1)
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx (1)

41-55: Consider extracting shared action mapping logic.

The getItems function and the logic for computing disabled state and tooltip are duplicated between CallHistoryRowInternalUser.tsx and CallHistoryRowExternalUser.tsx. Consider extracting this into a shared utility function to reduce duplication and ensure consistency.

📜 Review details

Configuration used: Organization 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 0dddad6 and d579698.

📒 Files selected for processing (9)
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
  • apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
  • packages/i18n/src/locales/en.i18n.json
  • packages/ui-voip/src/context/MediaCallContext.ts
  • packages/ui-voip/src/context/index.ts
  • packages/ui-voip/src/index.ts
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/ui-voip/src/context/MediaCallContext.ts
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
  • apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
  • packages/ui-voip/src/context/index.ts
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx
  • packages/ui-voip/src/index.ts
🧠 Learnings (6)
📓 Common learnings
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:31.688Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.
📚 Learning: 2025-12-18T15:18:31.688Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:31.688Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.

Applied to files:

  • packages/ui-voip/src/context/MediaCallContext.ts
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
  • apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
  • packages/ui-voip/src/context/index.ts
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx
  • packages/ui-voip/src/index.ts
📚 Learning: 2025-11-19T18:20:37.116Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: apps/meteor/server/services/media-call/service.ts:141-141
Timestamp: 2025-11-19T18:20:37.116Z
Learning: In apps/meteor/server/services/media-call/service.ts, the sendHistoryMessage method should use call.caller.id or call.createdBy?.id as the message author, not call.transferredBy?.id. Even for transferred calls, the message should appear in the DM between the two users who are calling each other, not sent by the person who transferred the call.

Applied to files:

  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
  • apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.

Applied to files:

  • apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
  • packages/i18n/src/locales/en.i18n.json
📚 Learning: 2025-11-19T12:32:29.696Z
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.696Z
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:

  • packages/i18n/src/locales/en.i18n.json
📚 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:

  • packages/i18n/src/locales/en.i18n.json
🧬 Code graph analysis (5)
packages/ui-voip/src/context/MediaCallContext.ts (1)
packages/ui-voip/src/context/index.ts (2)
  • MediaCallExternalState (2-2)
  • isAbleToMakeCall (3-3)
packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx (1)
packages/ui-voip/src/context/MediaCallContext.ts (2)
  • useMediaCallExternalContext (141-152)
  • isAbleToMakeCall (124-126)
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx (2)
packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx (1)
  • HistoryActionCallbacks (11-13)
packages/ui-voip/src/context/MediaCallContext.ts (2)
  • isAbleToMakeCall (124-126)
  • useMediaCallContext (129-138)
apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (1)
packages/ui-voip/src/context/MediaCallContext.ts (1)
  • useMediaCallContext (129-138)
apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx (1)
packages/ui-voip/src/context/MediaCallContext.ts (2)
  • useMediaCallContext (129-138)
  • isAbleToMakeCall (124-126)
⏰ 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). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (12)
packages/ui-voip/src/context/MediaCallContext.ts (1)

122-126: LGTM! Clean implementation of call gating logic.

The type definition and utility function correctly implement the call state gating mechanism. The logic properly prevents new calls when:

  • A call is already in progress ('calling', 'ringing', 'ongoing')
  • User lacks authorization ('unauthorized')
  • Workspace lacks license ('unlicensed')

The implementation is type-safe, concise, and aligns with the PR objective to disable voice call actions when a call is active. Consuming components in CallHistoryContextualbar.tsx and CallHistoryActions.tsx correctly use isAbleToMakeCall to disable call actions with appropriate "Call in progress" tooltip feedback.

packages/i18n/src/locales/en.i18n.json (1)

979-979: New Call_in_progress string looks consistent and ready to use

Key naming, placement near other call-related strings, and the value “Call in progress” all align with existing i18n conventions and nearby entries. No changes needed.

apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (1)

32-49: State-aware gating for voiceCall action looks correct.

The destructured state from useMediaCallContext and the additional guards for unauthorized/unlicensed states properly prevent initiating a call when not permitted or when a call is already in progress.

apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx (1)

70-83: State integration correctly enables call capability awareness.

The component now retrieves state from the context and passes it to getItems, enabling the UI to reflect call availability based on the current media call state.

apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx (1)

15-35: State-driven action gating correctly prevents concurrent calls.

The component properly retrieves state, checks for unauthorized/unlicensed conditions, and uses isAbleToMakeCall to disable the voice call action with an appropriate tooltip when a call is in progress. The dependency array correctly includes state.

packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx (2)

69-77: State propagation to actions enables coordinated call capability UI.

The contextual bar correctly retrieves state from the external context and passes it to CallHistoryActions, ensuring the header actions reflect call availability.


123-131: Call button correctly disabled when call is in progress.

The button's disabled and title props properly use isAbleToMakeCall(state) to prevent initiating a new call when one is already active, with a clear tooltip explanation.

packages/ui-voip/src/index.ts (1)

3-4: Export refactoring improves API clarity.

Separating type exports and aliasing useMediaCallExternalContext as useMediaCallContext provides a cleaner public API surface while maintaining backward compatibility.

packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx (3)

6-8: State imports correctly positioned for internal package usage.

Importing from the local context module is appropriate for internal package files and maintains proper module boundaries.


37-51: Action item generation correctly integrates call state.

The getItems function properly computes disabled state for the voiceCall action based on isAbleToMakeCall(state) and attaches a localized tooltip when the action is unavailable.


53-56: State propagation completes the call capability flow.

The component accepts state as a prop and correctly forwards it to getItems, enabling state-aware action rendering throughout the call history UI.

packages/ui-voip/src/context/index.ts (1)

2-3: Public API extended with call state utilities.

Adding MediaCallState type alias and isAbleToMakeCall to the public exports enables consuming code to implement state-aware call capability checks consistently.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 9 files

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.64%. Comparing base (356ad51) to head (d98d8a5).
⚠️ Report is 2 commits behind head on release-8.0.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.0.0   #37967      +/-   ##
=================================================
+ Coverage          70.63%   70.64%   +0.01%     
=================================================
  Files               3145     3145              
  Lines             108710   108724      +14     
  Branches           19519    19576      +57     
=================================================
+ Hits               76782    76813      +31     
+ Misses             29922    29916       -6     
+ Partials            2006     1995      -11     
Flag Coverage Δ
unit 71.79% <100.00%> (+0.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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.1GiB 1.1GiB +11MiB
rocketchat 355MiB 345MiB +11MiB
omnichannel-transcript-service 132MiB 132MiB +4.5KiB
queue-worker-service 132MiB 132MiB -993B
ddp-streamer-service 126MiB 126MiB +3.4KiB
account-service 113MiB 113MiB +3.4KiB
authorization-service 111MiB 111MiB -20KiB
presence-service 111MiB 111MiB +13KiB

📊 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/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 16:30 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 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, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 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, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 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.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 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.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
Loading

Statistics (last 30 days):

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

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

  • Tag: pr-37967
  • Baseline: develop
  • Timestamp: 2025-12-29 16:30:59 UTC
  • Historical data points: 30

Updated: Mon, 29 Dec 2025 16:31:00 GMT

@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Dec 26, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 26, 2025
@kodiakhq kodiakhq bot merged commit df2a23b into release-8.0.0 Dec 29, 2025
8 of 10 checks passed
@kodiakhq kodiakhq bot deleted the fix/callBackAction branch December 29, 2025 19:25
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/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx (1)

123-131: Implementation correctly prevents calls during active calls.

The Call button is appropriately disabled when isCallingBlocked(state) returns true, and the tooltip provides clear feedback to users. This addresses the PR objective.

Optional: Memoize the blocked state to avoid duplicate calls

While the performance impact is negligible, you could extract the result to avoid calling isCallingBlocked(state) twice:

 const { voiceCall, directMessage } = actions;
 const { duration, callId, direction, startedAt } = data;
 const { state } = useMediaCallExternalContext();
+const callBlocked = isCallingBlocked(state);

 const date = useFullStartDate(startedAt);
 return (
   <ContextualbarDialog onClose={onClose}>
     ...
     {voiceCall && (
       <Button
         success
         onClick={voiceCall}
-        disabled={isCallingBlocked(state)}
-        title={isCallingBlocked(state) ? t('Call_in_progress') : undefined}
+        disabled={callBlocked}
+        title={callBlocked ? t('Call_in_progress') : undefined}
       >
📜 Review details

Configuration used: Organization 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 bf4a759 and d98d8a5.

📒 Files selected for processing (1)
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-18T15:18:31.688Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:31.688Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.

Applied to files:

  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
📚 Learning: 2025-11-19T18:20:37.116Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: apps/meteor/server/services/media-call/service.ts:141-141
Timestamp: 2025-11-19T18:20:37.116Z
Learning: In apps/meteor/server/services/media-call/service.ts, the sendHistoryMessage method should use call.caller.id or call.createdBy?.id as the message author, not call.transferredBy?.id. Even for transferred calls, the message should appear in the DM between the two users who are calling each other, not sent by the person who transferred the call.

Applied to files:

  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
🧬 Code graph analysis (1)
packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx (1)
packages/ui-voip/src/context/MediaCallContext.ts (2)
  • useMediaCallExternalContext (141-152)
  • isCallingBlocked (124-126)
⏰ 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 (2)
packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx (2)

21-22: LGTM!

The imports are correctly added to support call state checking.


69-69: No issues found. The state destructure from useMediaCallExternalContext() correctly receives type MediaCallExternalState, and isCallingBlocked() properly handles all possible state values: State ('closed', 'new', 'calling', 'ringing', 'ongoing'), 'unauthorized', and 'unlicensed'. All context return types have compatible state properties, and the logic blocks calls as expected for all non-'new' and non-'closed' states.

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.

3 participants