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

Load thread data in MessageListController if initially opened for a thread #5489

Merged

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Nov 26, 2024

🎯 Goal

Proposal:

  • Currently when we are instantiating a MessageListController with a parentMessageId (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

  1. Change the init block in the MessageListController such that if it is started with a parentMessageId, it enters thread mode immediately. After the operation is complete, ensure the clientState is observed (so that going back from the thread mode properly returns the user to the default message list)
  2. Remove the enterThreadSequential invocation from processMessageId -> it will already be invoked in the init block, before calling the processMessageId
  3. Rename the processMessageId method to initialFocusMessage - 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 a parentMessageId but without messageId (previously not possible). The parentMessageId will serve as an indicator that a thread from the parentMessageId should be initially opened, and the messageId will continue to act as the target message to be initially highlighted/focused.

🎨 UI Changes

Before After
controller-before.mp4
controller-after.mp4

🧪 Testing

Threads case:

  1. Open compose sample app
  2. Open 'Threads' tab
  3. Click on a thread
  4. There shouldn't be a flicker when opening the thread

Search case:

  1. Open compose sample app
  2. Search for a message in a thread
  3. Click on the search result
  4. There shouldn't be a flicker when opening and highlighting the thread reply

@VelikovPetar VelikovPetar marked this pull request as ready for review November 26, 2024 10:16
@VelikovPetar VelikovPetar requested a review from a team as a code owner November 26, 2024 10:16
@JcMinarro JcMinarro enabled auto-merge (squash) November 27, 2024 15:51
@JcMinarro JcMinarro merged commit 9c5da81 into develop Nov 27, 2024
9 checks passed
@JcMinarro JcMinarro deleted the feature/improve_message_list_controller_when_loading_threads branch November 27, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants