-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: Fix ui-voip package folder structure
#37593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughReorganizes the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37593 +/- ##
========================================
Coverage 68.83% 68.83%
========================================
Files 3361 3361
Lines 114341 114340 -1
Branches 20619 20619
========================================
+ Hits 78704 78707 +3
+ Misses 33541 33538 -3
+ Partials 2096 2095 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/ui-voip/src/views/MediaCallWidget/OutgoingCall.stories.tsx (1)
5-5: Verify MockedMediaCallProvider is exported as a named export.Same as in IncomingCallTransfer.stories.tsx - the import style changed from default to named. This should be verified along with the previous file to ensure consistency.
🧹 Nitpick comments (1)
packages/ui-voip/src/index.ts (1)
1-5: Public API aliasing and backward compatibility for media call hooksThis top-level barrel looks clean, and aliasing
useMediaCallExternalContextasuseMediaCallContextis a reasonable public API choice. The only risk is existing consumers that might still importuseMediaCallExternalContextfrom this package or from the old./v2paths.If you want to keep top-level BC while standardizing on
useMediaCallContextfor new code, you could additionally re-export the original name:-export { MediaCallContext, useMediaCallExternalContext as useMediaCallContext, type PeerInfo } from './context'; +export { + MediaCallContext, + useMediaCallExternalContext, + useMediaCallExternalContext as useMediaCallContext, + type PeerInfo, +} from './context';And please double-check that all internal callers were updated off
./v2/*paths and, if any external packages import from@rocket.chat/ui-voip, that their expectations still match this surface.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
packages/ui-voip/src/views/MediaCallWidget/__snapshots__/MediaCallWidget.spec.tsx.snapis excluded by!**/*.snappackages/ui-voip/src/views/PermissionFlow/__snapshots__/PermissionFlowModal.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (35)
packages/ui-voip/src/components/DevicePicker.tsx(1 hunks)packages/ui-voip/src/components/Keypad/Keypad.stories.tsx(1 hunks)packages/ui-voip/src/components/Keypad/useKeypad.tsx(1 hunks)packages/ui-voip/src/components/PeerAutocomplete.tsx(1 hunks)packages/ui-voip/src/components/PeerInfo/InternalUser.tsx(1 hunks)packages/ui-voip/src/components/PeerInfo/useInfoSlots.ts(1 hunks)packages/ui-voip/src/components/Widget/Widget.tsx(1 hunks)packages/ui-voip/src/components/index.ts(1 hunks)packages/ui-voip/src/context/MediaCallContext.ts(1 hunks)packages/ui-voip/src/context/MediaCallProvider.tsx(1 hunks)packages/ui-voip/src/context/index.ts(1 hunks)packages/ui-voip/src/context/useDesktopNotifications.ts(1 hunks)packages/ui-voip/src/hooks/VoipPopupDraggable/DraggableCore.ts(1 hunks)packages/ui-voip/src/hooks/index.ts(1 hunks)packages/ui-voip/src/hooks/useDevicePermissionPrompt.tsx(1 hunks)packages/ui-voip/src/hooks/useMediaCallAction.ts(1 hunks)packages/ui-voip/src/index.ts(1 hunks)packages/ui-voip/src/v2/index.ts(0 hunks)packages/ui-voip/src/views/MediaCallWidget/IncomingCall.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/IncomingCall.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/NewCall.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/OngoingCall.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/OngoingCall.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/OutgoingCall.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/OutgoingCall.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.tsx(1 hunks)packages/ui-voip/src/views/MediaCallWidget/index.ts(1 hunks)packages/ui-voip/src/views/TransferModal.tsx(1 hunks)packages/ui-voip/src/views/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- packages/ui-voip/src/v2/index.ts
🧰 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/components/PeerInfo/InternalUser.tsxpackages/ui-voip/src/views/MediaCallWidget/IncomingCall.tsxpackages/ui-voip/src/views/MediaCallWidget/index.tspackages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.stories.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsxpackages/ui-voip/src/components/DevicePicker.tsxpackages/ui-voip/src/context/useDesktopNotifications.tspackages/ui-voip/src/views/MediaCallWidget/OutgoingCall.tsxpackages/ui-voip/src/hooks/useMediaCallAction.tspackages/ui-voip/src/views/MediaCallWidget/IncomingCall.stories.tsxpackages/ui-voip/src/views/index.tspackages/ui-voip/src/components/Widget/Widget.tsxpackages/ui-voip/src/views/TransferModal.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.stories.tsxpackages/ui-voip/src/context/index.tspackages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.tsxpackages/ui-voip/src/hooks/useDevicePermissionPrompt.tsxpackages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.stories.tsxpackages/ui-voip/src/views/MediaCallWidget/OutgoingCall.stories.tsxpackages/ui-voip/src/context/MediaCallContext.tspackages/ui-voip/src/hooks/VoipPopupDraggable/DraggableCore.tspackages/ui-voip/src/components/PeerAutocomplete.tsxpackages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsxpackages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.tsxpackages/ui-voip/src/components/Keypad/Keypad.stories.tsxpackages/ui-voip/src/views/MediaCallWidget/OngoingCall.stories.tsxpackages/ui-voip/src/context/MediaCallProvider.tsxpackages/ui-voip/src/views/MediaCallWidget/NewCall.tsxpackages/ui-voip/src/components/PeerInfo/useInfoSlots.tspackages/ui-voip/src/views/MediaCallWidget/OngoingCall.tsxpackages/ui-voip/src/components/index.tspackages/ui-voip/src/index.tspackages/ui-voip/src/hooks/index.tspackages/ui-voip/src/components/Keypad/useKeypad.tsx
🧠 Learnings (4)
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
packages/ui-voip/src/views/MediaCallWidget/IncomingCall.tsx
📚 Learning: 2025-11-19T18:20:37.116Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: apps/meteor/server/services/media-call/service.ts:141-141
Timestamp: 2025-11-19T18:20:37.116Z
Learning: In apps/meteor/server/services/media-call/service.ts, the sendHistoryMessage method should use call.caller.id or call.createdBy?.id as the message author, not call.transferredBy?.id. Even for transferred calls, the message should appear in the DM between the two users who are calling each other, not sent by the person who transferred the call.
Applied to files:
packages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.stories.tsxpackages/ui-voip/src/hooks/useMediaCallAction.tspackages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.tsxpackages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.stories.tsxpackages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.tsx
📚 Learning: 2025-11-17T22:38:48.631Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37505
File: packages/i18n/src/locales/en.i18n.json:3765-3765
Timestamp: 2025-11-17T22:38:48.631Z
Learning: Rocket.Chat i18n copy: Keep sentence case for the value of "Notification_Desktop_show_voice_calls" in packages/i18n/src/locales/en.i18n.json (“Show desktop notifications for voice calls”) per design directive; do not change to Title Case even if nearby labels differ.
Applied to files:
packages/ui-voip/src/context/useDesktopNotifications.ts
📚 Learning: 2025-10-28T19:39:58.182Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37328
File: packages/ui-voip/src/v2/useTonePlayer.ts:29-30
Timestamp: 2025-10-28T19:39:58.182Z
Learning: In packages/ui-voip/src/v2/useTonePlayer.ts, the DTMF tones generated by TonePlayer are for local auditory feedback to the user only. The actual DTMF signals are transmitted separately through the WebRTC channel. Therefore, filter configurations should prioritize user comfort and audio quality over technical DTMF frequency accuracy.
Applied to files:
packages/ui-voip/src/components/Keypad/Keypad.stories.tsx
🔇 Additional comments (32)
packages/ui-voip/src/context/useDesktopNotifications.ts (1)
7-7: LGTM! Import path updated correctly.The relative path adjustment aligns with the folder structure reorganization.
packages/ui-voip/src/components/Keypad/Keypad.stories.tsx (1)
4-4: LGTM! Import path updated correctly.The path adjustment correctly resolves useTonePlayer from the centralized context module.
packages/ui-voip/src/components/PeerInfo/useInfoSlots.ts (1)
5-5: LGTM! Import path updated correctly.The ConnectionState type is now imported from the centralized context barrel, consistent with the folder reorganization.
packages/ui-voip/src/hooks/useMediaCallAction.ts (1)
5-6: LGTM! Import paths updated correctly.Both imports now resolve from the centralized context barrel, consistent with the folder reorganization.
packages/ui-voip/src/context/MediaCallContext.ts (1)
7-7: LGTM! Import path updated correctly.The relative path adjustment correctly resolves PeerAutocompleteOptions from the components module.
packages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.stories.tsx (1)
5-5: Code changes verified as correct.The import change from default to named is consistent across the codebase. The
context/index.tsproperly exports MockedMediaCallProvider as a named export (export { default as MockedMediaCallProvider }), and all seven story files—including IncomingCallTransfer.stories.tsx—correctly import it using the named import syntax from../../context.packages/ui-voip/src/components/Keypad/useKeypad.tsx (1)
6-6: Import change verified as correct.Keypad is properly exported as default from
Keypad.tsx(line 43), and the updated import inuseKeypad.tsx(line 6) is consistent with other files likeKeypad.stories.tsx. No orphaned or inconsistent imports were found. The change is correctly implemented.packages/ui-voip/src/views/MediaCallWidget/IncomingCall.tsx (1)
4-5: Import path consolidation looks correctSwitching to the
../../componentsand../../contextbarrels keeps usage unchanged and improves structure; all imported identifiers are referenced in this component.packages/ui-voip/src/views/MediaCallWidget/OutgoingCall.tsx (1)
4-5: Consistent use of shared barrels for widget and contextThe updated imports from
../../componentsand../../contextmatch the new organization and keep runtime behavior intact.packages/ui-voip/src/views/MediaCallWidget/index.ts (1)
7-7: MediaCallWidget barrel export fits existing patternAdding
MediaCallWidgetas a named export from this barrel is consistent with the other view exports and should make consumption fromviewscleaner, assuming./MediaCallWidgetcontinues to expose a default export.packages/ui-voip/src/hooks/VoipPopupDraggable/DraggableCore.ts (1)
1-3: Good use ofimport typefor OffCallbackHandlerConverting
OffCallbackHandlerto a type-only import matches its usage (types only) and avoids unnecessary runtime coupling to@rocket.chat/emitter.packages/ui-voip/src/components/PeerAutocomplete.tsx (1)
6-6: Context utility import re-pointed correctlyImporting
isFirstPeerAutocompleteOptionfrom the../contextbarrel aligns with the new context structure and leaves the autocomplete behavior unchanged.packages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.tsx (1)
4-5: Barrel-based imports for transfer view are consistentUsing
../../componentsand../../contexthere matches the rest of the MediaCallWidget views, with all imported symbols used as before.packages/ui-voip/src/components/PeerInfo/InternalUser.tsx (1)
4-4: Slot type import localized to PeerInfo subtreePointing
Slotto the sibling./useInfoSlotskeeps types local to the PeerInfo module and doesn’t affect runtime behavior.packages/ui-voip/src/views/MediaCallWidget/IncomingCall.stories.tsx (1)
5-5: Story now uses context barrel for MockedMediaCallProviderSwitching to the named
MockedMediaCallProviderfrom../../contextkeeps the story API identical while centralizing test providers under the context barrel. Just ensure the barrel re-exports this provider under the same name.packages/ui-voip/src/views/MediaCallWidget/OngoingCall.tsx (1)
4-19: LGTM! Import reorganization aligns with barrel file structure.The import paths have been correctly updated to use centralized barrel exports from
../../componentsand../../context, which improves maintainability and provides a cleaner public API surface.packages/ui-voip/src/views/MediaCallWidget/IncomingCallTransfer.tsx (1)
4-5: LGTM! Consistent barrel import pattern.Import paths correctly updated to use centralized exports, maintaining consistency with the broader refactoring effort.
packages/ui-voip/src/views/TransferModal.tsx (1)
15-16: LGTM! Import paths correctly updated.The imports now properly reference the centralized barrel exports from
../componentsand../context, maintaining consistency with the package restructuring.packages/ui-voip/src/views/MediaCallWidget/NewCall.tsx (1)
4-15: LGTM! Barrel imports properly configured.The import paths correctly resolve to the centralized barrel exports, consistent with the package-wide refactoring to consolidate module access points.
packages/ui-voip/src/components/Widget/Widget.tsx (1)
8-8: LGTM! Hook import consolidated through barrel.The
useDraggableimport now correctly uses the centralized hooks barrel, improving code organization.packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.tsx (1)
1-2: LGTM! View imports consolidated through parent barrel.The import paths correctly leverage the views barrel export (
..) and the context barrel (../../context), completing the centralized import pattern across the package.packages/ui-voip/src/hooks/index.ts (1)
2-3: LGTM! Hooks barrel extended appropriately.Verification confirms both exported modules exist and no circular dependencies are present:
DraggableCore.tsimports from@rocket.chat/emitter,@rocket.chat/ui-client, and ReactuseMediaCallAction.tsimports from@rocket.chat/icons, React,react-i18next, and the context module- Neither module imports from the hooks barrel, preventing circular dependencies
packages/ui-voip/src/components/index.ts (1)
8-9: LGTM! Barrel exports verified safe.Verification confirms neither hook file imports from the parent barrel export, eliminating circular dependency risk. Both
useKeypadanduseInfoSlotsonly depend on external packages and local siblings; no back-references tocomponents/indexexist.packages/ui-voip/src/views/MediaCallWidget/MediaCallWidget.stories.tsx (1)
6-6: Context barrel import is consistent and correctly usedImporting
useMediaCallContextandMockedMediaCallProviderfrom../../contextmatches the new context barrel and aligns with their usage in this story; no behavior change introduced.packages/ui-voip/src/components/DevicePicker.tsx (1)
11-12: Import path updates match the new folder layout
../contextand../hooks/useDevicePermissionPromptcorrectly target the shared context barrel and hooks location fromsrc/components; symbol names and usages remain unchanged.packages/ui-voip/src/views/MediaCallWidget/OutgoingCallTransfer.stories.tsx (1)
5-5: Story now correctly consumes MockedMediaCallProvider from the context barrelSwitching to
import { MockedMediaCallProvider } from '../../context';is consistent with the centralized context exports and keeps the story logic intact.packages/ui-voip/src/views/MediaCallWidget/OngoingCall.stories.tsx (1)
5-5: Consistent use of context barrel in ongoing-call storiesImporting
MockedMediaCallProviderfrom../../contextaligns this file with the shared context barrel pattern and keeps the stories’ behavior unchanged.packages/ui-voip/src/views/MediaCallWidget/NewCall.stories.tsx (1)
5-5: NewCall story correctly sources MockedMediaCallProvider from the context barrelThe switch to
../../contextforMockedMediaCallProvideris consistent with the rest of the MediaCallWidget stories and does not alter runtime behavior.packages/ui-voip/src/views/index.ts (1)
1-3: Views barrel exports line up with new consumer importsThis index groups
TransferModal, allMediaCallWidgetexports, andPermissionFlowModal(+ its type) behind a single../viewsentry point, matching the updated imports elsewhere and improving structure without changing behavior.packages/ui-voip/src/hooks/useDevicePermissionPrompt.tsx (1)
5-5: PermissionFlowModal now correctly imported via the views barrelUsing
import { PermissionFlowModal, type PermissionFlowModalType } from '../views';matches the newviews/index.tsexports and keeps the hook’s behavior identical.packages/ui-voip/src/context/MediaCallProvider.tsx (1)
28-29: MediaCallProvider imports are aligned with the new views structureImporting
MediaCallWidgetfrom the../viewsbarrel andTransferModalfrom../views/TransferModalmatches the reorganized views layout and keeps the provider’s rendering logic unchanged.packages/ui-voip/src/context/index.ts (1)
1-4: Context barrel looks good; verify underlying exports and consumer updatesThe context barrel cleanly centralizes exports (
MediaCallContext, both media call hooks, autocomplete helpers, types, andMockedMediaCallProvider) and matches the intended public surface.Two things to confirm:
./MediaCallContextand./MockedMediaCallProvideractually export all of these symbols with the exact names used here (includingusePeerAutocompleteandisFirstPeerAutocompleteOption), to avoid silent export-undefined issues.- All updated consumers now import from
../../context(or the package root where appropriate) rather than reaching into deeper paths, so future structure changes remain localized to this barrel.If both are true, this file is in good shape.
Proposed changes (including videos or screenshots)
Issue(s)
VGA-81
Steps to test or reproduce
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.