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

Improve chat loading time and performance #124

Open
3 tasks
tomastiminskas opened this issue Sep 27, 2024 · 0 comments
Open
3 tasks

Improve chat loading time and performance #124

tomastiminskas opened this issue Sep 27, 2024 · 0 comments
Labels

Comments

@tomastiminskas
Copy link
Contributor

Any chat app in the market (in their desktop version) shows the chat content and its messages immediately when tapping on a chat row. On Sphinx V2 it takes a second or two (while it shows a shimmering loading view) until the content is loaded and presented.

Base branch: develop

Requirements

  • Improves logic and UI to present chat messages immediately when entering a chat from the chats list
  • Remove the need of a shimmering/loading view while the chat content is loading

Acceptance Criteria

  • Reduce load time to ~0 when entering a chat
  • Remove shimmering/loading view
  • Record a video with loom for review when task is completed

References and suggestions

  1. NewChatTableDataSource+ResultsControllerExtension: In this file we have all the logic involved in fetching messages on a chat from the database, processing them and creating the MessageTableCellState objects array responsible of building the UI on each NSCollectionViewItem. The datasource will listen for changes on a query results, process them and run update on the snapshot that controls the collection.
  2. Any way of cashing the MessageTableCellState array so it's available when entering the chat should improve load time significantly, making the fetch of the database to show updated information once the cached chat content is already displayed.
  3. In addition the shimmering view is visible until the NSCollectionView loads its content and it's scrolled to bottom (the scroll offset change consumes time). A huge improvement would be to be able to invert the scroll y axis on a way where the first row (with index 0) would be the one at the very bottom and the initial position of the scroll (with offset 0) is at the bottom. This approach was implemented on iOS reducing the load time significantly, but seems complex and hard to be implemented in a MacOS project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant