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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jumping to bottom when loading new messages #2945

Merged

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Dec 20, 2023

🔗 Issue Links

Resolves https://github.com/GetStream/ios-issues-tracking/issues/682

🎯 Goal

Fix the message list jumping to the bottom when loading new messages.

Before, whenever the newest message inserted was from the current user, we would scroll to the bottom. This is incorrect, since when loading new messages, if the last message author, is the current user, it will scroll to it. Now, it will only scroll if there is one insertion, which is what happens when the current user creates a new message.

🧪 Manual Testing Notes

  1. Jump to a mid-page
  2. Load new pages (Scroll to the bottom)
  3. When loading the newest page the newest message is by the current logged-in user
  4. The message list should not scroll to the bottom automatically

Note: The difference is not very noticeable sometimes. This issue also fixes another case where sometimes if a channel was opened and then quickly scrolling to the top, would unwillingly scroll to the bottom.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

@nuno-vieira nuno-vieira force-pushed the fix/jumping-to-newest-message-when-loading-newest-page branch from a7b37ec to 97f38b5 Compare December 20, 2023 22:23
@nuno-vieira nuno-vieira added 🐞 Bug An issue or PR related to a bug 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK labels Dec 20, 2023
@nuno-vieira nuno-vieira marked this pull request as ready for review December 20, 2023 22:29
@nuno-vieira nuno-vieira requested a review from a team as a code owner December 20, 2023 22:29
Copy link

sonarcloud bot commented Dec 20, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

47 New issues
0 Security Hotspots
91.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@nuno-vieira nuno-vieira merged commit bf7e4a1 into develop Dec 21, 2023
5 checks passed
@nuno-vieira nuno-vieira deleted the fix/jumping-to-newest-message-when-loading-newest-page branch December 21, 2023 10:19
This was referenced Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants