AI Agent Component Spec
AI Agent Component Spec
- Migration scope: Property and method changes between v5 and v6 for all components
- Components affected: Conversations, Users, Groups, Group Members, Message Header, Message List, Message Composer, Incoming Call, Outgoing Call, Call Buttons, Call Logs, CometChatLocalize
- Key pattern change:
datePattern(DatePatterns) replaced withCalendarObject-based props across all components - Localization:
setLocale→setCurrentLanguage,localize→getLocalizedString - Full migration guide: Upgrading from v5
Conversations
New Properties
| Name | Type | Description |
|---|---|---|
| lastMessageDateTimeFormat | CalendarObject | Format for displaying the timestamp of the last message in the conversations list. |
Removed Properties
| Name | Type | Description |
|---|---|---|
| datePattern | DatePatterns | Format for displaying the timestamp of the last message in the conversations list. |
Message Header
New Properties
| Name | Type | Description |
|---|---|---|
| lastActiveAtDateTimeFormat | CalendarObject | Format for displaying the “last active” timestamp in the message header. |
Message List
New Properties
| Name | Type | Description |
|---|---|---|
| separatorDateTimeFormat | CalendarObject | Format for the date separators in the message list. |
| stickyDateTimeFormat | CalendarObject | Format for sticky date headers displayed in the message list. |
| messageSentAtDateTimeFormat | CalendarObject | Format for the timestamp displayed next to messages. |
| messageInfoDateTimeFormat | CalendarObject | Format for timestamps displayed in message details (e.g., delivery or read time). |
Removed Properties
| Name | Type | Description |
|---|---|---|
| datePattern | DatePatterns | Format for the date separators & sticky date in the message list. |
| timePattern | DatePatterns | Format for the timestamp displayed next to messages. |
Thread Header
New Properties
| Name | Type | Description |
|---|---|---|
| separatorDateTimeFormat | CalendarObject | Format for the date separators. |
| messageSentAtDateTimeFormat | CalendarObject | Format for the timestamp displayed next to messages. |
Call Logs
New Properties
| Name | Type | Description |
|---|---|---|
| callInitiatedDateTimeFormat | CalendarObject | Format for displaying the call initiation time in call logs. |
Removed Properties
| Name | Type | Description |
|---|---|---|
| datePattern | DatePatterns | Format for rendering dates in the call logs. |
CometChatLocalize Class
New Methods
| Name | Description |
|---|---|
| addTranslation | Adds custom translations to the default translations. |
| getDefaultLanguage | Returns the default language. |
| getDateLocaleLanguage | Returns the language used for date localization. |
| formatDate | Formats a timestamp based on the provided calendar configuration. |
Renamed Methods
| Name | Description | Old Name |
|---|---|---|
| getCurrentLanguage | Gets the current language. | getLocale |
| setCurrentLanguage | Sets the current language. | setLocale |
| getLocalizedString | Localizes the given string based on the active language. | localize |
Removed Methods
| Name | Description |
|---|---|
| getLanguageCode | Returns the language code of current language. |
| setDefaultLanguage | Sets the default lannguage if no language is passed in init method. |
| isRTL | Returns true if the active language is rtl otherwise return false. |
| getDir | Returns rtl or ltr based on the active language. |