-
Notifications
You must be signed in to change notification settings - Fork 285
feat: message composer #2669
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
Merged
Merged
feat: message composer #2669
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41fe189
to
98fe4f2
Compare
dc919e7
to
0a7dc0f
Compare
0a7dc0f
to
991b070
Compare
…textComposerEmojiMiddleware
…/message-composer
github-actions bot
pushed a commit
to GetStream/stream-chat-js
that referenced
this pull request
Apr 28, 2025
## [9.0.0-rc.11](v9.0.0-rc.10...v9.0.0-rc.11) (2025-04-28) ### ⚠ BREAKING CHANGES * Replacement of FormatMessageResponse with LocalMessage type ### Bug Fixes * [REACT-344] remove Agora & 100ms integrations ([#1519](#1519)) ([16cd81a](16cd81a)) * [REACT-350] make archived_at & pinned_at nullable ([#1515](#1515)) ([318825a](318825a)) * [REACT-353] unify pinned_at & archived_at nullish values ([#1516](#1516)) ([a840226](a840226)), closes [#1515](#1515) ### Features * [CHA-794] Add sort and filter param to queryThreads ([#1511](#1511)) ([ea7fe99](ea7fe99)) * [CHA-855] - Refactoring partial update member ([#1517](#1517)) ([e4f7e68](e4f7e68)) * message composer ([#1495](#1495)) ([0c07524](0c07524)), closes [stream-chat-react#2669](GetStream/stream-chat-react#2669)
…/message-composer
MartinCupela
added a commit
to GetStream/stream-chat-css
that referenced
this pull request
Apr 28, 2025
…poser addition (#328) ### 🎯 Goal Needed for GetStream/stream-chat-react#2669
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rc #2669 +/- ##
==========================================
+ Coverage 81.01% 81.87% +0.85%
==========================================
Files 470 462 -8
Lines 9925 9185 -740
Branches 2413 2096 -317
==========================================
- Hits 8041 7520 -521
- Misses 1498 1560 +62
+ Partials 386 105 -281 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…m Channel props and ChannelStateContext
…equest from MessageInputProps
github-actions bot
pushed a commit
that referenced
this pull request
Apr 28, 2025
## [13.0.0-rc.1](v12.14.0...v13.0.0-rc.1) (2025-04-28) ### ⚠ BREAKING CHANGES * `Channel` props `dragAndDropWindow` & `optionalMessageInputProps` have been removed, use * Remove ChatAutoComplete, AutoCompleteTextarea, DefaultSuggestionList, DefaultSuggestionListItem and introduce TextareaComposer, SuggestionList, SuggestionListItem * Remove defaultScrollToItem function previously used by SuggestionList * Removed DefaultTriggerProvider component * Remove from Channel props - acceptedFiles, enrichURLForPreview, enrichURLForPreviewConfig, maxNumberOfFiles, multipleUploads, TriggerProvider * Removal of acceptedFiles, debounceURLEnrichmentMs, enrichURLForPreview, findURLFn, multipleUploads, onLinkPreviewDismissed, quotedMessage from ChannelStateContext * Changed signature for functions sendMessage and editMessage in ChannelActionContext * Changed signature for handleSubmit * Removed setQuotedMessage from ChannelActionContext * Removed types MessageToSend, StreamMessage, UpdatedMessage in favor of LocalMessage or RenderedMessage * Removed Trigger generics from ChannelProps * Message input state as well as the API is now kept within MessageComposer instead of MessageInputContext * Renamed useMessageInputState to useMessageInputControls as it does not handle the composition state anymore * Removed from MessageInputProps - disabled, disableMentions, doFileUploadRequest, doImageUploadRequest, errorHandler, getDefaultValue, mentionAllAppUsers, mentionQueryParams, message, noFiles, urlEnrichmentConfig, useMentionsTransliteration, additionalTextareaProps do not expect default value anymore * Changed the signature of MessageInput prop overrideSubmitHandler * Local attachment and link preview types moved to stream-chat * The SuggestionListItem UI components for TextareaComposer receive tokenizedDisplayName instead of itemNameParts * Removed duplicate types SendMessageOptions, UpdateMessageOptions which should be imported from stream-chat instead * Removed type LinkPreviewListProps - LinkPreviewList does not have any props anymore * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types ### Bug Fixes * replace StreamChatGenerics with module augmentation ([#2634](#2634)) ([67bed79](67bed79)) ### Features * default data interfaces ([#2683](#2683)) ([a88e145](a88e145)) * introduce WithDragAndDropUpload component ([#2688](#2688)) ([6b03abd](6b03abd)) * message composer ([#2669](#2669)) ([fa2519b](fa2519b)), closes [#2688](#2688) ### Chores * **deps:** upgrade @stream-io/stream-chat-css to v5.8.1 ([#2689](#2689)) ([d0c32e3](d0c32e3)) ### Refactors * simplify WithDragAndDropUpload API ([#2691](#2691)) ([46c9add](46c9add))
🎉 This PR is included in version 13.0.0-rc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Provide a message composition API supported by reactive state layer from stream-chat. The message composition logic has been moved to stream-chat. The logic kept in stream-chat-react is related only to the browser event handling.
Depends on:
🛠 Implementation details
The message composition now relies on
MessageComposer
instance. The instance is available for the channel message list, thread message list and for editing a specific message. TheMessageComposer
instance should be accessed viauseMessageComposer
hook, that identifies the correct context (channel, thread, message).🎨 UI Changes
No changes
BREAKING CHANGE:
Channel
propsdragAndDropWindow
&optionalMessageInputProps
have been removed, useWithDragAndDropUpload
component instead (#2688)BREAKING CHANGE: Attachment identity functions moved to stream-chat-js (e.g. isFileAttachment...)
BREAKING CHANGE: Remove ChatAutoComplete, AutoCompleteTextarea, DefaultSuggestionList, DefaultSuggestionListItem and introduce TextareaComposer, SuggestionList, SuggestionListItem
BREAKING CHANGE: Remove defaultScrollToItem function previously used by SuggestionList
BREAKING CHANGE: Removed DefaultTriggerProvider component
BREAKING CHANGE: Remove from Channel props - acceptedFiles, enrichURLForPreview, enrichURLForPreviewConfig, maxNumberOfFiles, multipleUploads, TriggerProvider
BREAKING CHANGE: Removal of acceptedFiles, debounceURLEnrichmentMs, enrichURLForPreview, findURLFn, multipleUploads, onLinkPreviewDismissed, quotedMessage from ChannelStateContext
BREAKING CHANGE: Changed signature for functions sendMessage and editMessage in ChannelActionContext
BREAKING CHANGE: Changed signature for handleSubmit
BREAKING CHANGE: Removed setQuotedMessage from ChannelActionContext
BREAKING CHANGE: Removed types MessageToSend, StreamMessage, UpdatedMessage in favor of LocalMessage or RenderedMessage
BREAKING CHANGE: Removed Trigger generics from ChannelProps
BREAKING CHANGE: Message input state as well as the API is now kept within MessageComposer instead of MessageInputContext
BREAKING CHANGE: Renamed useMessageInputState to useMessageInputControls as it does not handle the composition state anymore
BREAKING CHANGE: Removed from MessageInputProps - disabled, disableMentions, doFileUploadRequest, doImageUploadRequest, errorHandler, getDefaultValue, mentionAllAppUsers, mentionQueryParams, message, noFiles, urlEnrichmentConfig, useMentionsTransliteration, additionalTextareaProps do not expect default value anymore
BREAKING CHANGE: Changed the signature of MessageInput prop overrideSubmitHandler
BREAKING CHANGE: Local attachment and link preview types moved to stream-chat
BREAKING CHANGE: The SuggestionListItem UI components for TextareaComposer receive tokenizedDisplayName instead of itemNameParts
BREAKING CHANGE: Removed duplicate types SendMessageOptions, UpdateMessageOptions which should be imported from stream-chat instead
BREAKING CHANGE: Removed type LinkPreviewListProps - LinkPreviewList does not have any props anymore