Skip to content

Conversation

@gabriellsh
Copy link
Member

@gabriellsh gabriellsh commented Oct 6, 2025

Proposed changes (including videos or screenshots)

Issue(s)

VGA-20

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features
    • NavBar now shows a single Voice Call action in the controls menu when calling is available for one-click call initiation.
    • Voice Call appears as its own section alongside Omnichannel items and is hidden when unavailable to keep the menu clean.
    • Preserves existing Omnichannel behavior and overall menu rendering when calling is disabled.

@gabriellsh gabriellsh requested a review from a team as a code owner October 6, 2025 23:05
@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: 86df46a

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 6, 2025

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

@gabriellsh gabriellsh added this to the 7.12.0 milestone Oct 6, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Walkthrough

Replaces prior VoIP multi-item handling with a single optional callItem prop propagated from data layer via useMediaCallAction; removes voipItems usage and updates menu construction to render a Voice_Call section only when callItem is present.

Changes

Cohort / File(s) Summary
Menu: optional call item & Voice_Call section
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx
Removes voipItems from props, adds optional callItem?: GenericMenuItemProps, and constructs a Voice_Call section from callItem (one-item array when present). Sections list still includes Omnichannel and is filtered before rendering.
WithCall: props simplified
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx
Removes voipItems from component signature/props; NavBarControlsMenu is invoked without voipItems. Prop type for menu now includes callItem (optional).
Data wiring: derive callItem from media call action
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx
Imports useMediaCallAction, derives callAction, builds a single callItem when available (id, icon, content, onClick -> callAction.action()), removes generation of voipItems, and passes callItem into menu/with-call components. Adjusts pressed-state logic to exclude previous VOIP-specific pressed state.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Data as NavBarControlsWithData
  participant Hook as useMediaCallAction()
  participant WithCall as NavBarControlsWithCall
  participant Menu as NavBarControlsMenu
  participant Generic as GenericMenu

  User->>Data: open nav controls
  Data->>Hook: request callAction
  Hook-->>Data: callAction (or null)
  alt callAction present
    Data->>Data: build callItem
  else
    Data->>Data: callItem = undefined
  end
  Data->>WithCall: render (props..., callItem?)
  Data->>Menu: render (omnichannelItems, isPressed, callItem?)
  Menu->>Menu: sections = [Voice_Call(callItem?), Omnichannel(...)]
  Menu->>Generic: render filtered sections
  Generic-->>User: menu (with or without Voice_Call)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • aleksandernsilva

Poem

A rabbit found a single ring,
One call to make, one gentle ping.
Menu nibbled tidy, voip bits gone,
A carrot-call at early dawn. 🥕📞

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 clearly indicates the regression being fixed by focusing on the missing call button with Enhanced Navigation on small screens, which matches the primary change in the pull request and is concise and specific.
Linked Issues Check ✅ Passed The PR replaces the old voipItems integration with a single callItem and updates all relevant navbar control components to ensure the call button is rendered under Enhanced Navigation on small screens, directly fulfilling the objective of VGA-20 to restore the missing call button.
Out of Scope Changes Check ✅ Passed All changes are scoped to refactoring the voipItems logic into a callItem and updating navbar control components to render the call button, with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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/missingCallItem

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.

dougfabris
dougfabris previously approved these changes Oct 6, 2025
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)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx (1)

11-11: Consider explicit forwarding of callItem for clarity.

While the callItem prop is correctly passed through the ...props spread at line 47, explicitly destructuring and forwarding it would improve code readability and make the data flow more obvious.

Apply this diff to make the forwarding explicit:

-const NavBarControlsWithCall = ({ omnichannelItems, isPressed, ...props }: NavBarControlsMenuProps) => {
+const NavBarControlsWithCall = ({ omnichannelItems, isPressed, callItem, ...props }: NavBarControlsMenuProps) => {
-	return <NavBarControlsMenu omnichannelItems={omnichannelItemsWithCall} isPressed={isPressed} {...props} />;
+	return <NavBarControlsMenu omnichannelItems={omnichannelItemsWithCall} isPressed={isPressed} callItem={callItem} {...props} />;
📜 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 46f8110 and 14a8968.

📒 Files selected for processing (3)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx (1 hunks)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx (1 hunks)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx (1)
packages/ui-voip/src/index.ts (1)
  • useMediaCallAction (5-5)
⏰ 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). (6)
  • GitHub Check: 📦 Meteor Build - coverage
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (4)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx (1)

12-12: LGTM! Clean integration of the Voice_Call section.

The callItem prop is properly integrated:

  • Added to the type definition
  • Conditionally rendered in a Voice_Call section
  • Filtered out when empty alongside the Omnichannel section

The implementation follows the existing pattern and maintains consistency with the Omnichannel section handling.

Also applies to: 15-15, 20-23

apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx (3)

73-73: LGTM! Correct propagation of callItem to both render paths.

The callItem is properly passed to both NavbarControlsWithCall (when call is enabled) and NavBarControlsMenu (otherwise), ensuring the call button appears in both navigation modes.

Also applies to: 76-76


2-2: Verify useMediaCallAction covers small-screen logic.
Confirm that the hook from @rocket.chat/ui-voip internally handles screen-size and “Enhanced Navigation” mode, hiding the call button when appropriate.


40-47: Verify null safety of callAction properties
Confirm that when useMediaCallAction returns a non-null callAction, its icon, title, and action are always defined; otherwise add defensive checks (optional chaining or default values).

@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-7.11.0@15d6bf1). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-7.11.0   #37155   +/-   ##
=================================================
  Coverage                  ?   66.41%           
=================================================
  Files                     ?     3384           
  Lines                     ?   115592           
  Branches                  ?    21348           
=================================================
  Hits                      ?    76767           
  Misses                    ?    36219           
  Partials                  ?     2606           
Flag Coverage Δ
e2e 57.27% <50.00%> (?)
unit 71.28% <ø> (?)

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.

@dougfabris
Copy link
Member

If this menu item hasn't been displayed in 7.11.0, we should treat as a regression IMO

@dougfabris dougfabris changed the base branch from develop to release-7.11.0 October 16, 2025 15:25
@dougfabris dougfabris dismissed their stale review October 16, 2025 15:25

The base branch was changed.

@dougfabris dougfabris requested review from a team as code owners October 16, 2025 15:26
@dougfabris dougfabris removed request for a team October 16, 2025 15:35
@dougfabris dougfabris changed the title fix: Missing call button with "Enhanced Navigation" enabled on small screens regression: Missing call button with "Enhanced Navigation" enabled on small screens Oct 16, 2025
@dougfabris dougfabris modified the milestones: 7.12.0, 7.11.0 Oct 16, 2025
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Oct 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 16, 2025
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 (2)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx (2)

8-12: Unify prop type source to avoid drift.

You re-declare NavBarControlsMenuProps here (now with callItem). Prefer importing the actual prop type from NavBarControlsMenu (or exporting a shared type) to prevent divergence across files.


14-14: Call item forwarding via spread is correct; minor clarity tweak optional.

callItem is forwarded via {...props} to NavBarControlsMenu. Works. For readability, you could destructure callItem explicitly and pass it as a named prop.

Also applies to: 47-47

📜 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 14a8968 and 86df46a.

📒 Files selected for processing (3)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx (1 hunks)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx (2 hunks)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx
⏰ 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)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx (4)

70-70: Confirm pressed-state scope is intentional.

isPressed now ignores VOIP-specific pressed states. Confirm that only queue/contact need to drive the popover state in this view.


73-73: All verification checks confirm the code changes are correct.

The callItem is properly passed to both NavbarControlsWithCall (line 73) and NavBarControlsMenu (line 76), and NavBarControlsMenu correctly consumes it to render the Voice_Call section at line 22 (items: callItem ? [callItem] : []). The fix ensures the call entry is available on both desktop and mobile views.


2-2: @rocket.chat/ui-voip hook integration validated
useMediaCallAction is properly exported and used across the monorepo; no voipItems references remain.


40-47: No action required; useMediaCallAction does not expose a disabled state.

The hook returns only { title: string; icon: IconNames; action: (callee?: PeerInfo) => void } across all code paths. There is no disabled or isDisabled flag to propagate.

@kodiakhq kodiakhq bot merged commit 148485a into release-7.11.0 Oct 16, 2025
20 checks passed
@kodiakhq kodiakhq bot deleted the fix/missingCallItem branch October 16, 2025 15:47
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