-
Notifications
You must be signed in to change notification settings - Fork 360
Next Release #3322
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
Closed
Next Release #3322
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
This pull request refactors and modernizes the audio attachment components, improving state management, playback control, and code clarity. The most significant changes are the migration to a centralized audio player state store, deprecation of legacy callback props, and improved handling for both audio and voice recording attachments. These updates enhance maintainability and user experience across both Expo and native platforms. Starting this PR, integrators can choose to have only a single player instance at a time which can be controlled using the `allowConcurrentAudioPlayback` prop of the Channel component where `false` is the new default. This behaviour is done in parity with React SDK and as per decision. ### **Audio Attachment Component Refactor and State Management Improvements** * Migrated audio playback state (play/pause, progress, duration, playback rate) from local props and callbacks to a centralized state store via `useAudioPlayerControl` and `useStateStore`, removing the need for deprecated callback props like `onLoad`, `onPlayPause`, and `onProgress`. [[1]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL1-R176) [[2]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL273-R205) * Updated UI and logic to use new state values (`isPlaying`, `progress`, `duration`, `currentPlaybackRate`) for rendering controls, progress bars, and playback speed, replacing legacy props and local state. [[1]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL311-R231) [[2]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL347-R277) [[3]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL370-R291) [[4]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL380-R300) [[5]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL393-R313) ### **Voice Recording and Audio Attachment Handling** * Improved detection and handling of voice recordings using the new `isVoiceRecordingAttachment` helper, ensuring correct duration and title display, and simplifying logic for both audio and voice recording types. [[1]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL331-R251) [[2]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L4-R4) ### **File Attachment Group Updates** * Deprecated legacy callback props (`onLoad`, `onProgress`) in `FileAttachmentGroup`, updating documentation and usage to encourage migration to the new state management approach. Also added `message` prop for better context handling. [[1]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L20-R23) [[2]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L52-R59) [[3]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L62-R76) ### **Native and Expo Audio Player Integration** * Improved Expo audio player integration by subscribing to status events earlier and fixing seek logic to use seconds instead of milliseconds, ensuring more accurate playback control. [[1]](diffhunk://#diff-236979f75b937086a72522395304eefdd19108179da9b8a76fa32ed31032da12R102-R103) [[2]](diffhunk://#diff-236979f75b937086a72522395304eefdd19108179da9b8a76fa32ed31032da12L139-R141) [[3]](diffhunk://#diff-037ceecf6320e1a12857962f434b303715602833cd0f4209d1dd090fdc99d55eR134-R136) ### **Progress and Wavefrom progress control performance** Improved the progress and waveform progress bar performance by **10x** as previously the animations were slow and not adhereing to the pattern that could make it fast. These changes collectively modernize the audio attachment experience, making it more robust and easier to maintain.
Contributor
SDK Size
|
## 🎯 Goal - Closes #3324 ## 🛠 Implementation details Applies the translated message text to the clipboard if available. Otherwise, falls back to the original message text (which is the current implementation). ## 🧪 Testing While running a React Native app in development with the Metro Server, make the same edits to `node_modules/stream-chat-react-native-core/src/components/Message/hooks/useMessageActionHandlers.ts` and follow the reproduction steps in the issue. You will see that after the applied changes, the copied text matches expectations (the string the user is reading), rather than the original untranslated text. ## ☑️ Checklist - [x] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [x] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
## 🎯 Goal
<!-- Describe why we are making this change -->
## 🛠 Implementation details
<!-- Provide a description of the implementation -->
## 🎨 UI Changes
<!-- Add relevant screenshots -->
<details>
<summary>iOS</summary>
<table>
<thead>
<tr>
<td>Before</td>
<td>After</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<!--<img src="" /> -->
</td>
<td>
<!--<img src="" /> -->
</td>
</tr>
</tbody>
</table>
</details>
<details>
<summary>Android</summary>
<table>
<thead>
<tr>
<td>Before</td>
<td>After</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<!--<img src="" /> -->
</td>
<td>
<!--<img src="" /> -->
</td>
</tr>
</tbody>
</table>
</details>
## 🧪 Testing
<!-- Explain how this change can be tested (or why it can't be tested)
-->
## ☑️ Checklist
- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required)
- [ ] PR targets the `develop` branch
- [ ] Documentation is updated
- [ ] New code is tested in main example apps, including all possible
scenarios
- [ ] SampleApp iOS and Android
- [ ] Expo iOS and Android
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.
No description provided.