-
Notifications
You must be signed in to change notification settings - Fork 13.1k
feat: Call History Table #37839
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
feat: Call History Table #37839
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a Call History feature: new route and page, React Query data fetching with filters/sorting/pagination, table and row components, contextual bars, NavBar integration, UI kit updates, i18n keys, and API surface exports across Meteor app and ui-voip package. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NavBar
participant Router
participant CallHistoryPage
participant ReactQuery
participant Server
participant MediaTable
participant ContextBar
User->>NavBar: Click "Call history"
NavBar->>Router: navigate('/call-history')
Router->>CallHistoryPage: mount
CallHistoryPage->>ReactQuery: query call-history.list(filters, sort, page)
ReactQuery->>Server: GET /v1/call-history.list
Server-->>ReactQuery: return data
ReactQuery-->>CallHistoryPage: data ready
CallHistoryPage->>MediaTable: render rows
User->>MediaTable: click row
MediaTable->>ContextBar: open(details for historyId)
ContextBar->>Server: fetch call-history.info(historyId)
Server-->>ContextBar: details
ContextBar->>User: render details & actions (voiceCall, openUserInfo)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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 |
774be00 to
6f04491
Compare
6f04491 to
f9beea8
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #37839 +/- ##
===========================================
- Coverage 67.70% 67.69% -0.01%
===========================================
Files 3475 3476 +1
Lines 113871 113895 +24
Branches 20947 20956 +9
===========================================
+ Hits 77096 77104 +8
- Misses 34587 34605 +18
+ Partials 2188 2186 -2
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.
Pull request overview
This PR introduces a comprehensive Call History Table feature that allows users to view, filter, and interact with their call history. The implementation includes a new dedicated page with filtering capabilities, table components for displaying call records, and integration points throughout the application's navigation.
Key Changes:
- New MediaCallHistoryTable component with sortable columns for contact, type, status, and timestamp
- Call history page with search, type filtering (inbound/outbound), and status filtering capabilities
- Refactored call history components to be reusable across different contexts (moved to shared components)
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui-voip/src/views/MediaCallHistoryTable/* | New table components for displaying call history with rows, status indicators, and contact information |
| packages/ui-voip/src/components/CallHistory*.tsx | Moved and enhanced internal/external user components for reusability |
| packages/ui-voip/src/ui-kit/getHistoryMessagePayload.ts | Refactored to extract getCallDurationText for table usage |
| apps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsx | Main call history page with table, filters, and contextual sidebar |
| apps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx | Filter components for search, direction, and status |
| apps/meteor/client/views/mediaCallHistory/CallHistoryRow*.tsx | Row components for different contact types (internal, external, unknown) |
| apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar*.tsx | Refactored contextual bar to support both room and page contexts |
| apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts | Refactored hook to support flexible navigation contexts |
| apps/meteor/client/startup/routes.tsx | Added /call-history route with optional tab and historyId parameters |
| apps/meteor/client/NavBarV2/* | Added call history navigation items to NavBar |
| packages/ui-client/src/components/MultiSelectCustom/* | Enhanced to support icons in dropdown options |
| packages/i18n/src/locales/en.i18n.json | Added translations for new call history features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx
Show resolved
Hide resolved
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
Show resolved
Hide resolved
packages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.stories.tsx
Outdated
Show resolved
Hide resolved
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsx
Show resolved
Hide resolved
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsx
Show resolved
Hide resolved
apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/callHistoryTable
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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx (1)
15-48: Pass callHistoryItem to the child component.The
callHistoryItemprop is destructured from the props but not passed toNavBarControlsMenu. Since it's extracted separately from the spread operator, it won't be included in{...props}.Proposed fix
-const NavBarControlsWithCall = ({ omnichannelItems, isPressed, ...props }: NavBarControlsMenuProps) => { +const NavBarControlsWithCall = ({ omnichannelItems, isPressed, callHistoryItem, ...props }: NavBarControlsMenuProps) => { const { icon: omnichannelCallIcon, title: omnichannelCallTitle, handleOpenDialModal, isDisabled: callDialPadDisabled, } = useOmnichannelCallDialPadAction(); const { title: omnichannelCallTogglerTitle, icon: omnichannelCallTogglerIcon, handleToggleCall, isDisabled: callTogglerDisabled, } = useOmnichannelCallToggleAction(); const omnichannelItemsWithCall = [ ...omnichannelItems, { id: 'omnichannelCallDialPad', icon: omnichannelCallIcon, content: omnichannelCallTitle, onClick: handleOpenDialModal, disabled: callDialPadDisabled, }, { id: 'omnichannelCallToggler', icon: omnichannelCallTogglerIcon, content: omnichannelCallTogglerTitle, onClick: handleToggleCall, disabled: callTogglerDisabled, }, ] as GenericMenuItemProps[]; - return <NavBarControlsMenu omnichannelItems={omnichannelItemsWithCall} isPressed={isPressed} {...props} />; + return <NavBarControlsMenu omnichannelItems={omnichannelItemsWithCall} isPressed={isPressed} callHistoryItem={callHistoryItem} {...props} />; };
♻️ Duplicate comments (5)
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsx (1)
41-46: Acknowledge the TODO for type assertions.The
as anyassertions are noted with TODO comments. This is a known type limitation that should be addressed by updating the endpoint type definition to support the union of{ callId: string }and{ historyId: string }.The past review already flagged this. The TODO comments indicate awareness of the issue.
packages/ui-voip/src/views/MediaCallHistoryTable/index.ts (1)
2-3: Redundant export pattern for CallHistoryTableRow.CallHistoryTableRow is exported both as a default export (line 2) and through a wildcard export (line 3), creating confusion about which export pattern to use.
packages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.stories.tsx (2)
28-28: Default language mismatch.The default language is set to 'pt-BR' but all translations are provided in English, which will cause translation keys to display instead of actual text.
87-89: Avoid unsafe type assertion for contact types.The type is fixed to
CallHistoryTableInternalContact, butgetContact()returns a union ofCallHistoryTableInternalContact | CallHistoryTableExternalContact | CallHistoryUnknownContact. This type assertion defeats TypeScript's type checking.packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (1)
51-53: Type guard doesn't match the type definition.The type guard checks for
'_id' in contact && ('username' in contact || 'name' in contact), butCallHistoryTableInternalContactonly requires_id(lines 17-19 showusernameandnameare optional). A valid internal contact like{ _id: "123" }would fail this guard.Since
CallHistoryTableExternalContacthasnumberandCallHistoryUnknownContacthasunknown, checking for'_id'alone is sufficient to distinguish internal contacts.🔎 Proposed fix to match type definition
export const isCallHistoryTableInternalContact = (contact: CallHistoryTableRowContact): contact is CallHistoryTableInternalContact => { - return '_id' in contact && ('username' in contact || 'name' in contact); + return '_id' in contact; };
🧹 Nitpick comments (7)
packages/i18n/src/locales/en.i18n.json (1)
2033-2033: Status and direction strings are well-phrased; optional terminology alignment
Ended,Not_answered,Unknown,Inbound, andOutboundare concise and appropriate as call status/direction labels.
If you want absolute terminology consistency with existing keys likeIncoming/Outgoing, you could consider reusing those words here, but it’s not required for clarity.As per retrieved learnings, updating only
en.i18n.jsonis correct; no need to touch other locales.Also applies to: 3846-3846, 5506-5506, 6506-6506, 6757-6757
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx (1)
40-48: Type assertion can be tightened.The type assertion on line 41 assumes all entries have defined callbacks, but the filter on line 42 handles
undefinedvalues. Consider using a type guard for better type safety:🔎 Proposed refinement
const getItems = (actions: HistoryActionCallbacks, t: TFunction) => { - return (Object.entries(actions) as [HistoryActions, () => void][]) - .filter(([_, callback]) => callback) + return (Object.entries(actions) as [HistoryActions, (() => void) | undefined][]) + .filter((entry): entry is [HistoryActions, () => void] => Boolean(entry[1])) .map(([action, callback]) => ({ id: action, icon: iconDictionary[action], content: t(i18nDictionary[action]), onClick: callback, })); };apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (1)
17-23: Consider exporting the options type.The
UseMediaCallInternalHistoryActionsBaseOptionstype would be useful for consumers who need to type their props before passing them to this hook.🔎 Proposed change
-type UseMediaCallInternalHistoryActionsBaseOptions = { +export type UseMediaCallInternalHistoryActionsBaseOptions = { contact: InternalCallHistoryContact; messageId?: string; openRoomId?: string; messageRoomId?: string; openUserInfo?: (userId: string) => void; };packages/ui-voip/src/index.ts (1)
11-12: Consider explicit exports instead of wildcard re-export.Using
export *can unintentionally expose internal utilities from theMediaCallHistoryTablemodule. For a public package API, explicit exports provide better control over the public surface.🔎 Suggested explicit exports
-export * from './views/MediaCallHistoryTable'; +export { MediaCallHistoryTable, CallHistoryTableRow } from './views/MediaCallHistoryTable'; +export type { /* specific types if needed */ } from './views/MediaCallHistoryTable';Alternatively, if the wildcard pattern is intentional and consistent with the project's conventions for this package, this can be kept as-is.
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableUnknownContact.tsx (1)
2-2: Use the project's standard translation import.The import should use
@rocket.chat/ui-contextsinstead ofreact-i18nextdirectly to maintain consistency with the project's established pattern.Proposed fix
-import { useTranslation } from 'react-i18next'; +import { useTranslation } from '@rocket.chat/ui-contexts';apps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx (1)
61-66: Consider renaming for clarity.The function name
handleChangeTypeis misleading—it actually handles status filter changes (line 63 callsonChangeStates). Consider renaming tohandleChangeStatesorhandleStatusFilterChangeto match its purpose.🔎 Suggested rename
- const handleChangeType = useCallback( + const handleChangeStates = useCallback( (options: OptionProp[]) => { onChangeStates(options.map((option) => option.id) as StatesFilter); }, [onChangeStates], );And update the usage:
<MultiSelectCustom dropdownOptions={dropdownStatesOptions} defaultTitle='All_status' selectedOptionsTitle='Status' selectedOptions={selectedOptions} - setSelectedOptions={handleChangeType} + setSelectedOptions={handleChangeStates} />packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (1)
28-41: Simplify the conditional type for the contact property.The conditional type for
contactproperty (lines 30-34) is equivalent to simplycontact: T. The complex conditional structure doesn't provide additional type safety sinceTalready extendsCallHistoryTableRowContact.🔎 Proposed simplification
export type CallHistoryTableRowProps<T extends CallHistoryTableRowContact> = { _id: string; - contact: T extends CallHistoryTableInternalContact - ? CallHistoryTableInternalContact - : T extends CallHistoryTableExternalContact - ? CallHistoryTableExternalContact - : CallHistoryUnknownContact; + contact: T; type: 'outbound' | 'inbound'; status: CallHistoryItemState; duration: number; timestamp: string; onClick: () => void; menu: ReactNode; };
📜 Review details
Configuration used: Organization 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 (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (31)
apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx(1 hunks)apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx(1 hunks)apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx(4 hunks)apps/meteor/client/NavBarV2/NavBarVoipGroup/NavBarVoipGroup.tsx(1 hunks)apps/meteor/client/startup/routes.tsx(3 hunks)apps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/CallHistoryRowUnknownUser.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbarRoom.tsx(1 hunks)apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx(3 hunks)apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts(3 hunks)apps/meteor/client/views/room/providers/hooks/useCoreRoomRoutes.ts(1 hunks)packages/i18n/src/locales/en.i18n.json(9 hunks)packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx(2 hunks)packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx(3 hunks)packages/ui-voip/src/components/CallHistoryExternalUser.tsx(1 hunks)packages/ui-voip/src/components/index.ts(1 hunks)packages/ui-voip/src/index.ts(1 hunks)packages/ui-voip/src/ui-kit/getHistoryMessagePayload.ts(2 hunks)packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableDirection.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableStatus.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableUnknownContact.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.stories.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.tsx(1 hunks)packages/ui-voip/src/views/MediaCallHistoryTable/index.ts(1 hunks)packages/ui-voip/src/views/index.ts(1 hunks)
🧰 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/index.tspackages/ui-voip/src/views/MediaCallHistoryTable/index.tspackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableUnknownContact.tsxapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.stories.tsxapps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbarRoom.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableDirection.tsxapps/meteor/client/startup/routes.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableStatus.tsxapps/meteor/client/NavBarV2/NavBarVoipGroup/NavBarVoipGroup.tsxapps/meteor/client/views/room/providers/hooks/useCoreRoomRoutes.tspackages/ui-voip/src/components/CallHistoryExternalUser.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsxapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsxapps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.tsapps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsxpackages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsxapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsxpackages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowUnknownUser.tsxpackages/ui-voip/src/components/index.tspackages/ui-voip/src/views/index.tspackages/ui-voip/src/ui-kit/getHistoryMessagePayload.tsapps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsxpackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx
🧠 Learnings (11)
📓 Common learnings
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.
📚 Learning: 2025-12-18T15:18:23.819Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:23.819Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.
Applied to files:
packages/ui-voip/src/index.tspackages/ui-voip/src/views/MediaCallHistoryTable/index.tspackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableUnknownContact.tsxapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.stories.tsxapps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbarRoom.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableDirection.tsxapps/meteor/client/startup/routes.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableStatus.tsxapps/meteor/client/NavBarV2/NavBarVoipGroup/NavBarVoipGroup.tsxapps/meteor/client/views/room/providers/hooks/useCoreRoomRoutes.tspackages/ui-voip/src/components/CallHistoryExternalUser.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsxapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsxapps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.tsapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsxpackages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowUnknownUser.tsxpackages/ui-voip/src/components/index.tspackages/ui-voip/src/ui-kit/getHistoryMessagePayload.tsapps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsxpackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.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:
apps/meteor/client/startup/routes.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsxapps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsxapps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.tsapps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsxapps/meteor/client/views/mediaCallHistory/CallHistoryRowUnknownUser.tsxpackages/ui-voip/src/ui-kit/getHistoryMessagePayload.tsapps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsxpackages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx
📚 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/MediaCallHistoryTable/CallHistoryTableStatus.tsxpackages/i18n/src/locales/en.i18n.jsonpackages/ui-voip/src/ui-kit/getHistoryMessagePayload.tsapps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).
Applied to files:
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsxapps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.
Applied to files:
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.
Applied to files:
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx
📚 Learning: 2025-12-18T15:18:23.819Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:23.819Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, the claim is that internal call history items always have contactId equal to either caller.id or callee.id, so getContact will not produce undefined. Treat this as a file-specific guarantee and avoid adding guards that rely on other data sources in this path. If this invariant holds, you can rely on contact resolution not returning undefined, but consider adding a lightweight runtime assertion or a failing guard when the invariant is violated (e.g., throw or log) to surface unexpected data instead of silently handling undefined. This guideline applies only to this file path and should not be assumed project-wide without verification.
Applied to files:
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.
Applied to files:
packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsxpackages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
packages/i18n/src/locales/en.i18n.jsonapps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx
🧬 Code graph analysis (12)
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableUnknownContact.tsx (1)
packages/ui-contexts/src/index.ts (1)
useTranslation(81-81)
packages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.stories.tsx (3)
packages/mock-providers/src/index.ts (1)
mockAppRoot(3-3)packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (4)
CallHistoryTableInternalContact(16-20)CallHistoryTableExternalContact(12-14)CallHistoryUnknownContact(22-24)CallHistoryTableRowProps(28-41)packages/ui-client/src/components/GenericTable/hooks/useSort.ts (1)
useSort(5-34)
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableDirection.tsx (1)
packages/ui-contexts/src/index.ts (1)
useTranslation(81-81)
apps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsx (6)
packages/ui-contexts/src/index.ts (3)
useTranslation(81-81)useRouter(63-63)useRouteParameter(65-65)packages/ui-client/src/components/GenericTable/hooks/useSort.ts (1)
useSort(5-34)packages/ui-client/src/components/GenericTable/hooks/usePagination.ts (1)
usePagination(11-40)apps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx (1)
useCallHistoryPageFilters(34-52)packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (5)
CallHistoryTableExternalContact(12-14)CallHistoryUnknownContact(22-24)CallHistoryTableInternalContact(16-20)isCallHistoryUnknownContact(47-49)isCallHistoryTableInternalContact(51-53)packages/ui-client/src/components/GenericTable/GenericTableLoadingRow.tsx (1)
GenericTableLoadingRow(4-21)
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableStatus.tsx (2)
packages/core-typings/src/ICallHistoryItem.ts (1)
CallHistoryItemState(6-16)packages/ui-voip/src/ui-kit/getHistoryMessagePayload.ts (1)
getCallDurationText(39-51)
apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx (4)
packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx (1)
HistoryActionCallbacks(8-10)packages/ui-contexts/src/index.ts (1)
useTranslation(81-81)apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (1)
useMediaCallInternalHistoryActions(25-98)packages/media-signaling/src/lib/Call.ts (1)
contact(81-83)
apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (2)
packages/media-signaling/src/lib/Call.ts (1)
contact(81-83)apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts (1)
openUserInfo(99-101)
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx (2)
apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (1)
useMediaCallInternalHistoryActions(25-98)apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts (1)
openUserInfo(99-101)
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (4)
packages/core-typings/src/ICallHistoryItem.ts (1)
CallHistoryItemState(6-16)packages/ui-contexts/src/index.ts (1)
useLanguage(39-39)packages/ui-client/src/components/GenericTable/GenericTableRow.tsx (1)
GenericTableRow(6-6)packages/ui-client/src/components/GenericTable/GenericTableCell.tsx (1)
GenericTableCell(6-6)
apps/meteor/client/views/mediaCallHistory/CallHistoryRowUnknownUser.tsx (1)
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (2)
CallHistoryTableRowProps(28-41)CallHistoryUnknownContact(22-24)
packages/ui-voip/src/ui-kit/getHistoryMessagePayload.ts (1)
packages/ui-kit/src/index.ts (1)
TextObject(7-7)
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsx (3)
apps/meteor/client/lib/queryKeys.ts (1)
callHistoryQueryKeys(162-165)apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx (1)
isInternalCallHistoryItem(20-22)apps/meteor/client/views/mediaCallHistory/MediaCallHistoryExternal.tsx (1)
isExternalCallHistoryItem(21-23)
⏰ 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). (2)
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (28)
packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx (1)
4-4: LGTM! Clean type extension for icon support.The import of
IconNamesand the optionaliconproperty onOptionPropare well-typed and maintain backward compatibility. The type signature properly constrains icon names and color values.Also applies to: 30-30
packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx (2)
1-1: LGTM! Well-structured color mapping helper.The
OptionIconimport andgetIconColorhelper function are cleanly implemented. The color token mapping follows a sensible pattern, returningundefinedfor default cases to let the component use its default styling.Also applies to: 10-20
61-61: LGTM! Clean conditional icon rendering.The icon rendering is properly guarded by the
option.iconcheck, ensuring type safety. The spacing (mie={4}) provides appropriate visual separation from the text.packages/i18n/src/locales/en.i18n.json (1)
494-494: Call history labels and filters look consistent and clear
All_directions,Call_history,Search_calls, andTime_slash_Datefollow existing naming/capitalization patterns (e.g., “All_*”, “Search *”) and read naturally in the Call History UI. No changes needed.Also applies to: 1000-1000, 4751-4751, 5340-5340
apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbarRoom.tsx (1)
7-19: LGTM!The component properly bridges the room context to the prop-driven
MediaCallHistoryContextualbar. TheuseCallbackmemoization foropenUserInfois appropriate, and the prop wiring is clean.apps/meteor/client/views/room/providers/hooks/useCoreRoomRoutes.ts (1)
3-8: LGTM!The import and
tabComponentreference correctly point to the newMediaCallHistoryContextualbarRoomcomponent, which properly bridges the room context to the prop-drivenMediaCallHistoryContextualbar.packages/ui-voip/src/components/CallHistoryExternalUser.tsx (1)
5-18: LGTM!The
showIconprop is cleanly implemented with a sensible default oftruefor backward compatibility. The conditional rendering logic is straightforward.apps/meteor/client/views/mediaCallHistory/CallHistoryRowInternalUser.tsx (1)
64-74: Verify thecontactobject construction.The contact object construction looks correct. Note that:
username: contact.username ?? ''is necessary becauseCallHistoryTableInternalContact.usernameis optional butInternalCallHistoryContact.usernamerequires a string.- The
openUserInfowrapper correctly capturesridfrom the component's scope and passesuserIdfrom the hook's invocation.apps/meteor/client/views/mediaCallHistory/MediaCallHistoryContextualbar.tsx (1)
18-34: LGTM on the prop-driven refactor.The new
MediaCallHistoryContextualbarPropstype cleanly defines the component's interface, and the destructured props provide clear control flow. This makes the component more testable and reusable compared to the previous route-parameter-based approach.apps/meteor/client/views/mediaCallHistory/useMediaCallInternalHistoryActions.ts (2)
89-97: VerifyjumpToMessageavailability logic.The
jumpToMessageaction is only returned when bothmessageIdandmessageRoomIdare provided (line 93), but thejumpToMessagefunction itself can work withopenRoomIdas a fallback (line 68). Is this intentional restriction, or should the condition bemessageId && (messageRoomId || openRoomId)?
53-65: LGTM on direct message navigation logic.The
goToDirectMessagememoization correctly prioritizesdirectMessage.onClickwhen available, and falls back to router navigation only whenmessageRoomIdexists withoutopenRoomId. This aligns with the author's previous clarification that whenopenRoomIdexists, the action should come fromuseDirectMessageAction.apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx (1)
36-56: LGTM! Clean integration of new props with existing logic.The conditional wrapping of
openUserInfoon line 55 correctly adapts the two-parameter signature(userId, rid)to the single-parameter signature expected byuseMediaCallInternalHistoryActions. The fallback forridon line 48 ensures the hook receives a valid room ID.packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryContextualbar.tsx (1)
20-20: LGTM! Clean import consolidation.Centralizing component imports through the barrel export improves maintainability and consistency across the package.
apps/meteor/client/NavBarV2/NavBarVoipGroup/NavBarVoipGroup.tsx (1)
12-22: LGTM! Navigation implementation is clean.The
useCallbackcorrectly memoizes the navigation handler withrouteras dependency.Note: The Call History item only renders when
callActionis truthy (lines 15-17). Please verify this is intentional—if call history should be accessible even when VoIP is temporarily unavailable, the guard may need adjustment.apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx (1)
13-23: LGTM! Clean extension of menu items.The array construction with
filter(Boolean)correctly handles the optional nature of bothcallItemandcallHistoryItem, and the type assertion is appropriate given TypeScript's type narrowing limitations withfilter.packages/ui-voip/src/views/index.ts (1)
4-4: LGTM!The export follows the established pattern and properly exposes the MediaCallHistoryTable module.
packages/ui-voip/src/components/index.ts (1)
13-14: LGTM!The exports follow the established pattern and properly expose the call history user components.
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableDirection.tsx (1)
1-15: LGTM!The component correctly maps direction to icons and renders a clean, accessible layout with translated labels.
packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableStatus.tsx (1)
1-68: LGTM!The component cleanly separates state-to-UI mapping logic into focused helper functions and correctly handles optional duration display. The implementation follows good practices.
apps/meteor/client/views/mediaCallHistory/CallHistoryRowUnknownUser.tsx (1)
1-30: LGTM!The component appropriately handles unknown contacts by providing an empty menu (no actions available) while maintaining the same row structure. The onClick handler correctly forwards the history ID.
packages/ui-voip/src/ui-kit/getHistoryMessagePayload.ts (1)
39-63: LGTM!Excellent refactoring that extracts the duration formatting logic into a reusable
getCallDurationTexthelper. This enables the UI components to display plain duration text without markdown, while maintaining backward compatibility for the message payload formatting.apps/meteor/client/views/mediaCallHistory/CallHistoryRowExternalUser.tsx (1)
1-47: LGTM!The component correctly provides a voice call action for external contacts when the widget is available. The conditional action creation and memoization are properly implemented.
apps/meteor/client/views/mediaCallHistory/CallHistoryPage.tsx (3)
19-43: LGTM!The helper functions correctly map UI sorting and filtering to API parameters. The
getStateFilterappropriately treats 'failed' and 'error' as synonymous, and the sort logic includes sensible secondary sorting by timestamp.
103-165: LGTM!The query integration is well-implemented with all dependencies properly tracked in the queryKey. The data transformation logic appropriately handles external, internal, and unknown contact types with defensive checks for missing data.
167-238: LGTM!The page rendering handles loading, error, and success states appropriately. The row rendering uses type guards to select the correct component variant, and the contextual bar integration is clean.
packages/ui-voip/src/views/MediaCallHistoryTable/MediaCallHistoryTable.tsx (1)
1-50: LGTM!The table component provides a clean, sortable interface with appropriate column headers and proper sorting state management. The implementation follows established patterns from the ui-client GenericTable components.
apps/meteor/client/views/mediaCallHistory/CallHistoryPageFilters.tsx (1)
20-32: All translation keys are defined. The keys 'Inbound', 'Outbound', 'All_directions', 'Filter_By_Status', 'Ended', 'Not_answered', 'Transferred', and 'Failed' all exist in en.i18n.json.packages/ui-voip/src/views/MediaCallHistoryTable/CallHistoryTableRow.tsx (1)
67-67: Verify the ARIA role for the clickable table row.The row uses
role='link'with anonClickhandler. According to ARIA specifications,role='link'should be used for navigation to a new page or location, whilerole='button'is more appropriate for interactive elements that perform actions. Confirm whether clicking this row performs navigation or an action.Additionally, using
role='link'on a table row is semantically unusual—the more common pattern is to have a link inside a cell or userole='button'for the entire row.
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
🧹 Nitpick comments (2)
packages/i18n/src/locales/en.i18n.json (2)
4752-4752: Search_calls label matches other “Search_*” inputsThe phrasing is consistent with nearby keys like
Search_Apps,Search_Channels. Any capitalization differences are already present in adjacent keys, so this is acceptable.
5508-5508: Unknown key addition is reasonable alongside existingunknownHaving both
unknownandUnknownallows case‑specific reuse in different contexts. Just ensure both are used intentionally to avoid confusion later.
📜 Review details
Configuration used: Organization 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 selected for processing (1)
packages/i18n/src/locales/en.i18n.json(9 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:31.688Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
packages/i18n/src/locales/en.i18n.json
📚 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/i18n/src/locales/en.i18n.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (7)
packages/i18n/src/locales/en.i18n.json (7)
494-494: All_directions label aligns with existing “All_*” filtersKey name and value follow existing patterns like
All_status,All_time. No issues spotted.
1000-1000: Call_history key is consistent with existing call copyPaired nicely with
Call_history_provides_a_record...and fits other navigation/section labels. Looks good.
2033-2033: Ended status string looks correctShort, neutral past-tense status suitable for call history / filters; no conflicts found with existing keys.
3847-3847: Not_answered call status is clear and unambiguousText matches existing phrasing such as
Call_was_not_answered; safe to use as a compact label.
5342-5342: Time_slash_Date header looks appropriateGood concise column/label text; no formatting or spacing issues.
6508-6508: Inbound label matches telephony terminology
Inboundas a standalone direction term is consistent with existingIncoming-style wording and fits call filters.
6759-6759: Outbound label complements Inbound for direction filtersPairs cleanly with
Inboundand with existing call-related keys; no localization or naming issues noticed.
Co-authored-by: Tasso Evangelista <2263066+tassoevan@users.noreply.github.com>
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.