-
Notifications
You must be signed in to change notification settings - Fork 343
feat!: add text composer and poll composer integration to the message input #3085
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
Conversation
* feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs
BREAKING CHANGE: Release V7
* feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component
# Conflicts: # .github/workflows/sample-distribution.yml # package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts # package/src/components/ChannelPreview/hooks/useIsChannelMuted.ts # package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts # package/src/hooks/useTranslatedMessage.ts
# Conflicts: # examples/ExpoMessaging/yarn.lock # examples/SampleApp/ios/Podfile.lock # examples/SampleApp/yarn.lock # examples/TypeScriptMessaging/yarn.lock # package/expo-package/yarn.lock # package/native-package/yarn.lock # package/src/components/ChannelList/hooks/listeners/useUserPresence.ts # package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts # package/src/hooks/useSelectedChannelState.ts
# Conflicts: # package/expo-package/package.json # package/expo-package/yarn.lock # package/native-package/package.json # package/native-package/yarn.lock # package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx # package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx # package/src/components/Message/Message.tsx # package/src/components/Message/MessageSimple/MessageSimple.tsx # package/src/components/Message/MessageSimple/MessageStatus.tsx # package/src/components/Message/hooks/useMessageActionHandlers.ts # package/src/components/MessageMenu/MessageReactionPicker.tsx # package/src/contexts/messageInputContext/__tests__/pickFile.test.tsx # package/src/contexts/messagesContext/MessagesContext.tsx
SDK Size
|
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.
Looks promising as an initial pass, but please have a look at the comments when you have the time. Otherwise, nice !
…to new-text-composer
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.
You can merge this into V8 and let's take it from there !
* feat!: add text composer and poll composer integration to the message input (#3085) * chore: modify gh workflows * feat: removal of StreamChatGenerics (#2993) * feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs * chore: remove support for react-native-document-picker (#3000) * BREAKING CHANGE: V7 release candidate * chore: add rc channel * fix: typo in branch name * feat: trigger breaking change for v7 (#3005) BREAKING CHANGE: Release V7 * chore: remove dryRun * chore: bump stream-chat version to latest rc * chore: bump stream-chat to latest * feat: introduce expo-video support (#3010) * feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component * fix: lint issues * fix: different types inference with latest stream-chat changes * chore(deps): update sample apps too * fix: remove generics from new hook * fix: remove remnants from SCG and fix missing types * fix: lint issues * fix: replace TouchableOpacity with Pressable * fix: move to RN TouchableOpacity instead * chore(deps): update peer deps * chore: remove unused hooks * chore: remove deps scope * fix: all instances of FormatMessageResponse in respect to the new llc changes * chore: ref branch specifically * fix: try clearing cache * fix: remove cache clean * fix: remove console.log * fix: use latest commit * fix: use latest rc of llc * chore: use specific commit again * fix: SCG remnants from merge * fix: lint issues * fix: lint issues * fix: unify file and image types (#3050) * fix: unify file and image types * fix: refine types * fix: remove props from auto complete input * chore: update deps * fix: failing tests and AutoCompleteInput type * chore: update custom data module interfaces * fix: change RNFile to FileReference as per latest client changes (#3061) * fix: merge conflicts * fix: remove MessageType type from the SDK * fix: resolve conflicts from V7 branch * fix: broken tests * fix: useMessageActions remove reserved fields logic * revert: useMessageActions change * fix: confine readBy data to Message Status component * fix: change date separator and group styles to ref * fix: add app changes * feat: use new text composer for RN SDK * fix: bump stream-chat to latest rc * chore: bump stream-chat version to latest rc again * fix: thread messages state not updating properly * chore: change type to inferred one * fix: set correct core lib versions * chore: bump stream-chat to latest rc again * chore: update sample app yarn.locks as well * fix: refine the implementation * fix: add useCallback * fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073) * fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled * chore: bump stream-chat-js rc again * chore: full reinstall after merge from develop * fix: add back mistakenly removed mime dep * feat: add poll composer * feat: add emoji middleware and make text input better * fix: add channel command middleware * fix: add channel command middleware * fix: remove unused values from message input context * fix: remove unused values from message input context * fix: code clean up * fix: point out a bug with the ban user command * fix: added option reordering fix * fix: improve the emoji and command middleware and cleanup * fix: quoted message state using the message composer * fix: improve poll composer integration * fix: reduce prop surface area from auto complete input * fix: tests * fix: poll composer crash bug * fix: change emoji middleware name * chore: remove workflow changes * fix: auto complete input changes * refactor: add improvements * refactor: add poll changes * fix: add back react memo * fix: input buttons hasText optimization * fix: commands button hastext optimization * fix: create poll options useEffect --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]> * feat!: message composer attachment manager integration and improve send flow (#3093) * chore: modify gh workflows * feat: removal of StreamChatGenerics (#2993) * feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs * chore: remove support for react-native-document-picker (#3000) * BREAKING CHANGE: V7 release candidate * chore: add rc channel * fix: typo in branch name * feat: trigger breaking change for v7 (#3005) BREAKING CHANGE: Release V7 * chore: remove dryRun * chore: bump stream-chat version to latest rc * chore: bump stream-chat to latest * feat: introduce expo-video support (#3010) * feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component * fix: lint issues * fix: different types inference with latest stream-chat changes * chore(deps): update sample apps too * fix: remove generics from new hook * fix: remove remnants from SCG and fix missing types * fix: lint issues * fix: replace TouchableOpacity with Pressable * fix: move to RN TouchableOpacity instead * chore(deps): update peer deps * chore: remove unused hooks * chore: remove deps scope * fix: all instances of FormatMessageResponse in respect to the new llc changes * chore: ref branch specifically * fix: try clearing cache * fix: remove cache clean * fix: remove console.log * fix: use latest commit * fix: use latest rc of llc * chore: use specific commit again * fix: SCG remnants from merge * fix: lint issues * fix: lint issues * fix: unify file and image types (#3050) * fix: unify file and image types * fix: refine types * fix: remove props from auto complete input * chore: update deps * fix: failing tests and AutoCompleteInput type * chore: update custom data module interfaces * fix: change RNFile to FileReference as per latest client changes (#3061) * fix: merge conflicts * fix: remove MessageType type from the SDK * fix: resolve conflicts from V7 branch * fix: broken tests * fix: useMessageActions remove reserved fields logic * revert: useMessageActions change * fix: confine readBy data to Message Status component * fix: change date separator and group styles to ref * fix: add app changes * feat: use new text composer for RN SDK * fix: bump stream-chat to latest rc * chore: bump stream-chat version to latest rc again * fix: thread messages state not updating properly * chore: change type to inferred one * fix: set correct core lib versions * chore: bump stream-chat to latest rc again * chore: update sample app yarn.locks as well * fix: refine the implementation * fix: add useCallback * fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073) * fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled * chore: bump stream-chat-js rc again * chore: full reinstall after merge from develop * fix: add back mistakenly removed mime dep * feat: add poll composer * feat: add emoji middleware and make text input better * fix: add channel command middleware * fix: add channel command middleware * fix: remove unused values from message input context * fix: remove unused values from message input context * fix: code clean up * fix: point out a bug with the ban user command * fix: added option reordering fix * fix: improve the emoji and command middleware and cleanup * fix: quoted message state using the message composer * fix: improve poll composer integration * fix: reduce prop surface area from auto complete input * fix: tests * feat: add integration for attachment manager * fix: yarn.lock update * fix: poll composer crash bug * fix: change emoji middleware name * chore: remove workflow changes * feat: move attachment picker context to Channel wrapper and handle only bottom sheet stuff in it * fix: add app refactor * fix: add app refactor * fix: auto complete input changes * refactor: add improvements * refactor: add poll changes * fix: add back react memo * fix: input buttons hasText optimization * fix: improve upload preview components * fix: improve upload preview components * fix: audio attachment issues * chore: resolve conflicts * fix: sync up changes * fix: sync up changes * fix: commands button hastext optimization * fix: create poll options useEffect * fix: comment * fix: default values * fix: try out picker in channel * fix: attachment picker component usage * fix: cleanup for the attachment manager * fix: input button hasText bug * fix: file unsupported types * fix: style for upload unsupported indicator * fix: improve upload new file * fix: send button and audiorecordingbutton re-renders * fix: send button and audiorecordingbutton re-renders * revert: the memo change * fix: remove profiler code * fix: optimize send button performance * fix: type export from audio recording button * fix: iLocalUri utility * fix: update yarn lock * fix: attachment send while offline support is enabled * fix: make sending flow faster and bug free and fix bug with cooldown * fix: edited message usage * fix: attachments draft middleware * fix: make command control middleware better * fix: use text composer for command handling * tests: add tests * tests: add tests * fix: remove thread from MessageInput * perf: messages rerendering on every composer change * perf: remove editing state from channel ctx and add composer ctx * fix: double editing issue * fix: introduce hasText * fix: quoted message edited update bug * fix: quoted message edited update bug * fix: close poll modal before send to avoid reset on the UI * fix: selected picker bug * fix: memoize the photos * fix: performance issue with quoted message checks * fix: further optimize memo checks * perf: separate composer ctxs and optimize usage (#3112) * perf: abstract away composer api and usage * fix: remove props inport and remove comments --------- Co-authored-by: Khushal Agarwal <[email protected]> * fix: change how message composer config is set * perf: make attachbutton better * fix: poll option animation breaking (#3115) * fix: poll option animation breaking * fix: add container animation * chore: remove console.log * fix: revert not needed prop drilling * fix: use draft attachments middlware * fix: image upload preview loading indicator * tests: add tests setup * tests: add tests setup * tests: add more tests * perf: improve the input buttons and command input perf * fix: sample app channel header component perf * fix: remove isCommandUIEnabled from channel context * chore: temporarily comment out commands feature * chore: bump stream-chat to latest * chore: comment out setting up middleware again * fix: send button visibility when async audio off and fixed few tests --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]> * chore: update lock files * fix: check the send link capability before sending message (#3116) * fix: check the send link capability before sending message * fix: formatting * fix: poll creation and optimistic updates (#3117) * fix: poll creation and optimistic updates * fix: multi poll sending edge case * fix: improve command button usage * test: fix more tests and remove isValidMessage tests as its already handled on LLC * fix: remove redundant styles from image upload preview * feat: draft message (#3114) * chore: modify gh workflows * feat: removal of StreamChatGenerics (#2993) * feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs * chore: remove support for react-native-document-picker (#3000) * BREAKING CHANGE: V7 release candidate * chore: add rc channel * fix: typo in branch name * feat: trigger breaking change for v7 (#3005) BREAKING CHANGE: Release V7 * chore: remove dryRun * chore: bump stream-chat version to latest rc * chore: bump stream-chat to latest * feat: introduce expo-video support (#3010) * feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component * fix: lint issues * fix: different types inference with latest stream-chat changes * chore(deps): update sample apps too * fix: remove generics from new hook * fix: remove remnants from SCG and fix missing types * fix: lint issues * fix: replace TouchableOpacity with Pressable * fix: move to RN TouchableOpacity instead * chore(deps): update peer deps * chore: remove unused hooks * chore: remove deps scope * fix: all instances of FormatMessageResponse in respect to the new llc changes * chore: ref branch specifically * fix: try clearing cache * fix: remove cache clean * fix: remove console.log * fix: use latest commit * fix: use latest rc of llc * chore: use specific commit again * fix: SCG remnants from merge * fix: lint issues * fix: lint issues * fix: unify file and image types (#3050) * fix: unify file and image types * fix: refine types * fix: remove props from auto complete input * chore: update deps * fix: failing tests and AutoCompleteInput type * chore: update custom data module interfaces * fix: change RNFile to FileReference as per latest client changes (#3061) * fix: merge conflicts * fix: remove MessageType type from the SDK * fix: resolve conflicts from V7 branch * fix: broken tests * fix: useMessageActions remove reserved fields logic * revert: useMessageActions change * fix: confine readBy data to Message Status component * fix: change date separator and group styles to ref * fix: add app changes * feat: use new text composer for RN SDK * fix: bump stream-chat to latest rc * chore: bump stream-chat version to latest rc again * fix: thread messages state not updating properly * chore: change type to inferred one * fix: set correct core lib versions * chore: bump stream-chat to latest rc again * chore: update sample app yarn.locks as well * fix: refine the implementation * fix: add useCallback * fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073) * fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled * chore: bump stream-chat-js rc again * chore: full reinstall after merge from develop * fix: add back mistakenly removed mime dep * feat: add poll composer * feat: add emoji middleware and make text input better * fix: add channel command middleware * fix: add channel command middleware * fix: remove unused values from message input context * fix: remove unused values from message input context * fix: code clean up * fix: point out a bug with the ban user command * fix: added option reordering fix * fix: improve the emoji and command middleware and cleanup * fix: quoted message state using the message composer * fix: improve poll composer integration * fix: reduce prop surface area from auto complete input * fix: tests * feat: add integration for attachment manager * fix: yarn.lock update * fix: poll composer crash bug * fix: change emoji middleware name * chore: remove workflow changes * feat: move attachment picker context to Channel wrapper and handle only bottom sheet stuff in it * fix: add app refactor * fix: add app refactor * fix: auto complete input changes * refactor: add improvements * refactor: add poll changes * fix: add back react memo * fix: input buttons hasText optimization * fix: improve upload preview components * fix: improve upload preview components * fix: audio attachment issues * chore: resolve conflicts * fix: sync up changes * fix: sync up changes * fix: commands button hastext optimization * fix: create poll options useEffect * fix: comment * fix: default values * fix: try out picker in channel * fix: attachment picker component usage * fix: cleanup for the attachment manager * fix: input button hasText bug * fix: file unsupported types * fix: style for upload unsupported indicator * fix: improve upload new file * fix: send button and audiorecordingbutton re-renders * fix: send button and audiorecordingbutton re-renders * revert: the memo change * fix: remove profiler code * fix: optimize send button performance * fix: type export from audio recording button * fix: iLocalUri utility * fix: update yarn lock * fix: attachment send while offline support is enabled * fix: make sending flow faster and bug free and fix bug with cooldown * fix: edited message usage * fix: attachments draft middleware * fix: make command control middleware better * fix: use text composer for command handling * feat: add support for draft message * fix: draft config * feat: add offline support for draft messages * fix: getDraft bug and add draft support for thread list * fix: set draft config from app * fix: thread list listen to messagecomposer events * fix: drafts issue * fix: add test id * tests: add tests * tests: add tests * tests: add tests * fix: remove thread from MessageInput * perf: messages rerendering on every composer change * perf: remove editing state from channel ctx and add composer ctx * fix: double editing issue * fix: introduce hasText * fix: quoted message edited update bug * fix: quoted message edited update bug * fix: close poll modal before send to avoid reset on the UI * fix: selected picker bug * fix: memoize the photos * fix: performance issue with quoted message checks * fix: further optimize memo checks * feat: add draftscreen to sample app * perf: separate composer ctxs and optimize usage (#3112) * perf: abstract away composer api and usage * fix: remove props inport and remove comments --------- Co-authored-by: Khushal Agarwal <[email protected]> * fix: usage of global config * fix: usage of global config * fix: change how message composer config is set * fix: application of global config in sample app * perf: make attachbutton better * fix: editing usage * fix: drafts messages in channel without parent id * fix: unify the message preview component to channel preview and thread list item * fix: add message preview to draft list * fix: poll option animation breaking (#3115) * fix: poll option animation breaking * fix: add container animation * chore: remove console.log * fix: revert not needed prop drilling * fix: improve draft manager * fix: improve draft manager * fix: remove parent_id prop * fix: use draft attachments middlware * fix: image upload preview loading indicator * tests: add tests setup * tests: add tests setup * tests: add more tests * perf: improve the input buttons and command input perf * fix: sample app channel header component perf * fix: remove isCommandUIEnabled from channel context * chore: update yarn lock and pod file * fix: improve uselatestmessagepreview * fix: adjust theme changes * refactor: introduce selectDraftMessageFromDraft * fix: getDraft endpoint return value * fix: register subscriptions when the thread var change * chore: update yarn lock files * revert: thread dep change * fix: handle only draft events in channel preview and thread list item * fix: delete draft message when new created * fix: guard from parent id * fix: get drafts with parent message and cid * fix: remove console logs * fix: drafts state and offline support quirks * fix: offline mode drafts and jsi quirks * fix: thread draft bugs, thread draft pending tasks, schema and mapping * fix: rename type to threadId for clarity --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]> * fix: use composer for show thread message in channel checkbox (#3122) * fix: use composer for show thread message in channel checkbox * fix: how threadList prop is passed * test: add test for message input context and few other components/utils (#3121) * test: add test for message input context and few other components/utils * fix: lint issues * chore: update podlock file * test: fix more broken tests * fix: tests * fix: more tests * fix: sync issue * fix: final broken test * fix: remove unused props from message input * fix: remove unused props from message input * fix: openFilePicker removal and fix show more options * chore: setup v8 rc candidate and workflows (#3127) * chore: setup v8 rc candidate and workflows * chore: setup v8 rc candidate and workflows * feat: handle command injection on the sdk (#3124) * feat: handle command injection through middleware * chore: update pod lock file * chore: update yarn lock files * fix: use middleware from LLC * fix: remove isCommandUIEnabled prop * fix: add back refactor * fix: add setup command middleware for sample app * chore: update podlock file * fix: remove redundant text selector * chore: update yarn lock and podfile lock * fix: middleware usage * chore: update podfile.lock * fix: broken tests due to 0.79 merge * fix: restructure file and image upload preview to attachment upload preview list (#3133) * feat: restructure images and files upload preview * feat: create useAudioPreviewManager * fix: paused bug when audio is uploadesd * fix: restructure useeffect * fix: draft pending task deletion * fix: poll switch inputs issue with async state (#3135) * fix: poll switch inputs issue with async state * fix: poll switch inputs issue with async state * fix: poll switch inputs issue with async state * chore: bump stream-chat to latest * feat: bump i18n to latest and do all necessary changes in the SDK to support it * chore: update relevant yarn.locks * fix: linter issues * fix: import cycles issue for polls and translations * fix: message composer cyclical deps * chore: bump expomessaging yarn.lock * fix: limit offline messages * fix: update pod lock files BREAKING CHANGE: commit for v8 bump * Revert "chore: setup v8 rc candidate and workflows (#3127)" This reverts commit 7a0dad8. * chore: bump sample apps all around --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]>
The primary goal of the PR is to introduce the new message composer and the poll composer integration to the React Native SDK. This is a breaking change for the SDK.
The following are the changes that are done to improve the overall flow/add the message composer, and performance in the SDK:
Emoji
@emoji-mart
to init the data, and the query can be done through thestream-io/react-native-sdk/emoji-middleware
exported from the SDK that can be registered on the text composer middleware. An example can be found on the sample app.Suggestions
stream-chat
package instead of being exported by us.onSelectItem
from the message input context is not needed. They can easily be implemented by the integrators using the text composer. We can mention it in the guide. Integrators can directly calltextComposer.handleSelect
function with the exact item they wanna select as a parameter.openCommandsPicker
andopenMentionsPicker
from the message input context are not needed. They can easily be implemented by the integrators using the text composer. We can mention it in the guide. An example is as follows:ACITriggerSettings
are not needed as we use the composer to get the suggestions for each trigger category.The suggestion context is no longer needed, as we get the suggestion queries and updates through the message composer.
autoCompleteTriggerSettings
andemojiSearchIndex
are gone as part of the suggestions changes. The latter can be easily added in a custom middleware, and the former's customisation can also be incorporated in the middleware.Text input changes
maxMessageLength
,onChangeText
,numberOfLines
,autoCompleteSuggestionsLimit
,closeSuggestions
,mentionAllAppUsersEnabled
,mentionAllAppUsersQuery
,onChange
,openSuggestions
,triggerSettings
,updateSuggestions
,text
,setGiphyActive
,setGiphyEnabled
,giphyEnabled
props are removed from theAutoCompleteInput
component as they can be directly set through theadditionalTextInputProps
or the message composer simplifies the usage so that you don't have to rely on the context anymore which we previously did. Any custom logic for a query can be done by custom middleware.AutoCompleteInput
component now extends React Native'sTextInputProps
for better customizability. This is 10 times better for the future.giphyActive
and thegiphyEnabled
props are gone now from the context and are replaced with a single config propisCommandUIEnabled
that will control whether we want to show the commands UI, which is different from the default text input on the message input.InputGiphySearch
component is now generalised to theCommandInput
component, as it handles other commands, which we never supported. To do this, we have a custom middleware in the SDK that does the job ofcreateCommandInjectionMiddleware
. Note: The logic might move to the LLC very soon once I get some time and I finalise the release.CommandInput
doesn't need thesetShowMoreOptions
anymore.showMoreOptions
andsetShowMoreOptions
are now not a part of the message input context, because this can pretty much be handled locally in the input button without complicating the state in the context.onChange
andappendText
from the message input context are not needed anymore, as the integrators can pretty much customise theAutoCompleteInput
using theadditionalTextInputProps
, and the message composer is available to them wherever they need it if they have a channel.Quoted message
clearQuotedMessageState
,setQuotedMessage
, andquotedMessage
gone away from MessageContext and MessageInputContext as it can be set and received from themessageComposer
easily.Send message
messageComposer.compose()
to compose the message, and the data returned is used to call thesendMessage
in the channel component. This flow will be improved a lot in my next PR involving the attachments manager and handling.Poll Composer
The poll composer is now fully integrated into the create poll content component to manage the composition of the polls. The changes are as follows:
CreatePollContent
are now more granular in nature and divided intoNameField
,MultipleAnswersField
, andCreatePollHeader
components, each with the previous content but just using the poll composer to manage the state and update the fields.pollComposer.updateFields
to update the fields on text changes in text input and on value changes for the switch. The poll options are now more versatile as they respond to the poll ID rather than a numeric index. And after each update, we receive the changes on theonNewOrderSet
function, where we update the field on the composer.messageComposer.createPoll()
and then callsendMessage
, where it will automatically have the poll id through themessageComposer.compose()
method call.Apart from the above generic changes, there are a few code cleanups that have happened, which made sense during the integration.
Quick disclaimer about the PR: The changes will make more sense if you club them with the changes in the later PR - #3093
Also, please ignore the tests failing. The tests have to be reworked entirely usingthe message composer and I plan to do it after my changes for the integration is done as it will be easier then.