Skip to content

Commit 14e2644

Browse files
Sravan SHoonBaek
andauthored
release: [v3.4.5] (Apr 07 2023) (#482)
Features: * Add a message list filter of UI level in the `Channel` module * Add `Channel.filterMessageList?: (messages: BaseMessage): boolean;`, a UI level filter prop to Channel. This function will be used to filter messages in `<MessageList />` example: ```javascript // set your channel URL const channel = ""; export const ChannelWithFilter = () => { const channelFilter = useCallback((message) => { const now = Date.now(); const twoWeeksAgo = now - 1000 * 60 * 60 * 24 * 14; return message.createdAt > twoWeeksAgo; }, []); return ( <Channel channelUrl={channel} filterMessageList={channelFilter} /> ); }; ``` * Improve structure of message UI for copying Before: * The words inside messages were kept in separate spans * This would lead to unfavourable formatting when pasted in other applications After: * Remove span for wrapping simple strings in message body * Urls and Mentions will still be wrapped in spans(for formatting) * Apply new logic & components(TextFragment) to tokenize strings * Improve keys used in rendering inside message, * UUIDs are not the optimal way to improve rendering * Create a composite key with message.updatedAt * Refactor usePaste hook to make mentions work ~ * Fix overflow of long strings * Deprecate `Word` and `convertWordToStringObj` * Export MessageProvider, a simple provider to avoid prop drilling into Messages Note - this is still in works, but these props will remain * In the future, we will add methods - to this module - to: * Edit & delete callbacks * Menu render options(ACLs) * Reaction configs * This will improve the customizability and remove a lot of prop drilling in Messages ```javascript export type MessageProviderProps = { children: React.ReactNode; message: BaseMessage; isByMe?: boolean; } import { MessageProvider, useMessageContext } from '@sendbird/uikit-react/Message/context' ``` Incase if you were using MessageComponents and see error message `useMessageContext must be used within a MessageProvider ` use: `<MessageProvider message={message}><CustomMessage /></MessageProvider>` * Add a scheduler for calling markAsRead intervally * The `markAsRead` is called on individual channels is un-optimal(causes command ack. error) because we have a list of channels that do this ideally this should be fixed in server/SDK this is a work around for the meantime to un-throttle the customer Fixes: * Set current channel on `ChannelList` when opening channel from the parent message of `Thread` * Issue: The ChannelPreview item is not selected when opening the channel from the ParentMessage of the Thread * Fix: Set activeChannelUrl of ChannelList * Detect new lines in safari on the `MessageInput` component * Safari puts `<div>text</div>` for new lines inside content editable div(input) * Other browsers put newline or `br` [SDKRLSD-761](https://sendbird.atlassian.net/browse/SDKRLSD-761) Co-authored-by: HoonBaek <[email protected]>
1 parent a8683d4 commit 14e2644

File tree

5 files changed

+7621
-7164
lines changed

5 files changed

+7621
-7164
lines changed

CHANGELOG.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,86 @@
11
# Changelog - v3
22

3+
## [v3.4.5] (Apr 7 2023)
4+
5+
Features:
6+
7+
* Add a message list filter of UI level in the `Channel` module
8+
* Add `Channel.filterMessageList?: (messages: BaseMessage): boolean;`, a UI level filter prop
9+
to Channel. This function will be used to filter messages in `<MessageList />`
10+
11+
example:
12+
```javascript
13+
// set your channel URL
14+
const channel = "";
15+
export const ChannelWithFilter = () => {
16+
const channelFilter = useCallback((message) => {
17+
const now = Date.now();
18+
const twoWeeksAgo = now - 1000 * 60 * 60 * 24 * 14;
19+
return message.createdAt > twoWeeksAgo;
20+
}, []);
21+
return (
22+
<Channel
23+
channelUrl={channel}
24+
filterMessageList={channelFilter}
25+
/>
26+
);
27+
};
28+
```
29+
30+
* Improve structure of message UI for copying
31+
Before:
32+
* The words inside messages were kept in separate spans
33+
* This would lead to unfavourable formatting when pasted in other applications
34+
35+
After:
36+
* Remove span for wrapping simple strings in message body
37+
* Urls and Mentions will still be wrapped in spans(for formatting)
38+
* Apply new logic & components(TextFragment) to tokenize strings
39+
* Improve keys used in rendering inside message,
40+
* UUIDs are not the optimal way to improve rendering
41+
* Create a composite key with message.updatedAt
42+
* Refactor usePaste hook to make mentions work ~
43+
* Fix overflow of long strings
44+
* Deprecate `Word` and `convertWordToStringObj`
45+
46+
* Export MessageProvider, a simple provider to avoid prop drilling into Messages
47+
Note - this is still in works, but these props will remain
48+
* In the future, we will add methods - to this module - to:
49+
* Edit & delete callbacks
50+
* Menu render options(ACLs)
51+
* Reaction configs
52+
* This will improve the customizability and remove a lot of prop drilling in Messages
53+
54+
```
55+
export type MessageProviderProps = {
56+
children: React.ReactNode;
57+
message: BaseMessage;
58+
isByMe?: boolean;
59+
}
60+
61+
import { MessageProvider, useMessageContext } from '@sendbird/uikit-react/Message/context'
62+
```
63+
Incase if you were using MessageComponents and see error message
64+
`useMessageContext must be used within a MessageProvider `
65+
use: `<MessageProvider message={message}><CustomMessage /></MessageProvider>`
66+
67+
* Add a scheduler for calling markAsRead intervally
68+
* The `markAsRead` is called on individual channels is un-optimal(causes command ack. error)
69+
because we have a list of channels that do this
70+
ideally this should be fixed in server/SDK
71+
this is a work around for the meantime to un-throttle the customer
72+
73+
Fixes:
74+
* Set current channel on `ChannelList` when opening channel from the parent message of `Thread`
75+
* Issue: The ChannelPreview item is not selected when opening the channel from
76+
the ParentMessage of the Thread
77+
* Fix: Set activeChannelUrl of ChannelList
78+
* Detect new lines in safari on the `MessageInput` component
79+
* Safari puts `<div>text</div>` for new lines inside content editable div(input)
80+
* Other browsers put newline or `br`
81+
382
## [v3.4.4] (Mar 31 2023)
83+
484
Features:
585
* Increase default maximum recording time of Voice Message to 10 minutes
686
* Add logger to VoicePlayer, VoiceRecorder, and useSendVoiceMessage hook

0 commit comments

Comments
 (0)