Skip to main content

Overview

The CometChatCallLogs component displays a paginated, scrollable list of call history records for the logged-in user. Each call log entry shows the other party’s avatar and name, the call direction (incoming, outgoing, or missed), the call type (audio or video), and the timestamp. Users can initiate new calls directly from the list and view real-time call overlays for outgoing and ongoing calls. The component follows a Service-based Architecture where:
  • CallLogsService handles call log fetching, pagination, call initiation, call lifecycle listeners, and state management via Angular signals
  • Component manages UI rendering, template overrides, and user interactions
  • Templates allow extensive customization of all UI sections

Key Features

  • Pagination: Automatic infinite-scroll pagination via CallLogRequestBuilder from the CometChat Calls SDK
  • Call Initiation: Start audio or video calls directly from a call log entry’s trailing button
  • Call Overlays: Built-in outgoing call screen and ongoing call screen overlays with automatic lifecycle management
  • Template Overrides: Extensive ng-template projection for item, leading, title, subtitle, trailing, loading, empty, and error views
  • Keyboard Accessibility: Full keyboard navigation with arrow keys, Enter, and Tab support (WCAG 2.1 Level AA compliant)
  • Active Call Highlighting: Highlight a specific call log entry via the activeCall input
  • Custom Date Formatting: Configurable call timestamp formatting with CalendarObject support
  • Error Handling: Comprehensive error handling with custom error views and onError callback
Live Preview — default call logs preview. Open in Storybook ↗

Keyboard Accessibility

CometChatCallLogs is fully keyboard accessible and meets WCAG 2.1 Level AA standards. All functionality can be accessed using only the keyboard.

Keyboard Shortcuts

Accessibility Features

ARIA Attributes:
  • role="list" on the paginated list container
  • role="listitem" on each call log item via cometchat-list-item
  • aria-label with user name and call type (e.g., “John Doe, Video call”)
  • aria-busy on the list container during loading
  • aria-live="polite" on loading and status indicators
  • role="button" on the trailing call type icon with descriptive aria-label (e.g., “Audio call John Doe”)
  • role="alert" on the error state view
  • role="status" on the empty state view
Screen Reader Support:
  • Announces call log details (user name and call type) when focused
  • Announces loading and error states via live regions
  • Semantic HTML structure with proper heading hierarchy
Focus Management:
  • Visible focus indicators (2px outline) meeting WCAG contrast requirements
  • focus-visible styling on trailing call buttons with outline-offset
  • Roving tabindex on list items for efficient keyboard navigation
  • Trailing call buttons are independently focusable with tabindex="0"
WCAG 2.1 Compliance:
  • ✅ 2.1.1 Keyboard (Level A) — All functionality available via keyboard
  • ✅ 2.1.2 No Keyboard Trap (Level A) — Users can navigate away using keyboard
  • ✅ 2.4.3 Focus Order (Level A) — Logical focus order through list items and call buttons
  • ✅ 2.4.7 Focus Visible (Level AA) — Visible focus indicators on all interactive elements
  • ✅ 4.1.2 Name, Role, Value (Level A) — Proper ARIA attributes on all elements
Reduced Motion Support:
  • Shimmer loading animations are disabled when prefers-reduced-motion: reduce is active

Basic Usage

Simple Implementation

With Call Button Handler

When callButtonClicked has no observers, clicking the trailing call button automatically initiates a call of the same type (audio/video) to the other party. When a handler is bound, the call log is emitted to the handler instead, giving you full control over call initiation.

Properties

Template Properties

Events

Advanced Usage

Custom CallLogRequestBuilder

Use the callLogRequestBuilder input to customize how call logs are fetched. The builder comes from CometChatCalls (the Calls SDK), not the core Chat SDK:

CallLogRequestBuilder Methods

Custom Date Formatting

Override the default call timestamp format using callInitiatedDateTimeFormat:

Handling Call Button Events

By default, clicking the trailing call button automatically initiates a call of the same type (audio/video) to the other party. Bind callButtonClicked to override this behavior:

Active Call Highlighting

Highlight a specific call log entry by passing it to the activeCall input:

Custom Call Settings

Override the default CallSettingsBuilder used in the ongoing call overlay when a call is initiated from the call logs:
You can also set callSettingsBuilder globally via GlobalConfig so all call components use the same settings without passing the input to each one.

Customization with Templates

Custom Subtitle View

Customize the subtitle section to show additional call details:

Custom Trailing View

Replace the default call button with custom action buttons:

Custom Empty and Error States

Provide custom views for empty and error states:

Styling with CSS Variables

The CometChatCallLogs component uses CSS variables for comprehensive theming:

Dark Theme Example

Custom Brand Colors

Error Handling

Built-in Error Handling

The component includes comprehensive error handling through the onError callback and built-in error state view:

Error Flow

Errors are handled at two levels:
  1. Service level: CallLogsService catches errors during fetch and call initiation, wraps them in CometChat.CometChatException, and forwards to the onError callback
  2. Component level: The component catches errors in event handlers and delegates to the same error handling pipeline
When a fetch error occurs and no call logs have been loaded yet, the component transitions to the error state and displays the built-in error view (or your custom errorView template).
For troubleshooting tips, see the Troubleshooting Guide.
  • CometChatOutgoingCall: Outgoing call overlay displayed when a call is initiated from the call logs
  • CometChatOngoingCall: Ongoing call screen displayed when an outgoing call is accepted
  • CometChatCallButtons: Standalone call buttons component for initiating audio/video calls
  • CometChatAvatar: Avatar component used in call log items
  • CometChatListItem: List item component used for rendering each call log entry
  • CometChatDate: Date component used for formatting call timestamps
  • CometChatPaginatedList: Paginated list component providing infinite scroll

Technical Details

  • Standalone Component: Can be imported and used independently
  • Change Detection: Uses OnPush strategy for optimal performance
  • Service Architecture: CallLogsService handles all business logic (fetching, pagination, call initiation, call lifecycle)
  • Signal-based State: Uses Angular signals for reactive state management
  • Pagination: Automatic infinite scroll via CometChatPaginatedList with intersection observers
  • Call Lifecycle: Manages outgoing call → accepted → ongoing call → ended flow with overlays
  • Accessibility: WCAG 2.1 Level AA compliant with full keyboard navigation
  • BEM CSS: Follows Block Element Modifier naming convention
  • Reduced Motion: Respects prefers-reduced-motion media query for shimmer animations