Repository navigation
feat(voip): display video conf provider as subtitle - #7160
Conversation
Shows the active video conference provider (e.g. Jitsi) as a subtitle on the Video_call List.Item in RoomActionsView CallSection.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughCallSection fetches video conference capabilities when calls become enabled, storing the returned providerName in local state and displaying it as the Video_call List.Item subtitle (with translation disabled). New Storybook stories and Jest tests for CallSection were added. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/views/RoomActionsView/components/CallSection.tsx (1)
20-26: Refactor effect to typedasync/awaitwith explicit error handling.The current code uses
res: any(line 23) and silently swallows failures with.catch(() => {})(line 24), weakening type safety and hindering troubleshooting. ThevideoConferenceGetCapabilities()endpoint returns a properly typed response{ providerName: string; capabilities: VideoConferenceCapabilities }defined inapp/definitions/rest/v1/videoConference.ts, so theanytype is unnecessary.♻️ Proposed refactor
useEffect(() => { - if (callEnabled) { - videoConferenceGetCapabilities() - .then((res: any) => setProviderName(res.providerName)) - .catch(() => {}); - } + if (!callEnabled) { + return; + } + + const fetchProviderName = async (): Promise<void> => { + try { + const res = await videoConferenceGetCapabilities(); + setProviderName(res?.providerName); + } catch { + // Provider subtitle is optional; keep action available when lookup fails. + setProviderName(undefined); + } + }; + + void fetchProviderName(); }, [callEnabled]);This aligns with coding guidelines: prefer async/await over
.then()chains, use explicit error handling with try/catch blocks, and add explicit type annotations for type safety.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/views/RoomActionsView/components/CallSection.tsx` around lines 20 - 26, Refactor the useEffect block that calls videoConferenceGetCapabilities to an async/await pattern with explicit typing and error handling: inside the useEffect (where callEnabled is the dependency) create and invoke an async function that awaits videoConferenceGetCapabilities(): Promise<{ providerName: string; capabilities: VideoConferenceCapabilities }>, assign the typed result to a const and call setProviderName(result.providerName) in the success path, and wrap the await in a try/catch that handles/logs errors instead of swallowing them (refer to videoConferenceGetCapabilities, setProviderName, and the VideoConferenceCapabilities type from app/definitions/rest/v1/videoConference.ts).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/views/RoomActionsView/components/CallSection.tsx`:
- Around line 20-26: Refactor the useEffect block that calls
videoConferenceGetCapabilities to an async/await pattern with explicit typing
and error handling: inside the useEffect (where callEnabled is the dependency)
create and invoke an async function that awaits
videoConferenceGetCapabilities(): Promise<{ providerName: string; capabilities:
VideoConferenceCapabilities }>, assign the typed result to a const and call
setProviderName(result.providerName) in the success path, and wrap the await in
a try/catch that handles/logs errors instead of swallowing them (refer to
videoConferenceGetCapabilities, setProviderName, and the
VideoConferenceCapabilities type from
app/definitions/rest/v1/videoConference.ts).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bd7ea34d-84ac-440b-ae33-7a8983cb462a
📒 Files selected for processing (1)
app/views/RoomActionsView/components/CallSection.tsx
📜 Review details
⏰ 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). (1)
- GitHub Check: ESLint and Test / run-eslint-and-test
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (CLAUDE.md)
Configure Prettier with tabs, single quotes, 130 character width, no trailing commas, arrow parens avoid, and bracket same line
Files:
app/views/RoomActionsView/components/CallSection.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint with
@rocket.chat/eslint-configbase configuration including React, React Native, TypeScript, and Jest plugins
Files:
app/views/RoomActionsView/components/CallSection.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use TypeScript with strict mode enabled and configure baseUrl to app/ for import resolution
**/*.{ts,tsx}: Use TypeScript for type safety; add explicit type annotations to function parameters and return types
Prefer interfaces over type aliases for defining object shapes in TypeScript
Use enums for sets of related constants rather than magic strings or numbers
Files:
app/views/RoomActionsView/components/CallSection.tsx
app/views/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Place screen components in app/views/ directory
Files:
app/views/RoomActionsView/components/CallSection.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Use descriptive names for functions, variables, and classes that clearly convey their purpose
Write comments that explain the 'why' behind code decisions, not the 'what'
Keep functions small and focused on a single responsibility
Use const by default, let when reassignment is needed, and avoid var
Prefer async/await over .then() chains for handling asynchronous operations
Use explicit error handling with try/catch blocks for async operations
Avoid deeply nested code; refactor complex logic into helper functions
Files:
app/views/RoomActionsView/components/CallSection.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to app/lib/services/voip/**/*.{ts,tsx} : Implement VoIP with WebRTC peer-to-peer audio calls in app/lib/services/voip/ using Zustand stores instead of Redux, with native CallKit (iOS) and Telecom (Android) integration; keep VoIP and VideoConf separate
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to @(app/sagas/videoConf.ts|app/lib/methods/videoConf.ts) : Manage video conferencing via Redux actions/reducers/sagas in app/sagas/videoConf.ts and app/lib/methods/videoConf.ts using server-managed Jitsi integration; do not conflate with VoIP
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to app/lib/services/voip/**/*.{ts,tsx} : Implement VoIP with WebRTC peer-to-peer audio calls in app/lib/services/voip/ using Zustand stores instead of Redux, with native CallKit (iOS) and Telecom (Android) integration; keep VoIP and VideoConf separate
Applied to files:
app/views/RoomActionsView/components/CallSection.tsx
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to @(app/sagas/videoConf.ts|app/lib/methods/videoConf.ts) : Manage video conferencing via Redux actions/reducers/sagas in app/sagas/videoConf.ts and app/lib/methods/videoConf.ts using server-managed Jitsi integration; do not conflate with VoIP
Applied to files:
app/views/RoomActionsView/components/CallSection.tsx
🔇 Additional comments (2)
app/views/RoomActionsView/components/CallSection.tsx (2)
1-19: Clean hook/state setup for the new subtitle flow.Import and local state additions are minimal and correctly scoped to this component.
52-52: Subtitle binding to provider name is a solid UX improvement.Line 52 correctly wires the fetched provider into the
Video_callrow without affecting action behavior.
There was a problem hiding this comment.
🧹 Nitpick comments (4)
app/views/RoomActionsView/components/CallSection.test.tsx (2)
176-188: Avoidas nevertype assertion; use a more accurate mock return type.The
as nevercast bypasses type checking and could hide type mismatches. If the API returns additional fields, define a partial mock type or use the actual response type.♻️ Suggested improvement
- mockVideoConferenceGetCapabilities.mockResolvedValue({ providerName: 'Rocket.Chat' } as never); + mockVideoConferenceGetCapabilities.mockResolvedValue({ providerName: 'Rocket.Chat' });If TypeScript complains about missing fields, extend the mock object to satisfy the return type or use
Partial<ReturnType<typeof restApi.videoConferenceGetCapabilities>>in the mock setup.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/views/RoomActionsView/components/CallSection.test.tsx` around lines 176 - 188, The test uses an unsafe "as never" cast on mockVideoConferenceGetCapabilities.mockResolvedValue; replace this with a properly typed mock return (e.g., use Partial<ReturnType<typeof restApi.videoConferenceGetCapabilities>> or construct a full mock object matching the real response type) when setting mockResolvedValue in the CallSection test so TypeScript checks the shape of the mocked capabilities and avoids hiding type errors from videoConferenceGetCapabilities.
48-72: Consider extracting sharedcreateMockRoomhelper.This
createMockRoomfunction is duplicated inCallSection.stories.tsx. Consider extracting it to a shared test utility file (e.g.,app/lib/testUtils/mockRoom.ts) to improve maintainability and ensure consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/views/RoomActionsView/components/CallSection.test.tsx` around lines 48 - 72, The createMockRoom helper is duplicated; extract it into a shared test utility (e.g., app/lib/testUtils/mockRoom.ts) as a named export (createMockRoom) that returns TSubscriptionModel and accepts overrides: Partial<ISubscription>, then replace the local definitions in CallSection.test.tsx and CallSection.stories.tsx with imports from that file and update any type imports (ISubscription, TSubscriptionModel, SubscriptionType) so both test and story files reference the same helper and types.app/views/RoomActionsView/components/CallSection.stories.tsx (2)
22-46: DuplicatecreateMockRoomhelper.This function is identical to the one in
CallSection.test.tsx. Consider extracting it to a shared test utility to avoid duplication.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/views/RoomActionsView/components/CallSection.stories.tsx` around lines 22 - 46, createMockRoom is duplicated between CallSection.stories.tsx and CallSection.test.tsx; extract this helper into a shared test utility module (e.g., testUtils or mocks) and export a typed factory function (accepting overrides: Partial<ISubscription> and returning TSubscriptionModel) so both files import and reuse it. Update CallSection.stories.tsx and CallSection.test.tsx to remove the local createMockRoom implementation and import the shared createMockRoom, ensuring the exported function preserves the SubscriptionType, ISubscription, and TSubscriptionModel typings and default fields used by the stories/tests.
48-65: Decorator state mutations may cause cross-story pollution.The decorators dispatch actions to
mockedStorebut don't clean up. Additionally,withVoiceCallDisabledonly callsclearEnterpriseModules()but doesn't reset the settings, permissions, and user set bywithVoiceAndVideoCallEnabled. This could lead to inconsistent story rendering depending on viewing order.Consider resetting all relevant state in
withVoiceCallDisabledor using a cleanup pattern.♻️ Suggested improvement
const withVoiceCallDisabled = (Story: React.ComponentType) => { mockedStore.dispatch(clearEnterpriseModules()); + mockedStore.dispatch(addSettings({ VideoConf_Enable_DMs: false })); + mockedStore.dispatch( + setPermissions({ + 'allow-internal-voice-calls': [], + 'allow-external-voice-calls': [], + 'call-management': [] + }) + ); return <Story />; };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/views/RoomActionsView/components/CallSection.stories.tsx` around lines 48 - 65, The decorators mutate shared mockedStore (see withVoiceAndVideoCallEnabled and withVoiceCallDisabled) which can leak state between stories; update withVoiceCallDisabled (or add a teardown decorator) to explicitly reset all keys mutated by withVoiceAndVideoCallEnabled — call clearEnterpriseModules(), remove/reset the VideoConf_Enable_DMs setting, reset permissions (clear or setPermissions({})), and reset user (setUser({}) or the original default) so each story starts from a known clean state; reference the mockedStore and action creators setEnterpriseModules, addSettings, setPermissions, setUser, and clearEnterpriseModules when implementing the cleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/views/RoomActionsView/components/CallSection.stories.tsx`:
- Around line 22-46: createMockRoom is duplicated between
CallSection.stories.tsx and CallSection.test.tsx; extract this helper into a
shared test utility module (e.g., testUtils or mocks) and export a typed factory
function (accepting overrides: Partial<ISubscription> and returning
TSubscriptionModel) so both files import and reuse it. Update
CallSection.stories.tsx and CallSection.test.tsx to remove the local
createMockRoom implementation and import the shared createMockRoom, ensuring the
exported function preserves the SubscriptionType, ISubscription, and
TSubscriptionModel typings and default fields used by the stories/tests.
- Around line 48-65: The decorators mutate shared mockedStore (see
withVoiceAndVideoCallEnabled and withVoiceCallDisabled) which can leak state
between stories; update withVoiceCallDisabled (or add a teardown decorator) to
explicitly reset all keys mutated by withVoiceAndVideoCallEnabled — call
clearEnterpriseModules(), remove/reset the VideoConf_Enable_DMs setting, reset
permissions (clear or setPermissions({})), and reset user (setUser({}) or the
original default) so each story starts from a known clean state; reference the
mockedStore and action creators setEnterpriseModules, addSettings,
setPermissions, setUser, and clearEnterpriseModules when implementing the
cleanup.
In `@app/views/RoomActionsView/components/CallSection.test.tsx`:
- Around line 176-188: The test uses an unsafe "as never" cast on
mockVideoConferenceGetCapabilities.mockResolvedValue; replace this with a
properly typed mock return (e.g., use Partial<ReturnType<typeof
restApi.videoConferenceGetCapabilities>> or construct a full mock object
matching the real response type) when setting mockResolvedValue in the
CallSection test so TypeScript checks the shape of the mocked capabilities and
avoids hiding type errors from videoConferenceGetCapabilities.
- Around line 48-72: The createMockRoom helper is duplicated; extract it into a
shared test utility (e.g., app/lib/testUtils/mockRoom.ts) as a named export
(createMockRoom) that returns TSubscriptionModel and accepts overrides:
Partial<ISubscription>, then replace the local definitions in
CallSection.test.tsx and CallSection.stories.tsx with imports from that file and
update any type imports (ISubscription, TSubscriptionModel, SubscriptionType) so
both test and story files reference the same helper and types.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fd718e25-5ba3-4b20-ab58-393f29bcca40
⛔ Files ignored due to path filters (1)
app/views/RoomActionsView/components/__snapshots__/CallSection.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
app/views/RoomActionsView/components/CallSection.stories.tsxapp/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- app/views/RoomActionsView/components/CallSection.tsx
📜 Review details
⏰ 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). (1)
- GitHub Check: ESLint and Test / run-eslint-and-test
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (CLAUDE.md)
Configure Prettier with tabs, single quotes, 130 character width, no trailing commas, arrow parens avoid, and bracket same line
Files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint with
@rocket.chat/eslint-configbase configuration including React, React Native, TypeScript, and Jest plugins
Files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use TypeScript with strict mode enabled and configure baseUrl to app/ for import resolution
**/*.{ts,tsx}: Use TypeScript for type safety; add explicit type annotations to function parameters and return types
Prefer interfaces over type aliases for defining object shapes in TypeScript
Use enums for sets of related constants rather than magic strings or numbers
Files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
app/views/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Place screen components in app/views/ directory
Files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Use descriptive names for functions, variables, and classes that clearly convey their purpose
Write comments that explain the 'why' behind code decisions, not the 'what'
Keep functions small and focused on a single responsibility
Use const by default, let when reassignment is needed, and avoid var
Prefer async/await over .then() chains for handling asynchronous operations
Use explicit error handling with try/catch blocks for async operations
Avoid deeply nested code; refactor complex logic into helper functions
Files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to app/lib/services/voip/**/*.{ts,tsx} : Implement VoIP with WebRTC peer-to-peer audio calls in app/lib/services/voip/ using Zustand stores instead of Redux, with native CallKit (iOS) and Telecom (Android) integration; keep VoIP and VideoConf separate
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to @(app/sagas/videoConf.ts|app/lib/methods/videoConf.ts) : Manage video conferencing via Redux actions/reducers/sagas in app/sagas/videoConf.ts and app/lib/methods/videoConf.ts using server-managed Jitsi integration; do not conflate with VoIP
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to app/lib/services/voip/**/*.{ts,tsx} : Implement VoIP with WebRTC peer-to-peer audio calls in app/lib/services/voip/ using Zustand stores instead of Redux, with native CallKit (iOS) and Telecom (Android) integration; keep VoIP and VideoConf separate
Applied to files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to @(app/sagas/videoConf.ts|app/lib/methods/videoConf.ts) : Manage video conferencing via Redux actions/reducers/sagas in app/sagas/videoConf.ts and app/lib/methods/videoConf.ts using server-managed Jitsi integration; do not conflate with VoIP
Applied to files:
app/views/RoomActionsView/components/CallSection.test.tsx
📚 Learning: 2026-03-30T15:49:30.957Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6875
File: app/containers/RoomItem/Actions.tsx:12-12
Timestamp: 2026-03-30T15:49:30.957Z
Learning: In RocketChat/Rocket.Chat.ReactNative, `react-native-worklets` version 0.6.1 does NOT export a built-in Jest mock (e.g., no `react-native-worklets/lib/module/mock`). The correct Jest mock approach for this version is to add a manual mock in `jest.setup.js`: `jest.mock('react-native-worklets', () => ({ scheduleOnRN: jest.fn((fn, ...args) => fn(...args)) }))`.
Applied to files:
app/views/RoomActionsView/components/CallSection.test.tsx
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to app/sagas/**/*.{ts,tsx} : Place Redux sagas in app/sagas/ directory with separate files for init, login, rooms, messages, encryption, deepLinking, and videoConf side effects
Applied to files:
app/views/RoomActionsView/components/CallSection.test.tsxapp/views/RoomActionsView/components/CallSection.stories.tsx
📚 Learning: 2026-03-10T15:21:45.098Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7046
File: app/containers/InAppNotification/NotifierComponent.stories.tsx:46-75
Timestamp: 2026-03-10T15:21:45.098Z
Learning: In `app/containers/InAppNotification/NotifierComponent.tsx` (React Native, Rocket.Chat), `NotifierComponent` is exported as a Redux-connected component via `connect(mapStateToProps)`. The `isMasterDetail` prop is automatically injected from `state.app.isMasterDetail` and does not need to be passed explicitly at call sites or in Storybook stories that use the default (connected) export.
Applied to files:
app/views/RoomActionsView/components/CallSection.stories.tsx
📚 Learning: 2026-03-15T13:55:42.038Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6911
File: app/containers/markdown/Markdown.stories.tsx:104-104
Timestamp: 2026-03-15T13:55:42.038Z
Learning: In Rocket.Chat React Native, the markdown parser requires a space between the underscore wrapping italic text and a mention sigil (_ mention _ instead of _mention_). Ensure stories and tests that include italic-wrapped mentions follow this form to guarantee proper parsing. Specifically, for files like app/containers/markdown/Markdown.stories.tsx, and any test/content strings that exercise italic-mentions, use the pattern _ mention _ (with spaces) to prevent the mention from being treated as plain text. Validate any test strings or story content accordingly.
Applied to files:
app/views/RoomActionsView/components/CallSection.stories.tsx
🔇 Additional comments (10)
app/views/RoomActionsView/components/CallSection.test.tsx (8)
1-12: LGTM!Imports are well-organized and appropriate for the testing scope. The wildcard import for
restApienables proper mocking of thevideoConferenceGetCapabilitiesfunction.
14-44: LGTM!The mock setup is well-structured. Defining mocks outside the
jest.mockcalls and using wrapper functions ((...args: unknown[]) => mockUseVideoConf(...args)) allows for dynamic mock behavior changes in individual tests viamockReturnValue.
74-87: LGTM!The
beforeEachsetup properly resets all mocks withjest.clearAllMocks()and establishes sensible defaults. SettingmockVideoConferenceGetCapabilities.mockRejectedValueas the default ensures tests that don't need the provider subtitle won't accidentally depend on it.
89-107: LGTM!Good coverage of the edge case where both voice and video are unavailable. Testing both
toJSON()returning null and individual elements being absent provides thorough verification.
109-150: LGTM!Tests for conditional rendering of voice-only, video-only, and both-enabled states are clear and correctly verify the expected elements are present or absent.
152-174: LGTM!Interaction tests correctly verify that pressing the voice row calls
openNewMediaCalland pressing the video row callsshowInitCallActionSheet, matching the component'sonPresshandlers per the relevant code snippets.
190-204: LGTM!Good test for the disabled state behavior. This verifies that pressing disabled items does not invoke the handlers, which aligns with the component's
disabled={disabledTooltip || disabled}prop on the List.Item components.
207-207: LGTM!Invoking
generateSnapshots(stories)ties the Storybook stories to Jest snapshot tests, ensuring visual regression coverage.app/views/RoomActionsView/components/CallSection.stories.tsx (2)
1-20: LGTM!Imports and initial setup are appropriate. The
Wrappercomponent with padding provides a clean visual container for stories.
67-92: LGTM!The story exports cover the key states: default (both calls enabled), disabled prop, and no voice call. The CSF3 format used for
NoVoiceCallwith custom decorators is appropriate.
…/Decline (#7215) * merge feat.voip-lib * feat(voip): enhance call handling with UUID mapping and event listeners * Base call UI * feat(voip): integrate Zustand for call state management and enhance CallView UI * feat(voip): add simulateCall function for mock call handling in UI development * refactor(CallView): update button handlers and improve UI responsiveness * Add pause-shape-unfilled icon * Base CallHeader * toggleFocus * collapse buttons * Header components * Hide header when no call * Timer * Add use memo * Add voice call item on sidebar * cleanup * Temp use @rocket.chat/media-signaling from .tgz * cleanup * Check module and permissions to enable voip * Refactor stop method to use optional chaining for media signal listeners * voip push first test * Add VoIP call handling with pending call management - Implemented VoIP push notification handling in index.js, including storing call info for later processing. - Added CallKeep event handlers for answering and ending calls from a cold start. - Introduced a new CallIdUUID module to convert call IDs to deterministic UUIDs for compatibility with CallKit. - Created a pending call store to manage incoming calls when the app is not fully initialized. - Updated deep linking actions to include VoIP call handling. - Enhanced MediaSessionInstance to process pending calls and manage call states effectively. * Remove pending store and create getInitialEvents on app/index * Attempt to make iOS calls work from cold state * lint and format * Patch callkeep ios * Temp send iOS voip push token on gcm * Temp fix require cycle * chore: format code and fix lint issues [skip ci] * CallIDUUID module on android and voip push * Add setCallUUID on useCallStore to persist calls accepted on native Android * remove callkeep from notification * Android Incoming Call UI POC * Refactor VoIP handling: Migrate VoIP-related classes to a new package structure, removing deprecated modules and consolidating functionality. Update imports in MainApplication and NotificationIntentHandler to reflect changes. This cleanup enhances code organization and prepares for future VoIP feature enhancements. * Remove VoipForegroundService * cleanup and use caller instead of callerName * Cleanup and make iOS build again * Refactor VoIP handling: Remove unused event emissions for call answered and declined, switch from SharedPreferences to in-memory storage for pending VoIP call data, and update method signatures for better clarity. This cleanup enhances performance and prepares for future VoIP feature improvements. * Refactor VoIP handling: Introduce a new VoipPayload class to encapsulate call data, streamline notification processing, and enhance method signatures across the VoIP module. This update improves code clarity and prepares for future feature enhancements. * Migrate react-native-voip-push-notifications to VoipModule * Refactor VoIP module: Update package structure by moving VoipTurboPackage to the main package and removing the obsolete NativeVoipSpec class. Adjust imports in MainApplication and VoipModule to reflect these changes, enhancing code organization and maintainability. * Unify emitters * Move CallKeep listeners from MediaSessionInstance to getInitialEvents * Clear callkeep on endcall * Unify getInitialEvents logic * getInitialEvents -> MediaCallEvents * chore: format code and fix lint issues [skip ci] * feat(Android): Add full screen incoming call (#6977) * feat: Update call UI (#6990) * feat: Handle audio routing, e.g., Bluetooth headset vs. internal speaker switching (#6992) * fix: empty space when not on call (#6993) * feat: Dialpad (#7000) * action: organized translations * feat: start call (#7024) * chore: format code and fix lint issues * feat: Pre flight (#7038) * action: organized translations * feat: Receive voip push notifications from backend (#7045) * feat: Refactor media session handling and improve disconnect logic (#7065) * feat: Control incoming call from native (#7066) * feat: Voice message blocks (#7057) * feat: native accept success event (#7068) * feat(voip): call waiting, busy detection, and videoconf blocking (#7077) * action: organized translations * feat(voip): tap-to-hide call controls with animations (#7078) * feat(voip): navigate to call DM from message button and header (#7082) * feat(voip): tablet and landscape layout (#7110) * chore: develop into feat.voip-lib-new (RN 81 + Expo 54 + reanimated 4 + true-sheet + iOS 26) (#7114) * chore: format code and fix lint issues * feat(voip): android landscape layout for IncomingCallActivity (#7116) * Update agents files * feat(voip): Support a11y (#7106) * Fix content cutting on iOS on some edge cases * pods * Ignore .worktrees on jest * chore: Merge develop into feat.voip-lib-new (#7129) * fix(voip): show CallKit UI when call is active in background (#7128) * chore: Update media-signaling to 0.2.0 (#7153) * feat(voip): migrate iOS accept/reject from DDP to REST (#7124) * Fix icons * feat(voip): migrate Android accept/reject from DDP to REST (#7127) * test(voip): integration tests for CallView pipeline (#7161) * feat(voip): display video conf provider as subtitle (#7160) * fix(voip): CallView button grid and correct landscape/dialpad layouts (#7164) * fix(voip): prevent stale MMKV cache on Android first-install accept MMKVKeyManager.initialize ran in MainApplication.onCreate before the JS engine started and opened the default MMKV file via the Tencent 1.2 JAR when it was still empty. Tencent caches instances per-ID in a singleton registry, so that empty-state view was held for the rest of the process. JS later wrote credentials through react-native-mmkv (MMKV Core 2.0), which has its own separate registry. When a VoIP push arrived, Ejson.getMMKV() got the cached empty Tencent instance and reported "No userId found in MMKV for server". Closing and reopening the app cleared the cache, which is why only the very first call after install failed. Drop the open/verify block — the encryption key is already cached from SecureKeystore, so no MMKV handle is needed here. The first Tencent instance is now created inside Ejson.getMMKV() after JS has written, so it scans the file fresh. * fix(voip): prevent duplicate ringtone on Android incoming call (#7158) * fix(voip): set explicit snaps for NewMediaCall bottom sheet (#7165) * Update app/lib/services/voip/MediaSessionStore.ts Co-authored-by: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> * fix: make startVoipFork reactive to permissions-changed (#7151) * fix(android): remove MediaProjectionService from merged manifest (#7190) * fix(voip): Phone account creation (#7170) * feat: add Enable Mobile Ringing toggle in user preferences (#7155) * fix(voip): ship blockers for PushKit, licensing, outbound calls, push tokens (#7167) * fix(android): Play Store mic discoverability, safer FCM logs, avatar auth via headers (#7171) * fix(ios): serialize VoipService bridge statics (#7169) * fix(voip): Android DDP thread safety and VoipPayload bundle parity (#7168) * chore(voip): dead-code and hygiene sweep (#7174) * refactor(voip): decouple navigateToCallRoom from Redux and backfill REST/connect tests (#7176) * test(voip): tighten ringing endCall assertion and add VideoConf VoIP-lock saga coverage (#7177) * fix(ios): harden VoIP DDP WebSocket client on receive failures and TLS (#7173) * refactor(voip): MediaCallEvents Redux adapters and resetVoipState (#7178) * refactor(voip): decouple peer autocomplete from Redux; simplify NewMediaCall (#7175) * fix(ios): add NS_SWIFT_NAME to Challenge.runChallenge for Swift 6.2 compatibility Swift 6.2 (Xcode 26.x / macos-26 runner) auto-renames the Objective-C method runChallenge:didReceiveChallenge:completionHandler: to run(_:didReceive:completionHandler:) when imported into Swift. Add NS_SWIFT_NAME to explicitly pin the Swift import name, preventing the compiler from applying its heuristics. This keeps the existing Swift call site in DDPClient.swift working without changes. * fix(ios): cancel old URLSession/webSocketTask before reconnecting in DDPClient.connect (#7197) * fix(ios): add NSLock to nativeAcceptHandledCallIds and 10s REST timeout to handleNativeAccept (#7198) * feat(android): create VoipCallService with FOREGROUND_SERVICE_MICROPHONE (#7199) * fix(android): start VoipCallService on accept, stop on hangup/timeout, install end-call listener (#7200) * fix(voip): enable DM nav for users with SIP extension (#7203) * fix(android): handle null VoiceConnection in answerIncomingCall, notify JS (#7201) * fix(voip): resolve closure capture ordering in handleNativeAccept (#7209) * fix(android): integrate VoIP modules with SSL-pinned OkHttpClient (#7208) * fix(push): gate id and voipToken behind server version checks, fix VideoConf caller extra (#7210) * fix(voip): remove sensitive data from production logs (#7207) * fix(android): remove isRunning guard + add double-tap guard on Accept/Decline - VoipCallService: remove if (!isRunning) guard, call startForeground unconditionally (idempotent on Android, fixes Android 14+ foreground service requirement) - IncomingCallActivity: add AtomicBoolean guard on handleAccept/handleDecline to prevent double-tap from triggering multiple service starts --------- Co-authored-by: diegolmello <diegolmello@users.noreply.github.com> Co-authored-by: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com>
Proposed changes
In Room actions (
CallSection), when video conferencing is enabled for the room, the Video call row now shows the active provider name as a subtitle (for example(Jitsi)), loaded from thevideo-conference.capabilitiesREST endpoint (videoConferenceGetCapabilities). The subtitle is not passed through i18n (translateSubtitle={false}) so the provider string appears as returned by the server.This pull request also adds Storybook stories and Jest tests (including snapshot coverage) for
CallSection, aligned with patterns used forRoomInfoButtonsand other views.Issue(s)
https://rocketchat.atlassian.net/browse/VMUX-78
How to test or reproduce
providerName.TZ=UTC yarn test -- --testPathPattern='CallSection.test'and confirm tests pass.Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit