feat: migrate MessageSearch to PaginatedVirtualList#2
Open
srijnabhargav wants to merge 7 commits into
Open
Conversation
Introduces a generic VirtualList component backed by the virtua Virtualizer. Supports end-reach callbacks (with async lock), configurable overscan, and a semantic ul/li structure via VirtuaListContainer. Pairs with the existing CustomVirtuaScrollbars from @rocket.chat/ui-client.
Replaces the Virtuoso + VirtualizedScrollbars + useResizeObserver setup with the new VirtualList component. The loadMoreItems signature simplifies from (start, end) to () => void, deferring pagination logic to the data layer.
- New VirtualList.spec.tsx covers end-reach, overscan, and scroll behaviour
using a mocked Virtualizer handle
- DiscussionsList.spec.tsx updated for the virtua-backed VirtualList (new
snapshot generated)
- MessageList.spec.tsx: replace require('react') with jest.requireActual to
silence @typescript-eslint/no-require-imports
70b5698 to
310c396
Compare
4ba2638 to
1d06bc4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes
This PR migrates
MessageSearchfromreact-virtuosoto the sharedPaginatedVirtualListcomponent introduced by the Virtua foundation work.Changes include:
react-virtuosoimplementation withPaginatedVirtualListuseMessageSearchQuerytouseInfiniteQuerywith{ items, itemCount }for paginationMessageSearchwith the same consumer pattern used inDiscussionsListandThreadListMessageSearchTabThe goal is to keep
MessageSearchconsistent with the new virtualization approach while keeping the scope limited to MessageSearch-specific changes.Issue(s)
Part of the Virtua migration work for the contextual bar lists.
Further comments
This PR should be merged after the Virtua foundation work (
PaginatedVirtualListandDiscussionsListmigration), #39394, as it reuses the shared virtualization infrastructure introduced there and only contains MessageSearch-specific changes.Test plan
yarn .testunit:jest --testPathPatterns='contextualBar/MessageSearchTab'yarn typecheckinapps/meteorworking video (no regressions):
Screen.Recording.2026-03-23.at.12.48.18.AM.mov