-
Notifications
You must be signed in to change notification settings - Fork 279
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: prevent flashing EmptyStateIndicator in ChannelList before the first channels page is loaded #2150
Merged
MartinCupela
merged 1 commit into
master
from
fix/prevent-empty-state-flash-in-channel-list-loading
Oct 31, 2023
Merged
fix: prevent flashing EmptyStateIndicator in ChannelList before the first channels page is loaded #2150
MartinCupela
merged 1 commit into
master
from
fix/prevent-empty-state-flash-in-channel-list-loading
Oct 31, 2023
Conversation
This file contains 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
…irst channels page is loaded
Size Change: +139 B (0%) Total Size: 1.9 MB
ℹ️ View Unchanged
|
oliverlaz
approved these changes
Oct 31, 2023
MartinCupela
deleted the
fix/prevent-empty-state-flash-in-channel-list-loading
branch
October 31, 2023 15:18
🎉 This PR is included in version 10.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
github-actions bot
pushed a commit
that referenced
this pull request
Nov 2, 2023
## [11.0.0-rc.3](v11.0.0-rc.2...v11.0.0-rc.3) (2023-11-02) ### Bug Fixes * prevent flashing EmptyStateIndicator in ChannelList before the first channels page is loaded ([#2150](#2150)) ([a2a9645](a2a9645)) ### Features * add commands translations ([#2149](#2149)) ([f55c86f](f55c86f)) ### Chores * **deps:** bump @stream-io/stream-chat-css to v4-rc ([#2153](#2153)) ([030688f](030688f))
🎉 This PR is included in version 11.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
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.
🎯 Goal
The
EmptyStateIndicator
was flashing before the first channels query used to be triggered. This is a strange UX.This was happening because before the first query there were 0 channels loaded and
channelsQueryState.queryInProgress
was initialized withnull
what translates to valid state of channels query returning 0 channels.🛠 Implementation details
This PR introduces a new state / value for
ChatContext.channelsQueryState.queryInProgress
and that is'uninitialized'
. We cannot use'reload'
as the first value forqueryInProgress
state , because theChannel
component also relies on this status. If theChannel
was not rendered withChannelList
the state would never transition tonull
(done insideChannelList
) thus never rendering theChannel
contents.With this PR, the
'uninitialized'
state would translate into renderingLoadingIndicator
in theChannelList
. The new state, however, would not be reflected in theChannel
(again, because of the possibility of rendering theChannel
withoutChannelList
).