Merged
Conversation
Contributor
SDK Size
|
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
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.
This pull request introduces extensive updates to the attachment picker functionality, focusing on adding a new
disableAttachmentPickermode. When enabled, this mode bypasses the custom attachment picker UI and instead uses native pickers or alternate flows for attachments and commands. The changes also include several refactorings to ensure that button behavior, UI rendering, and command handling adapt correctly to this new mode, as well as minor improvements to styles and performance.Attachment Picker Disable Mode and UI Adaptation:
Added
disableAttachmentPickersupport throughout the attachment picker and its context, defaulting to true if the image media library is unavailable. This flag is now used to conditionally render the custom picker UI and to switch to native pickers or alternate flows for attachments, commands, and polls. (package/src/components/Channel/Channel.tsx[1] [2] [3];package/src/components/AttachmentPicker/AttachmentPicker.tsx[4] [5];package/src/components/AttachmentPicker/components/AttachmentTypePickerButton.tsx[6] [7] [8] [9] [10] [11] [12]Refactored all attachment picker buttons (
MediaPickerButton,CameraPickerButton,FilePickerButton,PollPickerButton,CommandsPickerButton) to respect thedisableAttachmentPickerflag, invoking native pickers or alternate flows as appropriate. (package/src/components/AttachmentPicker/components/AttachmentTypePickerButton.tsx[1] [2] [3] [4] [5]Command Picker and Sheet Handling:
Updated the command picker logic to provide a bottom sheet modal for commands when the attachment picker is disabled, and adjusted command item press handling to close the sheet and focus the input. (
package/src/components/AttachmentPicker/components/AttachmentTypePickerButton.tsx[1];package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx[2]Refactored command picker item components to separate UI and logic, allowing for different behaviors based on the attachment picker mode. (
package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsxpackage/src/components/AttachmentPicker/components/AttachmentPickerContent.tsxL103-R164)Component and Style Improvements:
Replaced usage of
BottomSheetFlatListwithFlatListin the command picker for improved compatibility and performance. (package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx[1] [2]Improved style definitions for better readability and maintainability, including minor fixes in selection bar and video attachment preview styles. (
examples/SampleApp/src/components/AttachmentPickerSelectionBar.tsx[1];package/src/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.tsx[2] [3]Other Notable Changes:
Increased the number of columns in the emoji reaction picker and disabled virtualization to improve animation performance. (
package/src/components/MessageMenu/MessageReactionPicker.tsxpackage/src/components/MessageMenu/MessageReactionPicker.tsxL164-R171)Cleaned up redundant code related to the attachment picker toggle and context usage. (
package/src/components/MessageInput/components/InputButtons/AttachButton.tsx[1] [2]