refactor(ui-voip): Separate widget visibility from call state and simplify old patterns - #41616
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (5)
|
| Layer / File(s) | Summary |
|---|---|
State and context contracts packages/ui-voip/src/context/*, packages/ui-voip/src/providers/useMediaSession.ts |
Session state uses none. Context values expose widget visibility, target-peer state, and widget controls. Signal-based widget and peer actions are removed. |
Widget and view state implementation packages/ui-voip/src/providers/useInstanceState.ts, packages/ui-voip/src/providers/useAvailableViewTracker.ts, packages/ui-voip/src/providers/useWidgetPositionTracker.ts |
Widget, peer, room, view, and position state use React state. View membership uses a Set, and position restoration uses lastKnownPosition. |
Provider and widget integration packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx, packages/ui-voip/src/providers/MediaCallViewProvider.tsx, packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx |
Providers consume the new state hooks, remove signal listeners, expose target-peer state, and pass the latest widget position through the provider flow. |
Mock providers and hook validation packages/ui-voip/src/providers/MockedInstanceProvider.tsx, packages/ui-voip/src/providers/MockedMediaCallProvider.tsx, packages/ui-voip/src/**/*spec.tsx |
Mock instance behavior is centralized. Mock call transitions use none, and hook tests use shared provider setup or default context values. |
View routing and Storybook updates packages/ui-voip/src/views/* |
Widget visibility and Set.has checks replace previous state checks. New-call rendering uses targetPeer, and stories use the none state. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Possibly related PRs
- RocketChat/Rocket.Chat#40202: Shares changes to VoIP context, providers, view registration, and popout handling.
- RocketChat/Rocket.Chat#41613: Shares changes to widget position tracking and draggable widget integration.
- RocketChat/Rocket.Chat#41670: Shares changes to
MediaCallWidget.tsxand screen-sharing view selection.
Suggested labels: type: chore
Suggested reviewers: ggazzo
🚥 Pre-merge checks | ✅ 5
✅ 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 summarizes the main refactor: separating widget visibility from call state and simplifying legacy patterns. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
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 @coderabbitai help to get the list of available commands.
useReducer with useSyncExternalStore
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #41616 +/- ##
===========================================
+ Coverage 68.61% 68.65% +0.03%
===========================================
Files 4162 4164 +2
Lines 158823 158957 +134
Branches 28168 28201 +33
===========================================
+ Hits 108979 109131 +152
+ Misses 44673 44647 -26
- Partials 5171 5179 +8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
c400c13 to
7891eff
Compare
…t visibility and peer selection on instance provider
…rovider. Also removes some bad patterns no longer needed.
984b4e4 to
6ccc49b
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/ui-voip/src/providers/MockedMediaCallProvider.tsx (2)
108-128: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the selected peer separate from the session peer.
When the state is
none,peerInfodefaults to John Doe. Line 128 therefore makesNewCallshow a selected peer before selection. Line 109 also changes session peer information while the user only selects a call target.Track
targetPeerseparately. Initialize it asundefined. Update it inonSelectPeer. SetpeerInfoonly when the mock call starts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/ui-voip/src/providers/MockedMediaCallProvider.tsx` around lines 108 - 128, The selected call target is incorrectly shared with the active session peer through peerInfo. In MockedMediaCallProvider, add separate targetPeer state initialized as undefined, update only targetPeer in onSelectPeer, and keep sessionState.peerInfo unset until the mock call-start flow explicitly assigns the selected peer; expose targetPeer in contextValue so NewCall does not show a peer before selection.
67-104: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winCancel the delayed call transition when the call ends.
The timeout always changes the state to
ongoing.onEndCall,onForward, and thecallingbranch can change the state tononebefore the timeout runs.Store and clear the timeout whenever the mock leaves
calling. Also clear it on unmount. Otherwise, an ended mock call becomes ongoing after one second.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/ui-voip/src/providers/MockedMediaCallProvider.tsx` around lines 67 - 104, Track the timeout created in the calling branch of onCall using a persistent ref, and clear/reset it whenever the mock transitions out of calling, including onEndCall, onForward, and the calling branch. Add unmount cleanup for the stored timeout so a delayed transition cannot set widgetState to ongoing after the provider is gone.
🧹 Nitpick comments (1)
packages/ui-voip/src/providers/useInstanceState.ts (1)
25-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the implementation comment.
The guideline requires implementation code without comments. The effect and callback already describe the behavior.
As per coding guidelines, “Avoid code comments in the implementation.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/ui-voip/src/providers/useInstanceState.ts` at line 25, Remove the implementation comment above the call-ended widget-close logic in useInstanceState, leaving the existing effect and callback behavior unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/ui-voip/src/providers/MockedInstanceProvider.tsx`:
- Around line 40-63: The MockedInstanceProvider currently calls useInstanceState
with the placeholder instance while exposing props.instance, causing state
updates to target a different instance. Derive a single effective instance from
the injected props.instance with the existing instance fallback, pass it to
useInstanceState, and expose that same effective instance in the context value.
In `@packages/ui-voip/src/providers/useAvailableViewTracker.ts`:
- Around line 26-40: Replace the Set.prototype.isSubsetOf checks in the
useAvailableViewTracker update callbacks with a loop-based subset check that
verifies every element of filteredViews exists in prev, preserving the existing
size comparison and state reuse behavior without requiring an ES2024 production
target.
In `@packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx`:
- Around line 24-29: Update the MockedMediaCallProvider decorator in
MediaCallWidgetManualTesting so options.args.instanceProps is merged without
overriding targetWidgetVisibility: 'open'. Preserve any configured instance
properties while ensuring the explicit open visibility remains effective after
spreading options.args.
---
Outside diff comments:
In `@packages/ui-voip/src/providers/MockedMediaCallProvider.tsx`:
- Around line 108-128: The selected call target is incorrectly shared with the
active session peer through peerInfo. In MockedMediaCallProvider, add separate
targetPeer state initialized as undefined, update only targetPeer in
onSelectPeer, and keep sessionState.peerInfo unset until the mock call-start
flow explicitly assigns the selected peer; expose targetPeer in contextValue so
NewCall does not show a peer before selection.
- Around line 67-104: Track the timeout created in the calling branch of onCall
using a persistent ref, and clear/reset it whenever the mock transitions out of
calling, including onEndCall, onForward, and the calling branch. Add unmount
cleanup for the stored timeout so a delayed transition cannot set widgetState to
ongoing after the provider is gone.
---
Nitpick comments:
In `@packages/ui-voip/src/providers/useInstanceState.ts`:
- Line 25: Remove the implementation comment above the call-ended widget-close
logic in useInstanceState, leaving the existing effect and callback behavior
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 06bb41fa-1d28-4207-9a3c-b451fe7a040d
📒 Files selected for processing (27)
packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsxpackages/ui-voip/src/context/MediaCallInstanceContext.tspackages/ui-voip/src/context/MediaCallViewContext.tspackages/ui-voip/src/context/definitions.d.tspackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/context/useRegisterView.tspackages/ui-voip/src/context/useWidgetExternalControls.tspackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/providers/MediaCallInstanceProvider.tsxpackages/ui-voip/src/providers/MediaCallViewProvider.tsxpackages/ui-voip/src/providers/MockedInstanceProvider.tsxpackages/ui-voip/src/providers/MockedMediaCallProvider.tsxpackages/ui-voip/src/providers/useAvailableViewTracker.tspackages/ui-voip/src/providers/useInstanceState.tspackages/ui-voip/src/providers/useMediaSession.tspackages/ui-voip/src/providers/useWidgetExternalControlSignalListener.tspackages/ui-voip/src/providers/useWidgetPositionTracker.tspackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsxpackages/ui-voip/src/views/MediaCallPopout.tsxpackages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx
💤 Files with no reviewable changes (1)
- packages/ui-voip/src/providers/useWidgetExternalControlSignalListener.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Hacktron Security Check
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🧰 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/MediaCallRoomSection/MediaCallRoomSection.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsxpackages/ui-voip/src/views/MediaCallPopout.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/context/useWidgetExternalControls.tspackages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsxpackages/ui-voip/src/providers/useWidgetPositionTracker.tspackages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/providers/useAvailableViewTracker.tspackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsxpackages/ui-voip/src/context/useRegisterView.tspackages/ui-voip/src/providers/useInstanceState.tspackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/context/MediaCallInstanceContext.tspackages/ui-voip/src/providers/MediaCallInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/providers/useMediaSession.tspackages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsxpackages/ui-voip/src/context/definitions.d.tspackages/ui-voip/src/providers/MockedMediaCallProvider.tsxpackages/ui-voip/src/providers/MediaCallViewProvider.tsxpackages/ui-voip/src/providers/MockedInstanceProvider.tsxpackages/ui-voip/src/context/MediaCallViewContext.tspackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
🧠 Learnings (7)
📚 Learning: 2026-02-26T19:22:29.385Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx:40-40
Timestamp: 2026-02-26T19:22:29.385Z
Learning: For TSX files in the UI VOIP package, ensure that when a media session state is 'unavailable', the voiceCall action is excluded from the actions object passed to CallHistoryActions so it does not render in the menu. This filtering should occur upstream (before getItems is called) to avoid tooltips or UI hints for unavailable actions. If there are multiple actions with availability states, implement a centralized helper to filter actions based on session state.
Applied to files:
packages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsxpackages/ui-voip/src/views/MediaCallPopout.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsxpackages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsxpackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/providers/MediaCallInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsxpackages/ui-voip/src/providers/MockedMediaCallProvider.tsxpackages/ui-voip/src/providers/MediaCallViewProvider.tsxpackages/ui-voip/src/providers/MockedInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
📚 Learning: 2026-05-05T12:34:29.042Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 40331
File: packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx:69-69
Timestamp: 2026-05-05T12:34:29.042Z
Learning: In Rocket.Chat’s `packages/ui-voip` UI (e.g., media/call widgets), voice/media calls are only supported in Direct Message (DM) rooms. Rocket.Chat models a DM as a “room” with exactly two participants, so handlers like `onClickDirectMessage` are the correct destination—even when the UI text/element says “Open in room” (e.g., on the shared screen card/`StreamCard`). During review, don’t flag a “DM vs room” mismatch for these cases; they intentionally map to the same destination.
Applied to files:
packages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsxpackages/ui-voip/src/views/MediaCallPopout.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsxpackages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsxpackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/providers/MediaCallInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsxpackages/ui-voip/src/providers/MockedMediaCallProvider.tsxpackages/ui-voip/src/providers/MediaCallViewProvider.tsxpackages/ui-voip/src/providers/MockedInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.
Applied to files:
packages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsxpackages/ui-voip/src/views/MediaCallPopout.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsxpackages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsxpackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/providers/MediaCallInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsxpackages/ui-voip/src/providers/MockedMediaCallProvider.tsxpackages/ui-voip/src/providers/MediaCallViewProvider.tsxpackages/ui-voip/src/providers/MockedInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.
Applied to files:
packages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsxpackages/ui-voip/src/views/MediaCallPopout.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/context/useWidgetExternalControls.tspackages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsxpackages/ui-voip/src/providers/useWidgetPositionTracker.tspackages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/providers/useAvailableViewTracker.tspackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsxpackages/ui-voip/src/context/useRegisterView.tspackages/ui-voip/src/providers/useInstanceState.tspackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/context/MediaCallInstanceContext.tspackages/ui-voip/src/providers/MediaCallInstanceProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/providers/useMediaSession.tspackages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsxpackages/ui-voip/src/context/definitions.d.tspackages/ui-voip/src/providers/MockedMediaCallProvider.tsxpackages/ui-voip/src/providers/MediaCallViewProvider.tsxpackages/ui-voip/src/providers/MockedInstanceProvider.tsxpackages/ui-voip/src/context/MediaCallViewContext.tspackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.
Applied to files:
packages/ui-voip/src/context/useWidgetExternalControls.tspackages/ui-voip/src/providers/useWidgetPositionTracker.tspackages/ui-voip/src/providers/useAvailableViewTracker.tspackages/ui-voip/src/context/useRegisterView.tspackages/ui-voip/src/providers/useInstanceState.tspackages/ui-voip/src/context/MediaCallInstanceContext.tspackages/ui-voip/src/providers/useMediaSession.tspackages/ui-voip/src/context/definitions.d.tspackages/ui-voip/src/context/MediaCallViewContext.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.
Applied to files:
packages/ui-voip/src/context/useWidgetExternalControls.tspackages/ui-voip/src/providers/useWidgetPositionTracker.tspackages/ui-voip/src/providers/useAvailableViewTracker.tspackages/ui-voip/src/context/useRegisterView.tspackages/ui-voip/src/providers/useInstanceState.tspackages/ui-voip/src/context/MediaCallInstanceContext.tspackages/ui-voip/src/providers/useMediaSession.tspackages/ui-voip/src/context/definitions.d.tspackages/ui-voip/src/context/MediaCallViewContext.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.
Applied to files:
packages/ui-voip/src/context/usePeerAutocomplete.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionState.spec.tsxpackages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsxpackages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
🔇 Additional comments (27)
packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx (1)
2-23: LGTM!Also applies to: 39-59
packages/ui-voip/src/providers/MediaCallViewProvider.tsx (1)
37-39: LGTM!Also applies to: 63-63, 84-100, 201-201, 218-218, 228-228, 245-245
packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx (1)
16-16: LGTM!packages/ui-voip/src/providers/MockedInstanceProvider.tsx (1)
1-35: LGTM!packages/ui-voip/src/providers/MockedMediaCallProvider.tsx (1)
5-60: LGTM!Also applies to: 145-148
packages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx (1)
6-20: LGTM!packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx (1)
7-16: LGTM!packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx (1)
8-22: LGTM!packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx (1)
5-12: LGTM!packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx (1)
52-68: LGTM!packages/ui-voip/src/views/MediaCallPopout.tsx (1)
34-34: LGTM!packages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsx (1)
61-61: LGTM!packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx (2)
6-6: LGTM!
64-64: LGTM!packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx (1)
3-16: LGTM!packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx (1)
7-15: LGTM!Also applies to: 26-28
packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx (1)
22-25: LGTM!Also applies to: 35-37
packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx (1)
41-41: LGTM!packages/ui-voip/src/context/MediaCallInstanceContext.ts (1)
13-50: LGTM!packages/ui-voip/src/context/MediaCallViewContext.ts (1)
15-15: LGTM!Also applies to: 32-38, 47-53
packages/ui-voip/src/context/definitions.d.ts (1)
21-21: LGTM!Also applies to: 38-38
packages/ui-voip/src/providers/useMediaSession.ts (1)
4-7: LGTM!Also applies to: 53-53, 63-64, 202-202
packages/ui-voip/src/providers/useInstanceState.ts (1)
1-24: LGTM!Also applies to: 26-34
packages/ui-voip/src/providers/useAvailableViewTracker.ts (1)
1-24: LGTM!Also applies to: 41-44
packages/ui-voip/src/providers/useWidgetPositionTracker.ts (1)
2-2: LGTM!Also applies to: 12-18
packages/ui-voip/src/context/useRegisterView.ts (1)
6-6: LGTM!packages/ui-voip/src/context/useWidgetExternalControls.ts (1)
8-18: LGTM!
There was a problem hiding this comment.
All reported issues were addressed across 27 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
e34b7e6 to
bef9397
Compare
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Proposed changes (including videos or screenshots)
Issue(s)
DMVPR-26
Steps to test or reproduce
Further comments
Summary by CodeRabbit