chore: Improve channel view performance by virtualizing the messages lists

Merged
MA
5mo ago
+1192-868

Proposed changes (including videos or screenshots)

Migrates the main message list to a virtualized solution to improve performance

I'm using this storybook as an example/guide https://inokawa.github.io/virtua/?path=/story/advanced-chat--default

CORE-1505

TODO:

  • Virtualize Message List
  • Adjust Load more
  • Adjust Jump to Bottom on message sent
  • Adjust Send/Receive Message
  • Adjust Detect is at bottom
  • Adjust Date Bubbles
  • Adjust Unread handling
  • Adjust Restore Scroll Position (Loaded Messages)
  • (wontfix, this does not work with existing implementation) Adjust Restore Scroll Position (unLoaded Messages)
  • Adjust Jump to message
  • Adjust Has new message
  • Adjust Keyboard Navigation
  • Implement πŸ” in threads

Possible next steps:

  • Move all scroll eventlisteners to virtua's onscroll

Existing issues (that will not be fixed on this PR):

  • If you jump to an older message, and someone sends a new message, the message will be inserted into the list and you wont be able to scroll to load more

Issue(s)

Summary by CodeRabbit

  • New Features

    • Virtualized message lists for smoother scrolling and performance
    • Deep-link support for ?msg= targeting channels and threads with centered jump and highlight
    • New custom virtual scrollbars component
  • Improvements

    • More reliable new-message / scroll-to-bottom and jump behavior
    • Improved unread-divider detection and date-scroll handling
    • Debounced persistent scroll position saving
  • Tests

    • Added MessageList scroll behavior tests and updated e2e scrolling helpers