Skip to content
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

feat: keep attachments array and remove file and image uploads in MessageInput state #2445

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

MartinCupela
Copy link
Contributor

@MartinCupela MartinCupela commented Jul 5, 2024

🎯 Goal

Remove the following state variables from the MessageInput state:

  • fileOrder
  • imageOrder
  • fileUploads
  • imageUploads

All the attachments except the link previews (attachment contains og_scrape_url attribute) are now stored in attachments array. Array keeps order and the attachment type can be determined by attachment.type property.

Default attachment types are:

  • audio
  • file
  • image
  • video
  • voiceRecording

Uploaded attachments will be determined by file attribute as attachment.localMetadata.file.

Remove the following API from the MessageInput state

  • uploadFile -> from now on, use uploadAttachment
  • uploadImage -> from now on, use uploadAttachment
  • removeFile -> from now on, use removeAttachments
  • removeImage -> from now on, use removeAttachments

The function uploadNewFiles has been kept.

So to sum up, the attachments management API in MessageInput is from now on only:

  • attachments
  • uploadAttachment
  • uploadNewFiles
  • upsertAttachments
  • removeAttachments

🛠 Implementation details

🎨 UI Changes

No UI changes.

BREAKING CHANGE: Removed fileOrder, imageOrder, fileUploads, imageUploads, uploadFile, uploadImage, removeFile, removeImage from the MessageInputContext.

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 92.18750% with 5 lines in your changes missing coverage. Please review.

Project coverage is 85.19%. Comparing base (aeb87ff) to head (b3d796f).
Report is 5 commits behind head on master.

Files Patch % Lines
...rc/components/MessageInput/hooks/useAttachments.ts 91.66% 2 Missing and 1 partial ⚠️
.../components/MessageInput/hooks/useSubmitHandler.ts 93.75% 1 Missing ⚠️
src/components/ReactFileUtilities/utils.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2445      +/-   ##
==========================================
- Coverage   85.34%   85.19%   -0.15%     
==========================================
  Files         373      369       -4     
  Lines        8070     7890     -180     
  Branches     1944     1912      -32     
==========================================
- Hits         6887     6722     -165     
+ Misses       1091     1077      -14     
+ Partials       92       91       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jul 5, 2024

Size Change: -5.28 kB (-0.7%)

Total Size: 752 kB

Filename Size Change
./dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js 597 B -90 B (-13.1%) 👏
./dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js 679 B +29 B (+4.46%)
./dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js 712 B +21 B (+3.04%)
./dist/components/MessageInput/AttachmentPreviewList/UploadPreviewItem.js 0 B -625 B (removed) 🏆
./dist/components/MessageInput/hooks/useAttachments.js 2.06 kB +112 B (+5.74%) 🔍
./dist/components/MessageInput/hooks/useCreateMessageInputContext.js 994 B -128 B (-11.41%) 👏
./dist/components/MessageInput/hooks/useFileUploads.js 0 B -996 B (removed) 🏆
./dist/components/MessageInput/hooks/useImageUploads.js 0 B -1.06 kB (removed) 🏆
./dist/components/MessageInput/hooks/useMessageInputState.js 2 kB -670 B (-25.13%) 🎉
./dist/components/MessageInput/hooks/usePasteHandler.js 684 B -37 B (-5.13%)
./dist/components/MessageInput/hooks/useSubmitHandler.js 1.74 kB -606 B (-25.88%) 🎉
./dist/components/MessageInput/MessageInputFlat.js 2.15 kB -68 B (-3.07%)
./dist/components/ReactFileUtilities/utils.js 1.17 kB +82 B (+7.55%) 🔍
./dist/i18n/de.json 2.96 kB +36 B (+1.23%)
./dist/i18n/en.json 1.89 kB +28 B (+1.5%)
./dist/i18n/es.json 2.95 kB +35 B (+1.2%)
./dist/i18n/fr.json 3.04 kB +40 B (+1.33%)
./dist/i18n/hi.json 3.41 kB +44 B (+1.31%)
./dist/i18n/it.json 2.96 kB +32 B (+1.09%)
./dist/i18n/ja.json 3.27 kB +43 B (+1.33%)
./dist/i18n/ko.json 3.2 kB +39 B (+1.23%)
./dist/i18n/nl.json 2.85 kB +32 B (+1.13%)
./dist/i18n/pt.json 2.91 kB +34 B (+1.18%)
./dist/i18n/ru.json 3.6 kB +42 B (+1.18%)
./dist/i18n/tr.json 2.92 kB +35 B (+1.21%)
./dist/index.cjs.js 458 kB -1.68 kB (-0.36%)
ℹ️ View Unchanged
Filename Size
./dist/components/Attachment/attachment-sizing.js 1.07 kB
./dist/components/Attachment/Attachment.js 1.01 kB
./dist/components/Attachment/AttachmentActions.js 474 B
./dist/components/Attachment/AttachmentContainer.js 1.92 kB
./dist/components/Attachment/Audio.js 615 B
./dist/components/Attachment/audioSampling.js 1.34 kB
./dist/components/Attachment/Card.js 1.51 kB
./dist/components/Attachment/components/DownloadButton.js 241 B
./dist/components/Attachment/components/FileSizeIndicator.js 290 B
./dist/components/Attachment/components/index.js 112 B
./dist/components/Attachment/components/PlaybackRateButton.js 190 B
./dist/components/Attachment/components/PlayButton.js 252 B
./dist/components/Attachment/components/ProgressBar.js 260 B
./dist/components/Attachment/components/WaveProgressBar.js 1.4 kB
./dist/components/Attachment/FileAttachment.js 367 B
./dist/components/Attachment/hooks/useAudioController.js 1.36 kB
./dist/components/Attachment/icons.js 546 B
./dist/components/Attachment/index.js 131 B
./dist/components/Attachment/UnsupportedAttachment.js 308 B
./dist/components/Attachment/utils.js 740 B
./dist/components/Attachment/VoiceRecording.js 943 B
./dist/components/AutoCompleteTextarea/index.js 146 B
./dist/components/AutoCompleteTextarea/Item.js 379 B
./dist/components/AutoCompleteTextarea/List.js 1.32 kB
./dist/components/AutoCompleteTextarea/Textarea.js 6.09 kB
./dist/components/AutoCompleteTextarea/types.js 31 B
./dist/components/AutoCompleteTextarea/utils.js 794 B
./dist/components/Avatar/Avatar.js 548 B
./dist/components/Avatar/index.js 46 B
./dist/components/Channel/Channel.js 8.62 kB
./dist/components/Channel/channelState.js 916 B
./dist/components/Channel/hooks/useChannelContainerClasses.js 273 B
./dist/components/Channel/hooks/useCreateChannelStateContext.js 1.15 kB
./dist/components/Channel/hooks/useCreateTypingContext.js 226 B
./dist/components/Channel/hooks/useEditMessageHandler.js 239 B
./dist/components/Channel/hooks/useIsMounted.js 165 B
./dist/components/Channel/hooks/useMentionsHandlers.js 377 B
./dist/components/Channel/index.js 118 B
./dist/components/Channel/LoadingChannel.js 342 B
./dist/components/Channel/utils.js 733 B
./dist/components/ChannelHeader/ChannelHeader.js 748 B
./dist/components/ChannelHeader/icons.js 440 B
./dist/components/ChannelHeader/index.js 53 B
./dist/components/ChannelList/ChannelList.js 2.44 kB
./dist/components/ChannelList/ChannelListMessenger.js 430 B
./dist/components/ChannelList/hooks/index.js 193 B
./dist/components/ChannelList/hooks/useChannelDeletedListener.js 421 B
./dist/components/ChannelList/hooks/useChannelHiddenListener.js 422 B
./dist/components/ChannelList/hooks/useChannelTruncatedListener.js 348 B
./dist/components/ChannelList/hooks/useChannelUpdatedListener.js 484 B
./dist/components/ChannelList/hooks/useChannelVisibleListener.js 442 B
./dist/components/ChannelList/hooks/useConnectionRecoveredListener.js 278 B
./dist/components/ChannelList/hooks/useMessageNewListener.js 546 B
./dist/components/ChannelList/hooks/useMobileNavigation.js 275 B
./dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.js 572 B
./dist/components/ChannelList/hooks/useNotificationMessageNewListener.js 486 B
./dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.js 374 B
./dist/components/ChannelList/hooks/usePaginatedChannels.js 1.25 kB
./dist/components/ChannelList/hooks/useUserPresenceChangedListener.js 403 B
./dist/components/ChannelList/index.js 78 B
./dist/components/ChannelList/utils.js 270 B
./dist/components/ChannelPreview/ChannelPreview.js 889 B
./dist/components/ChannelPreview/ChannelPreviewMessenger.js 780 B
./dist/components/ChannelPreview/hooks/index.js 97 B
./dist/components/ChannelPreview/hooks/useChannelPreviewInfo.js 445 B
./dist/components/ChannelPreview/hooks/useIsChannelMuted.js 299 B
./dist/components/ChannelPreview/hooks/useMessageDeliveryStatus.js 744 B
./dist/components/ChannelPreview/index.js 81 B
./dist/components/ChannelPreview/utils.js 580 B
./dist/components/ChannelSearch/ChannelSearch.js 816 B
./dist/components/ChannelSearch/hooks/useChannelSearch.js 1.64 kB
./dist/components/ChannelSearch/icons.js 684 B
./dist/components/ChannelSearch/index.js 85 B
./dist/components/ChannelSearch/SearchBar.js 1.1 kB
./dist/components/ChannelSearch/SearchInput.js 295 B
./dist/components/ChannelSearch/SearchResults.js 1.31 kB
./dist/components/ChannelSearch/utils.js 72 B
./dist/components/Chat/Chat.js 602 B
./dist/components/Chat/hooks/useChannelsQueryState.js 181 B
./dist/components/Chat/hooks/useChat.js 1.13 kB
./dist/components/Chat/hooks/useCreateChatClient.js 452 B
./dist/components/Chat/hooks/useCreateChatContext.js 521 B
./dist/components/Chat/index.js 71 B
./dist/components/ChatAutoComplete/ChatAutoComplete.js 973 B
./dist/components/ChatAutoComplete/index.js 56 B
./dist/components/CommandItem/CommandItem.js 263 B
./dist/components/CommandItem/index.js 51 B
./dist/components/DateSeparator/DateSeparator.js 506 B
./dist/components/DateSeparator/index.js 53 B
./dist/components/Emojis/EmojiPicker.js 985 B
./dist/components/Emojis/index.cjs.js 3.59 kB
./dist/components/Emojis/index.js 51 B
./dist/components/EmoticonItem/EmoticonItem.js 387 B
./dist/components/EmoticonItem/index.js 52 B
./dist/components/EmptyStateIndicator/EmptyStateIndicator.js 443 B
./dist/components/EmptyStateIndicator/icons.js 319 B
./dist/components/EmptyStateIndicator/index.js 59 B
./dist/components/EventComponent/EventComponent.js 738 B
./dist/components/EventComponent/index.js 54 B
./dist/components/Gallery/BaseImage.js 412 B
./dist/components/Gallery/Gallery.js 1 kB
./dist/components/Gallery/Image.js 595 B
./dist/components/Gallery/index.js 70 B
./dist/components/Gallery/ModalGallery.js 605 B
./dist/components/index.js 308 B
./dist/components/InfiniteScrollPaginator/index.js 54 B
./dist/components/InfiniteScrollPaginator/InfiniteScroll.js 1.28 kB
./dist/components/Loading/index.js 76 B
./dist/components/Loading/LoadingChannels.js 276 B
./dist/components/Loading/LoadingErrorIndicator.js 312 B
./dist/components/Loading/LoadingIndicator.js 641 B
./dist/components/LoadMore/index.js 69 B
./dist/components/LoadMore/LoadMoreButton.js 536 B
./dist/components/LoadMore/LoadMorePaginator.js 444 B
./dist/components/MediaRecorder/AudioRecorder/AudioRecorder.js 776 B
./dist/components/MediaRecorder/AudioRecorder/AudioRecordingButtons.js 238 B
./dist/components/MediaRecorder/AudioRecorder/AudioRecordingInProgress.js 720 B
./dist/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.js 561 B
./dist/components/MediaRecorder/AudioRecorder/index.js 75 B
./dist/components/MediaRecorder/AudioRecorder/RecordingTimer.js 227 B
./dist/components/MediaRecorder/classes/AmplitudeRecorder.js 1.09 kB
./dist/components/MediaRecorder/classes/BrowserPermission.js 755 B
./dist/components/MediaRecorder/classes/index.js 86 B
./dist/components/MediaRecorder/classes/MediaRecorderController.js 2.73 kB
./dist/components/MediaRecorder/hooks/index.js 31 B
./dist/components/MediaRecorder/hooks/useMediaRecorder.js 704 B
./dist/components/MediaRecorder/index.js 150 B
./dist/components/MediaRecorder/observable/BehaviorSubject.js 286 B
./dist/components/MediaRecorder/observable/index.js 91 B
./dist/components/MediaRecorder/observable/Observable.js 243 B
./dist/components/MediaRecorder/observable/Observer.js 108 B
./dist/components/MediaRecorder/observable/Subject.js 472 B
./dist/components/MediaRecorder/observable/Subscription.js 129 B
./dist/components/MediaRecorder/RecordingPermissionDeniedNotification.js 418 B
./dist/components/MediaRecorder/transcode/audioProcessing.js 677 B
./dist/components/MediaRecorder/transcode/index.js 344 B
./dist/components/MediaRecorder/transcode/mp3.js 753 B
./dist/components/MediaRecorder/transcode/wav.js 1.8 kB
./dist/components/Message/FixedHeightMessage.js 1.54 kB
./dist/components/Message/hooks/index.js 146 B
./dist/components/Message/hooks/useActionHandler.js 561 B
./dist/components/Message/hooks/useDeleteHandler.js 396 B
./dist/components/Message/hooks/useEditHandler.js 243 B
./dist/components/Message/hooks/useFlagHandler.js 509 B
./dist/components/Message/hooks/useMarkUnreadHandler.js 497 B
./dist/components/Message/hooks/useMentionsHandler.js 334 B
./dist/components/Message/hooks/useMuteHandler.js 666 B
./dist/components/Message/hooks/useOpenThreadHandler.js 265 B
./dist/components/Message/hooks/usePinHandler.js 647 B
./dist/components/Message/hooks/useReactionHandler.js 1.8 kB
./dist/components/Message/hooks/useReactionsFetcher.js 513 B
./dist/components/Message/hooks/useRetryHandler.js 205 B
./dist/components/Message/hooks/useUserHandler.js 193 B
./dist/components/Message/hooks/useUserRole.js 646 B
./dist/components/Message/icons.js 1.25 kB
./dist/components/Message/index.js 160 B
./dist/components/Message/Message.js 1.97 kB
./dist/components/Message/MessageDeleted.js 363 B
./dist/components/Message/MessageEditedTimestamp.js 418 B
./dist/components/Message/MessageErrorText.js 366 B
./dist/components/Message/MessageOptions.js 841 B
./dist/components/Message/MessageRepliesCountButton.js 415 B
./dist/components/Message/MessageSimple.js 2.21 kB
./dist/components/Message/MessageStatus.js 1.09 kB
./dist/components/Message/MessageText.js 863 B
./dist/components/Message/MessageTimestamp.js 281 B
./dist/components/Message/QuotedMessage.js 731 B
./dist/components/Message/renderText/componentRenderers/Anchor.js 297 B
./dist/components/Message/renderText/componentRenderers/Emoji.js 151 B
./dist/components/Message/renderText/componentRenderers/index.js 66 B
./dist/components/Message/renderText/componentRenderers/Mention.js 175 B
./dist/components/Message/renderText/index.js 135 B
./dist/components/Message/renderText/regex.js 378 B
./dist/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.js 241 B
./dist/components/Message/renderText/rehypePlugins/index.js 72 B
./dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.js 972 B
./dist/components/Message/renderText/remarkPlugins/htmlToTextPlugin.js 172 B
./dist/components/Message/renderText/remarkPlugins/index.js 75 B
./dist/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.js 468 B
./dist/components/Message/renderText/renderText.js 1.59 kB
./dist/components/Message/renderText/types.js 31 B
./dist/components/Message/Timestamp.js 444 B
./dist/components/Message/types.js 31 B
./dist/components/Message/utils.js 2.74 kB
./dist/components/MessageActions/CustomMessageActionsList.js 333 B
./dist/components/MessageActions/hooks/index.js 66 B
./dist/components/MessageActions/hooks/useMessageActionsBoxPopper.js 465 B
./dist/components/MessageActions/index.js 77 B
./dist/components/MessageActions/MessageActions.js 1.36 kB
./dist/components/MessageActions/MessageActionsBox.js 1.01 kB
./dist/components/MessageBounce/index.js 70 B
./dist/components/MessageBounce/MessageBounceModal.js 231 B
./dist/components/MessageBounce/MessageBouncePrompt.js 453 B
./dist/components/MessageInput/AttachmentPreviewList/index.js 61 B
./dist/components/MessageInput/AttachmentPreviewList/types.js 31 B
./dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.js 653 B
./dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js 731 B
./dist/components/MessageInput/CooldownTimer.js 230 B
./dist/components/MessageInput/DefaultTriggerProvider.js 409 B
./dist/components/MessageInput/DropzoneProvider.js 491 B
./dist/components/MessageInput/EditMessageForm.js 471 B
./dist/components/MessageInput/hooks/index.js 79 B
./dist/components/MessageInput/hooks/useCommandTrigger.js 779 B
./dist/components/MessageInput/hooks/useCooldownTimer.js 640 B
./dist/components/MessageInput/hooks/useEmojiTrigger.js 498 B
./dist/components/MessageInput/hooks/useLinkPreviews.js 1.25 kB
./dist/components/MessageInput/hooks/useMessageInputText.js 881 B
./dist/components/MessageInput/hooks/useTimeElapsed.js 334 B
./dist/components/MessageInput/hooks/useTimer.js 265 B
./dist/components/MessageInput/hooks/useUserTrigger.js 1.54 kB
./dist/components/MessageInput/hooks/utils.js 1.68 kB
./dist/components/MessageInput/icons.js 2.67 kB
./dist/components/MessageInput/index.js 177 B
./dist/components/MessageInput/LinkPreviewList.js 727 B
./dist/components/MessageInput/MessageInput.js 576 B
./dist/components/MessageInput/QuotedMessagePreview.js 687 B
./dist/components/MessageInput/SendButton.js 226 B
./dist/components/MessageInput/types.js 387 B
./dist/components/MessageList/ConnectionStatus.js 425 B
./dist/components/MessageList/CustomNotification.js 289 B
./dist/components/MessageList/GiphyPreviewMessage.js 193 B
./dist/components/MessageList/hooks/index.js 183 B
./dist/components/MessageList/hooks/MessageList/index.js 128 B
./dist/components/MessageList/hooks/MessageList/useEnrichedMessages.js 628 B
./dist/components/MessageList/hooks/MessageList/useMessageListElements.js 535 B
./dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.js 866 B
./dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.js 793 B
./dist/components/MessageList/hooks/MessageList/useUnreadMessagesNotification.js 988 B
./dist/components/MessageList/hooks/useLastReadData.js 207 B
./dist/components/MessageList/hooks/useMarkRead.js 1.15 kB
./dist/components/MessageList/hooks/VirtualizedMessageList/index.js 158 B
./dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.js 347 B
./dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.js 321 B
./dist/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.js 615 B
./dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js 1.25 kB
./dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.js 445 B
./dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.js 387 B
./dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.js 633 B
./dist/components/MessageList/icons.js 591 B
./dist/components/MessageList/index.js 201 B
./dist/components/MessageList/MessageList.js 2.62 kB
./dist/components/MessageList/MessageListMainPanel.js 187 B
./dist/components/MessageList/MessageListNotifications.js 439 B
./dist/components/MessageList/MessageNotification.js 268 B
./dist/components/MessageList/renderMessages.js 1.08 kB
./dist/components/MessageList/ScrollToBottomButton.js 970 B
./dist/components/MessageList/UnreadMessagesNotification.js 396 B
./dist/components/MessageList/UnreadMessagesSeparator.js 307 B
./dist/components/MessageList/utils.js 2.81 kB
./dist/components/MessageList/VirtualizedMessageList.js 3.65 kB
./dist/components/MessageList/VirtualizedMessageListComponents.js 1.86 kB
./dist/components/MML/index.js 43 B
./dist/components/MML/MML.js 394 B
./dist/components/Modal/icons.js 431 B
./dist/components/Modal/index.js 45 B
./dist/components/Modal/Modal.js 594 B
./dist/components/ReactFileUtilities/FileIcon/FileIcon.js 362 B
./dist/components/ReactFileUtilities/FileIcon/FileIconSet.js 5.26 kB
./dist/components/ReactFileUtilities/FileIcon/iconMap.js 527 B
./dist/components/ReactFileUtilities/FileIcon/index.js 53 B
./dist/components/ReactFileUtilities/FileIcon/mimeTypes.js 833 B
./dist/components/ReactFileUtilities/ImageDropzone.js 914 B
./dist/components/ReactFileUtilities/index.js 110 B
./dist/components/ReactFileUtilities/LoadingIndicator.js 257 B
./dist/components/ReactFileUtilities/types.js 31 B
./dist/components/ReactFileUtilities/UploadButton.js 219 B
./dist/components/Reactions/hooks/useFetchReactions.js 411 B
./dist/components/Reactions/hooks/useProcessReactions.js 947 B
./dist/components/Reactions/index.js 109 B
./dist/components/Reactions/reactionOptions.js 324 B
./dist/components/Reactions/ReactionSelector.js 1.63 kB
./dist/components/Reactions/ReactionsList.js 943 B
./dist/components/Reactions/ReactionsListModal.js 946 B
./dist/components/Reactions/SimpleReactionsList.js 779 B
./dist/components/Reactions/SpriteImage.js 638 B
./dist/components/Reactions/StreamEmoji.js 379 B
./dist/components/Reactions/types.js 31 B
./dist/components/Reactions/utils/utils.js 281 B
./dist/components/SafeAnchor/index.js 74 B
./dist/components/SafeAnchor/SafeAnchor.js 327 B
./dist/components/Thread/icons.js 352 B
./dist/components/Thread/index.js 75 B
./dist/components/Thread/Thread.js 1.2 kB
./dist/components/Thread/ThreadHead.js 278 B
./dist/components/Thread/ThreadHeader.js 430 B
./dist/components/Thread/ThreadStart.js 262 B
./dist/components/Tooltip/hooks/index.js 61 B
./dist/components/Tooltip/hooks/useEnterLeaveHandlers.js 234 B
./dist/components/Tooltip/index.js 47 B
./dist/components/Tooltip/Tooltip.js 372 B
./dist/components/TypingIndicator/index.js 55 B
./dist/components/TypingIndicator/TypingIndicator.js 834 B
./dist/components/UserItem/index.js 48 B
./dist/components/UserItem/UserItem.js 542 B
./dist/components/UtilityComponents/index.js 53 B
./dist/components/UtilityComponents/NullComponent.js 61 B
./dist/components/Window/index.js 46 B
./dist/components/Window/Window.js 351 B
./dist/constants/limits.js 183 B
./dist/constants/messageTypes.js 105 B
./dist/context/ChannelActionContext.js 550 B
./dist/context/ChannelListContext.js 356 B
./dist/context/ChannelStateContext.js 548 B
./dist/context/ChatContext.js 538 B
./dist/context/ComponentContext.js 542 B
./dist/context/index.js 131 B
./dist/context/MessageBounceContext.js 583 B
./dist/context/MessageContext.js 543 B
./dist/context/MessageInputContext.js 329 B
./dist/context/MessageListContext.js 356 B
./dist/context/TranslationContext.js 722 B
./dist/context/TypingContext.js 543 B
./dist/context/utils/getDisplayName.js 83 B
./dist/css/v2/emoji-mart.css 1.84 kB
./dist/css/v2/emoji-replacement.css 300 B
./dist/css/v2/index.css 26.6 kB
./dist/css/v2/index.layout.css 13.7 kB
./dist/i18n/index.js 68 B
./dist/i18n/Streami18n.js 5.32 kB
./dist/i18n/translations.js 172 B
./dist/i18n/utils.js 932 B
./dist/index.js 78 B
./dist/types/index.js 31 B
./dist/types/types.js 31 B
./dist/utils/browsers.js 154 B
./dist/utils/deprecationWarning.js 294 B
./dist/utils/getChannel.js 871 B
./dist/utils/getWholeChar.js 415 B
./dist/utils/index.js 65 B
./dist/utils/mergeDeep.js 170 B
./dist/version.js 64 B

compressed-size-action


The shortcomings of the above approach have been adjusted as follows:

1. All the attachments except the link preview attachments (objects that contain `og_scrape_url` attribute) are now stored in `attachments` array of `MessageInputContext`. Array keeps order and the attachment type can be determined by the `attachment.type` property.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we should not include the link previews in attachments too.

@MartinCupela MartinCupela merged commit 238e801 into master Jul 9, 2024
6 checks passed
@MartinCupela MartinCupela deleted the feat/remova-uploads-state-message-input branch July 9, 2024 12:54
github-actions bot pushed a commit that referenced this pull request Jul 10, 2024
## [12.0.0-rc.3](v12.0.0-rc.2...v12.0.0-rc.3) (2024-07-10)

### ⚠ BREAKING CHANGES

* MP3 audio encoder has to be explicitly imported and
used as a plugin for audio recordings. The default audio recording
format is audio/wav.
* @breezystack/lamejs became a peer dependency and has to
be installed by the integrator so that the MP3 audio encoder can work
properly.
* Removed fileOrder, imageOrder, fileUploads,
imageUploads, uploadFile, uploadImage, removeFile, removeImage from the
MessageInputContext. Use attachments, uploadAttachment, uploadNewFiles, upsertAttachments, removeAttachments instead.
* Removed default values for timestamp formatting props
like calendar or format for DateSeparator, EventComponent,
MessageTimestamp. The formatting configuration now entirely relies on
i18n translations.

### Bug Fixes

* acknowledge the use of LAME ([dbce6dc](dbce6dc))
* extract MP3 encoder plugin ([#2447](#2447)) ([625196f](625196f))
* reflect Message groupStyles prop in the component memoization ([#2448](#2448)) ([251eb08](251eb08))

### Features

* keep attachments array and remove file and image uploads in MessageInput state ([#2445](#2445)) ([238e801](238e801))
* remove default timestamp formatting props from DateSeparator, EventComponent, MessageTimestamp ([#2442](#2442)) ([6431954](6431954))
@stream-ci-bot
Copy link
Collaborator

🎉 This PR is included in version 12.0.0-rc.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Sep 17, 2024
## [12.0.0](v11.23.9...v12.0.0) (2024-09-17)

### ⚠ BREAKING CHANGES

* - own user will not anymore be filtered out of the selection list of users to mention if `mentionAllAppUsers` is enabled on MessageInput
* - removes the following variables from `MessageContext`: isReactionEnabled, onReactionListClick, showDetailedReactions, reactionSelectorRef
- removes prop `messageWrapperRef` from `MessageOptions` and `MessageActions` props.
* ComponentContext no longer provides any defaults
* removed Thread prop fullWidth, removed class str-chat__thread--full
* removed Window prop hideOnThread, replaced class str-chat__main-panel--hideOnThread with str-chat__main-panel--thread-open
* MP3 audio encoder has to be explicitly imported and
used as a plugin for audio recordings. The default audio recording
format is audio/wav.
* @breezystack/lamejs became a peer dependency and has to
be installed by the integrator so that the MP3 audio encoder can work
properly.
* Removed fileOrder, imageOrder, fileUploads,
imageUploads, uploadFile, uploadImage, removeFile, removeImage from the
MessageInputContext. Use attachments, uploadAttachment, uploadNewFiles, upsertAttachments, removeAttachments instead.
* Removed default values for timestamp formatting props
like calendar or format for DateSeparator, EventComponent,
MessageTimestamp. The formatting configuration now entirely relies on
i18n translations.
* The VirtualizedMessageList does not provide default
Footer component
* The VirtualizedMessageList markup has changed as
TypingIndicator is rendered as a child of MessageListMainPanel
* stylesheet import path changed & v1 stylesheet has been dropped, see release guide for more information
* theme v1 related markup and classNames have been removed
* `themeVersion` property has been removed from `ChatContext`

### Bug Fixes

* add theme to ChatView component ([#2494](#2494)) ([d477072](d477072))
* address the circular dependencies among TranslationContext and Streami18n ([#2483](#2483)) ([b91fd9a](b91fd9a))
* change platform for CJS bundle from node to browser ([#2454](#2454)) ([4bc2d35](4bc2d35))
* do not rerender on client options update ([#2465](#2465)) ([3899352](3899352))
* export typeVersions correctly for emojis and mp3-encoder ([#2449](#2449)) ([17218db](17218db))
* extract MP3 encoder plugin ([#2447](#2447)) ([625196f](625196f))
* provide both browser and node cjs bundles ([#2457](#2457)) ([273ea2a](273ea2a))
* quote replies in threads ([#2487](#2487)) ([0e4a6f1](0e4a6f1))
* remove the use of deprecated query operator $ne ([#2504](#2504)) ([09614f6](09614f6))
* render typing indicator outside the VirtualizedMessageList scroll container ([#2406](#2406)) ([d9442d2](d9442d2))
* reuse useChannelPreviewInfo for ThreadListItemUI ([#2508](#2508)) ([4bb5b7c](4bb5b7c))
* update ChannelHeader and ChannelPreview titles and images on channel.updated ([#2500](#2500)) ([f32fbb6](f32fbb6))

### Features

* add centralized dialog management ([#2489](#2489)) ([8235d45](8235d45))
* add ThreadList and ThreadProvider (Threads 2.0) ([#2407](#2407)) ([941707d](941707d))
* keep attachments array and remove file and image uploads in MessageInput state ([#2445](#2445)) ([238e801](238e801))
* remove default timestamp formatting props from DateSeparator, EventComponent, MessageTimestamp ([#2442](#2442)) ([6431954](6431954))
* remove fullWidth prop from Thread & hideOnThread prop from Window ([#2450](#2450)) ([32c8fc0](32c8fc0))
* remove legacy style components ([#2394](#2394)) ([7bf63ae](7bf63ae))

### Chores

* **deps:** bump @stream-io/stream-chat-css to version 5.0.0 ([9580a3f](9580a3f))
* **deps:** bump @stream-io/stream-chat-css to version 5.0.0-rc.1nvm ([e9cf42f](e9cf42f))
* **deps:** bump stream-chat to version 8.40.8 ([#2510](#2510)) ([5cc7a09](5cc7a09))
* **deps:** remove unused isomorphic-ws from dependencies ([853bd8b](853bd8b))
* **deps:** upgrade @stream-io/stream-chat-css to v5.0.0-rc.4 ([#2492](#2492)) ([6e30cb5](6e30cb5))
* **deps:** upgrade @stream-io/stream-chat-css to v5.0.0-rc.5 ([#2495](#2495)) ([2b8fa32](2b8fa32))
@stream-ci-bot
Copy link
Collaborator

🎉 This PR is included in version 12.0.0 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants