Skip to content

Conversation

HoonBaek
Copy link
Contributor

@HoonBaek HoonBaek commented Feb 14, 2023

UIKIT-3256

Description Of Changes

Creates

  • UI components
    import PlaybackTime from "@sendbird/uikit-react/ui/PlaybackTime"
    import ProgressBar from "@sendbird/uikit-react/ui/ProgressBar"
    import VoiceMessageInput from "@sendbird/uikit-react/ui/VoiceMessageInput"
    import VoiceMessageItemBody from "@sendbird/uikit-react/ui/VoiceMessageItemBody"
    • PlaybackTime: Display the current time in 00:00 format with the received millisecond value
    • ProgressBar: Display the current progress status with the received maxSize and currentSize of millisecond unit value
    • VoiceMessageInput: UI component for recording and playing a voice message
    • VoiceMessageItemBody: UI component for rendering a voice message also able to play voice message
  • VoiceRecorder
    import { VoiceRecorderProvider, useVoiceRecorderContext } from '@sendbird/uikit-react/VoiceRecorder/context'
    import useVoiceRecorder from '@sendbird/uikit-react/VoiceRecorder/useVoiceRecorder'
    • VoiceRecorderProvider: A react context provider component providing start, and stop functions
    • useVoiceRecorderContext: A react useContext hook of VoiceRecorderProvider
    • useVoiceRecorder: A react hook that provides advanced context, recordingLimit, recordingTime, recordingFile, and recordingStatus. Recommend using this hook in the customized components.
  • VoicePlayer
    import { VoicePlayerProvider, useVoicePlayerContext } from '@sendbird/uikit-react/VoicePlayer/context'
    import useVoicePlayer from '@sendbird/uikit-react/VoicePlayer/useVoicePlayer'
    • VoicePlayerProvider: A react context provider component providing play, and pause functions
    • useVoicePlayerContext: A react useContext hook of VoicePlayerProvider
    • useVoicePlayer: A react hook that provides advanced context, playbackTime, duration, and playingStatus. Recommend using this hook in the customized components.
  • utils/isVoiceMessage: A function that you can check if the given message is a voice message
    import isVoiceMessage from '@sendbird/uikit-react/utils/message/isVoiceMessage'
    const isVoiceMsg: boolean = isVoiceMessage(message);

Edits

  • Install lamejs to transcode the audio file to mp3
  • Add props isVoiceMessageEnabled and voiceRecord props to the App, SendbirdProvider, and MessageInput components, to turn on/off the voice message recording feature
    <SendbirdProvider
      isVoiceMessageEnabled
      voiceRecord={{
        maxRecordingTime: 60000,
        minRecordingTime: 1000,
      }}
    >
      {/* implement custom application */}
    </SendbirdProvider>
  • Add props renderFileUploadIcon, renderVoiceMessageIcon, and renderSendMessageIcon into the Channel, ChannelUI, and MessageInput component
  • Add onVoiceMessageIconClick props to the MessageInput component
  • Add onBeforeSendVoiceMessage props to the Channel component
  • Fetch message list including MetaArray in the Channel and Thread modules
  • Provide new icon-type AudioOnLined & new icon-color Primary2 and OnBackground4
  • Provide new string sets
    <SendbirdProvider
      stringSet={{
        BUTTON__OK: 'OK',
        VOICE_MESSAGE: 'Voice Message',
        MODAL__VOICE_MESSAGE_INPUT_DISABLED__TITLE_MUTED: 'You\'re muted by the operator.',
        MODAL__VOICE_MESSAGE_INPUT_DISABLED__TITLE_FROZEN: 'Channel is frozen.',
      }}
    >
      {/* implement custom application */}
    </SendbirdProvider>
    • BUTTON__OK: 'OK' → Used on the submit button of pop up modal
    • MODAL__VOICE_MESSAGE_INPUT_DISABLED__TITLE_MUTED: 'You're muted by the operator.' → Used in an alert pop-up modal
    • MODAL__VOICE_MESSAGE_INPUT_DISABLED__TITLE_FROZEN: 'Channel is frozen.' → Used in an alert pop-up modal
    • VOICE_MESSAGE: 'Voice Message' → Used in ChannelPreviewItem, QuoteMessage, and MessageSearch to appear that the message type is the voice

Types Of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply_

  • Bugfix
  • New feature
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance (ex) Prettier)
  • Build configuration
  • Improvement (refactor code)

* Add string set
  * CHANNEL_SETTING__OPERATORS__ADD_BUTTON: 'Add'
  * CHANNEL_SETTING__MODERATION__EMPTY_BAN: 'No banned members yet'
  * CHANNEL_SETTING__MODERATION__ALL_BAN: 'All banned members'
* Apply string set
  * on the BannedUserList component
    * `No banned members yet`
    * `All banned members`
    * `Unban` on the context menu of the banned user list
  * on the BannedUsersModal component
    * `Unban` on the context menu of the banned user list
  * on the AddOperatorsModal component
    * `Add` for the submit button
  * on the InviteUsersModal component
    * `Invite` for the submit button
  * on the MutedMembersModal component
    * `Unmute` on the context menu of the muted user list

* Remove string set
  * CHANNEL_SETTING__UNMUTE: 'Unmute'
* Replace the string set to CHANNEL_SETTING__MODERATION__UNMUTE on the MutedMemberList component

* Modify CSS
  * To improve the word break with StringSet customization on the submit button
* Use the same word-splitting logic on the TextMessage and OGMessage
  * TextMessage will also allow opening the URL links
* Use the same word wrapping style on the TextMessage and OGMessage
* Issue: A customer said the `userIdsFilter` of ChannelListQuery doesn't work when receiving messages
There's been an internal channel filtering logic with custom channelListQuery, but it's broken because we've used the outdated interface of Chat SDK.

* Fix: We migrated the outdated interface `_searchFilter` and `_userIdsFilter` to new things `searchFilter` and `userIdsFilter`
Copy link
Contributor

@sravan-s sravan-s left a comment

Choose a reason for hiding this comment

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

Thanks @HoonBaek This looks like a gigantic amount of work 🙇

@HoonBaek HoonBaek merged commit b6a85cd into develop/Voice-message Feb 22, 2023
@HoonBaek HoonBaek deleted the fix/UIKIT-3053/Modify-issues-on-voice-message branch February 22, 2023 02:05
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.

2 participants