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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: long message content overflowing issue in overlay #2244

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

vishalnarkhede
Copy link
Contributor

馃幆 Goal

This PR fixes two UX issues:

馃洜 Implementation details

Issue 1

There are two types of message overlay. One where we show message actions and another one where we show reactions from all the users. The overflowing content can only be resolved by adding ScrollView on message overlay. At some point we decided to remove ScrollView because we already have a FlatList in OverlayReactions component (as shown in 2nd screenshot below). FlatList inside ScrollView results into red warning from RN

Screenshot 2023-09-28 at 16 35 07 Screenshot 2023-09-28 at 16 32 33

Solution

  • Add the ScrollView on the message overlay, but only when we show message actions.
  • For this screen, there won't be any text truncation
  • Text truncation only works when we show reactions within message overlay. Message will be truncated to number of lines provided by messageTextNumberOfLines prop.
Screen.Recording.2023-09-28.at.16.47.33.mov

Issue 2

First issue is about messageTextNumberOfLines not working as expected. The reason being, this prop was added to every paragraph's Text node, which would result in each paragraph being truncated to given number of lines.

Solution

There is no perfect solution for this at the moment. But we can improve this, by adding this prop only to the first paragraph. But keep in mind that this would also mean that if first paragraph only contains 2 lines and messageTextNumberOfLines is set to 3 - we will show the first paragraph completely and hide rest of the paragraphs without any truncation suffix (...). But I think its a worthy tradeoff.

馃帹 UI Changes

iOS
Before After
Android
Before After

馃И Testing

鈽戯笍 Checklist

  • I have signed the Stream CLA (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

@santhoshvai santhoshvai merged commit 0e37670 into develop Sep 28, 2023
6 checks passed
@santhoshvai santhoshvai deleted the fix/overlay-overflow-issue branch September 28, 2023 15:30
@github-actions github-actions bot mentioned this pull request Oct 3, 2023
6 tasks
vishalnarkhede added a commit that referenced this pull request Oct 3, 2023
* fix: long message content overflowing issue in overlay (#2244)

* fix: missing Japanese translation (#2243)

* Correct Japanese translation for thread

* Add missing Japanese translation for thread

* fix: url param serialisation issue on iOS 17 (#2246)

---------

Co-authored-by: atsss <atsushi0623itoh@gmail.com>
@stream-ci-bot
Copy link
Contributor

馃帀 This PR is included in version 5.18.1 馃帀

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

Successfully merging this pull request may close these issues.

None yet

3 participants