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(angular): bottom loading indicator #304

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

szuperaz
Copy link
Contributor

@szuperaz szuperaz commented Jul 22, 2024

🎯 Goal

Previously the Angular SDK only displayed a loading indicator at the top of the message list (loading older messages).

However, the new virtualized message list removes DOM nodes when the user scrolls to the very top or bottom of the current message list, causing a short pause in the scrolling (the virtualized message list inside the Angular SDK is a simpler version than what you have in React, it doesn't track the height of each message, that's why it can only remove DOM nodes when the user reaches the very top/bottom of the currently displayed list).

This means that if the user scrolls up a lot, then down a lot, the virtualized list will change the displayed messages when the user scrolls to the bottom of the current message list, this happens very fast, but still, without a loading indicator the user might think that they reached the very end of the message list (when in fact they just reached the very end of the currently displayed items).

To solve this issue the Angular SDK displays a loading indicator at the bottom too. However this caused 2 issues, which this PR solves.

This PR only affects the Angular SDK.

🛠 Implementation details

Issue 1

If we display the loading indicator at the bottom, it messes up the scrollbar. See attached video

Screen.Recording.2024-07-22.at.13.41.16.mov

I'm not sure why this happen, but my guess: we animate the div that contains the loading indicator SVG, which is a full-width item, and when we rotate the item, it will create a "propeller" visualized by the following under:

Screenshot 2024-07-22 at 13 42 35

Issue 2

I needed to add a "placeholder" loading indicator that is visible when the loading indicator itself is not, without it, the user might not notice that new messages appeared in the message list

🎨 UI Changes

Add relevant screenshots

Make sure to test with both Angular and React (with both MessageList and VirtualizedMessageList components) SDKs

@szuperaz szuperaz merged commit 7325631 into main Jul 22, 2024
1 check passed
@szuperaz szuperaz deleted the angular-loading-indicator branch July 22, 2024 12:23
github-actions bot pushed a commit that referenced this pull request Jul 22, 2024
## [4.17.4](v4.17.3...v4.17.4) (2024-07-22)

### Bug Fixes

* **angular:** bottom loading indicator ([#304](#304)) ([7325631](7325631))
github-actions bot pushed a commit that referenced this pull request Aug 29, 2024
# [5.0.0-rc.3](v5.0.0-rc.2...v5.0.0-rc.3) (2024-08-29)

### Bug Fixes

* **angular:** bottom loading indicator ([#304](#304)) ([7325631](7325631))

### Features

* threads 2.0 styling ([#305](#305)) ([c138ed3](c138ed3))
Copy link

🎉 This PR is included in version 5.0.0-rc.3 🎉

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

Successfully merging this pull request may close these issues.

5 participants