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: scroll to bottom issue when the message list is empty #2471

Merged
merged 3 commits into from Apr 2, 2024

Conversation

khushal87
Copy link
Member

馃幆 Goal

The goal of the PR is to solve the scroll-to-bottom visible issue when the message list is empty and also not to show the scroll-to-bottom button after the offset is reached.

PFA the video attached that shows the previous and new behaviour(as per the PR):

Previous:

IMG_6093.MOV

New:

IMG_6092.MOV

馃洜 Implementation details

馃帹 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

Comment on lines 527 to 529
} else {
setScrollToBottomButtonVisible(true);
setScrollToBottomButtonVisible(false);
}
Copy link
Member

Choose a reason for hiding this comment

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

this seems like a big change...

have you also tested with jump to message? its in sample-app mention screen

Copy link
Member Author

Choose a reason for hiding this comment

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

This works fine.

@@ -805,13 +805,15 @@ const MessageListWithContext = <

const handleScroll: ScrollViewProps['onScroll'] = (event) => {
const offset = event.nativeEvent.contentOffset.y;
const messageListHasMessages = channel.state.messages.length > 0;
Copy link
Member

Choose a reason for hiding this comment

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

how about thread list here? a thread list can also be empty right ?

you have to check this via the thread screen.. when navigating to a thread screen directly channel.state.messages.length has no relation..

so then we have to check the length of the message list that is used to render I believe

Copy link
Member

Choose a reason for hiding this comment

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

it should be processedMessageList.length here in my view

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed 馃憤馃徎

@khushal87 khushal87 merged commit a05573f into develop Apr 2, 2024
4 checks passed
@khushal87 khushal87 deleted the fix-scroll-to-bottom-bug branch April 2, 2024 15:18
@github-actions github-actions bot mentioned this pull request Apr 2, 2024
@stream-ci-bot
Copy link
Contributor

馃帀 This PR is included in version 5.27.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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants