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

feat: Implement "scroll-back" to latest message when navigating replies #877

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

f-person
Copy link

Contributor checklist

  • My commits are rebased on the latest master branch
  • My commits are in nice logical chunks
  • My contribution is fully baked and is ready to be merged as is
  • I have tested my contribution on these devices:
  • iPad Air (5th generation) on Simulator; iOS 16.4

Description

This commit adds a navigation history for quoted messages, such as if
Alice navigated to message A by pressing the "quoted message" inside the
reply message B and pressed the "scroll down button", the chat will be
scrolled back to message B instead of the very bottom. This is true for
as many replies as the user navigates through.
All the messages higher than the lowest fully visible message
are automatically cleared from the stack as the user scrolls.

This feature makes it easier to read threaded conversations,
especially in scenarios with much to catch up on. This is most useful in
group chats and communities.

Demo screen recording:

Screen.Recording.2023-07-28.at.21.14.03.mov

This commit adds a navigation history for quoted messages, such as if
Alice navigated to message A by pressing the "quoted message" inside the
reply message B and pressed the "scroll down button", the chat will be
scrolled back to message B instead of the very bottom. This is true for
as many replies as the user navigates through.
All the messages higher than the lowest fully visible message
are automatically cleared from the stack as the user scrolls.

This feature makes it easier to read threaded conversations,
especially in scenarios with much to catch up on. This is most useful in
group chats and communities.
}

func onScrollFinished() {
DispatchQueue.main.async { [weak self] in
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we perhaps want to add the older code from scrollViewDidEndDragging and scrollViewDidEndScrollingAnimation to onScrollFinished as well? I'm not entirely sure they need to be fired every time scrolling is complete, though :)

// MARK: - SessionUtilRespondingViewController

func isConversation(in threadIds: [String]) -> Bool {
return threadIds.contains(self.viewModel.threadData.threadId)
}
}

struct ConversationReplyNavigationStack {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find a better place to add this, but let me know if there is one, and I'll move it :)

@f-person
Copy link
Author

@RyanRory PTL :)

@KeeJef
Copy link
Collaborator

KeeJef commented Jul 31, 2023

I'll add this to the planning backlog, but will require some review and will be fairly low priority for now considering other tasks ongoing (Push notification and disappearing message overhauls)

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