Load thread data in MessageListController if initially opened for a thread #5489
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
Proposal:
MessageListController
with aparentMessageId
(in order to focus a message in a thread, or to open a thread), we are experiencing a small flicker: First the default message list is shown for a brief moment, and then it automatically switches to thread mode. (mostly noticeable on lower end devices (tested on Samsung A05))The idea of this PR is to remove this flicker, by ensuring that we don't show the default message list, but rather directly enter the thread view.
🛠 Implementation details
init
block in theMessageListController
such that if it is started with aparentMessageId
, it enters thread mode immediately. After the operation is complete, ensure theclientState
is observed (so that going back from the thread mode properly returns the user to the default message list)enterThreadSequential
invocation fromprocessMessageId
-> it will already be invoked in theinit
block, before calling theprocessMessageId
processMessageId
method toinitialFocusMessage
- as it only handles the initial focusing of the message.Important: This change has a side effect, that the user can now start the
MessageListController
with aparentMessageId
but withoutmessageId
(previously not possible). TheparentMessageId
will serve as an indicator that a thread from theparentMessageId
should be initially opened, and themessageId
will continue to act as the target message to be initially highlighted/focused.🎨 UI Changes
controller-before.mp4
controller-after.mp4
🧪 Testing
Threads case:
Search case: