Skip to content

refactor(ui-voip): Separate widget visibility from call state and simplify old patterns - #41616

Merged
ggazzo merged 11 commits into
developfrom
ui-voip/refactorSessionState
Aug 5, 2026
Merged

refactor(ui-voip): Separate widget visibility from call state and simplify old patterns#41616
ggazzo merged 11 commits into
developfrom
ui-voip/refactorSessionState

Conversation

@gabriellsh

@gabriellsh gabriellsh commented Jul 28, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

DMVPR-26

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added improved controls for opening, closing, and targeting calls to a selected peer.
    • Improved restoration of the widget’s last position.
    • Screen-sharing calls now open the appropriate ongoing-call view when supported.
  • Bug Fixes
    • Improved widget visibility across active and inactive call states.
    • Stabilized call transitions and reset behavior when calls end.
    • Improved peer selection and autocomplete behavior.
  • Refactor
    • Simplified view tracking for more responsive popout and call interface updates.
    • Standardized the initial inactive call state across the interface.

@dionisio-bot

dionisio-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1e53938

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

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00899a8f-d75f-4ba4-874a-d7b9c6670927

📥 Commits

Reviewing files that changed from the base of the PR and between 6628738 and 1e53938.

📒 Files selected for processing (1)
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (4)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

Walkthrough

The PR replaces signal-based VoIP widget controls with React state and context values. It introduces the none session state, changes view tracking to Set, updates providers and views, centralizes mock setup, and restores widget positions through lastKnownPosition.

Changes

VoIP media state and widget flow

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

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.

❤️ Share

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

@gabriellsh gabriellsh changed the title refactor: Separate widget visibility from call state and replace useReducer with useSyncExternalStore refactor: Separate widget visibility from call state and simplify old patterns Jul 31, 2026
@gabriellsh gabriellsh changed the title refactor: Separate widget visibility from call state and simplify old patterns refactor(ui-voip): Separate widget visibility from call state and simplify old patterns Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.18705% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.65%. Comparing base (2d8a6f7) to head (1e53938).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 58.88% <ø> (-0.01%) ⬇️
e2e-api 45.99% <ø> (+0.29%) ⬆️
unit 70.54% <66.18%> (+<0.01%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gabriellsh
gabriellsh force-pushed the ui-voip/refactorSessionState branch 2 times, most recently from c400c13 to 7891eff Compare August 3, 2026 21:20
Base automatically changed from ui-voip/refactorDraggableContext to develop August 3, 2026 21:49
@gabriellsh
gabriellsh force-pushed the ui-voip/refactorSessionState branch from 984b4e4 to 6ccc49b Compare August 3, 2026 22:50
@gabriellsh
gabriellsh marked this pull request as ready for review August 3, 2026 22:51
@gabriellsh gabriellsh added this to the 8.8.0 milestone Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Keep the selected peer separate from the session peer.

When the state is none, peerInfo defaults to John Doe. Line 128 therefore makes NewCall show a selected peer before selection. Line 109 also changes session peer information while the user only selects a call target.

Track targetPeer separately. Initialize it as undefined. Update it in onSelectPeer. Set peerInfo only 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 win

Cancel the delayed call transition when the call ends.

The timeout always changes the state to ongoing. onEndCall, onForward, and the calling branch can change the state to none before 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 win

Remove 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

📥 Commits

Reviewing files that changed from the base of the PR and between dd60cf8 and 6ccc49b.

📒 Files selected for processing (27)
  • packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx
  • packages/ui-voip/src/context/MediaCallInstanceContext.ts
  • packages/ui-voip/src/context/MediaCallViewContext.ts
  • packages/ui-voip/src/context/definitions.d.ts
  • packages/ui-voip/src/context/usePeekMediaSessionPeerInfo.spec.tsx
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx
  • packages/ui-voip/src/context/useRegisterView.ts
  • packages/ui-voip/src/context/useWidgetExternalControls.ts
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
  • packages/ui-voip/src/providers/MediaCallViewProvider.tsx
  • packages/ui-voip/src/providers/MockedInstanceProvider.tsx
  • packages/ui-voip/src/providers/MockedMediaCallProvider.tsx
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
  • packages/ui-voip/src/providers/useInstanceState.ts
  • packages/ui-voip/src/providers/useMediaSession.ts
  • packages/ui-voip/src/providers/useWidgetExternalControlSignalListener.ts
  • packages/ui-voip/src/providers/useWidgetPositionTracker.ts
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
  • packages/ui-voip/src/views/MediaCallPopout.tsx
  • packages/ui-voip/src/views/MediaCallRoomSection/MediaCallRoomSection.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx
  • packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx
  • packages/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.tsx
  • packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx
  • packages/ui-voip/src/views/MediaCallPopout.tsx
  • packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx
  • packages/ui-voip/src/context/useWidgetExternalControls.ts
  • packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx
  • packages/ui-voip/src/providers/useWidgetPositionTracker.ts
  • packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
  • packages/ui-voip/src/context/useRegisterView.ts
  • packages/ui-voip/src/providers/useInstanceState.ts
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/context/MediaCallInstanceContext.ts
  • packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
  • packages/ui-voip/src/providers/useMediaSession.ts
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx
  • packages/ui-voip/src/context/definitions.d.ts
  • packages/ui-voip/src/providers/MockedMediaCallProvider.tsx
  • packages/ui-voip/src/providers/MediaCallViewProvider.tsx
  • packages/ui-voip/src/providers/MockedInstanceProvider.tsx
  • packages/ui-voip/src/context/MediaCallViewContext.ts
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/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.tsx
  • packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx
  • packages/ui-voip/src/views/MediaCallPopout.tsx
  • packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx
  • packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx
  • packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx
  • packages/ui-voip/src/providers/MockedMediaCallProvider.tsx
  • packages/ui-voip/src/providers/MediaCallViewProvider.tsx
  • packages/ui-voip/src/providers/MockedInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/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.tsx
  • packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx
  • packages/ui-voip/src/views/MediaCallPopout.tsx
  • packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx
  • packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx
  • packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx
  • packages/ui-voip/src/providers/MockedMediaCallProvider.tsx
  • packages/ui-voip/src/providers/MediaCallViewProvider.tsx
  • packages/ui-voip/src/providers/MockedInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/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.tsx
  • packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx
  • packages/ui-voip/src/views/MediaCallPopout.tsx
  • packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx
  • packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx
  • packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx
  • packages/ui-voip/src/providers/MockedMediaCallProvider.tsx
  • packages/ui-voip/src/providers/MediaCallViewProvider.tsx
  • packages/ui-voip/src/providers/MockedInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/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.tsx
  • packages/ui-voip/src/views/MediaCallWidget/OngoingCallWithScreen.tsx
  • packages/ui-voip/src/views/MediaCallPopout.tsx
  • packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx
  • packages/ui-voip/src/context/useWidgetExternalControls.ts
  • packages/ui-voip/src/components/Widget/WidgetDraggableProvider.tsx
  • packages/ui-voip/src/providers/useWidgetPositionTracker.ts
  • packages/ui-voip/src/context/usePeerAutocomplete.spec.tsx
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
  • packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.stories.tsx
  • packages/ui-voip/src/context/useRegisterView.ts
  • packages/ui-voip/src/providers/useInstanceState.ts
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/context/MediaCallInstanceContext.ts
  • packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
  • packages/ui-voip/src/providers/useMediaSession.ts
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidgetViewRouter.tsx
  • packages/ui-voip/src/context/definitions.d.ts
  • packages/ui-voip/src/providers/MockedMediaCallProvider.tsx
  • packages/ui-voip/src/providers/MediaCallViewProvider.tsx
  • packages/ui-voip/src/providers/MockedInstanceProvider.tsx
  • packages/ui-voip/src/context/MediaCallViewContext.ts
  • packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/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.ts
  • packages/ui-voip/src/providers/useWidgetPositionTracker.ts
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
  • packages/ui-voip/src/context/useRegisterView.ts
  • packages/ui-voip/src/providers/useInstanceState.ts
  • packages/ui-voip/src/context/MediaCallInstanceContext.ts
  • packages/ui-voip/src/providers/useMediaSession.ts
  • packages/ui-voip/src/context/definitions.d.ts
  • packages/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.ts
  • packages/ui-voip/src/providers/useWidgetPositionTracker.ts
  • packages/ui-voip/src/providers/useAvailableViewTracker.ts
  • packages/ui-voip/src/context/useRegisterView.ts
  • packages/ui-voip/src/providers/useInstanceState.ts
  • packages/ui-voip/src/context/MediaCallInstanceContext.ts
  • packages/ui-voip/src/providers/useMediaSession.ts
  • packages/ui-voip/src/context/definitions.d.ts
  • packages/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.tsx
  • packages/ui-voip/src/context/usePeekMediaSessionState.spec.tsx
  • packages/ui-voip/src/hooks/useMediaCallOpenRoomTracker.spec.tsx
  • packages/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!

Comment thread packages/ui-voip/src/providers/MockedInstanceProvider.tsx
Comment thread packages/ui-voip/src/providers/useAvailableViewTracker.ts Outdated

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 27 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/ui-voip/src/providers/useAvailableViewTracker.ts Outdated
Comment thread packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx
Comment thread packages/ui-voip/src/providers/useInstanceState.ts
Comment thread packages/ui-voip/src/providers/useWidgetPositionTracker.ts
ggazzo
ggazzo previously approved these changes Aug 4, 2026
@ggazzo
ggazzo force-pushed the ui-voip/refactorSessionState branch from e34b7e6 to bef9397 Compare August 4, 2026 19:12

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread packages/ui-voip/src/providers/useAvailableViewTracker.ts
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Aug 5, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 5, 2026
@ggazzo
ggazzo merged commit 692be5e into develop Aug 5, 2026
54 of 56 checks passed
@ggazzo
ggazzo deleted the ui-voip/refactorSessionState branch August 5, 2026 12:54
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 type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants