Skip to content

feat: migrate ThreadList to PaginatedVirtualList#40845

Open
srijnabhargav wants to merge 2 commits into
RocketChat:developfrom
srijnabhargav:feat/virtua-threadlist-migration
Open

feat: migrate ThreadList to PaginatedVirtualList#40845
srijnabhargav wants to merge 2 commits into
RocketChat:developfrom
srijnabhargav:feat/virtua-threadlist-migration

Conversation

@srijnabhargav

@srijnabhargav srijnabhargav commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

This PR migrates ThreadList from react-virtuoso to the shared PaginatedVirtualList component introduced by the Virtua foundation work.

Changes include:

  • Replacing the existing react-virtuoso implementation with PaginatedVirtualList
  • Aligning ThreadList with the same consumer pattern used in DiscussionsList
  • Removing Virtuoso-specific setup and resize handling
  • Reusing the shared virtualization infrastructure to reduce duplication and simplify future maintenance

The goal is to keep ThreadList consistent with the new virtualization approach while keeping the scope of the PR limited to ThreadList-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 (PaginatedVirtualList and DiscussionsList migration), #39394 as it reuses the shared virtualization infrastructure introduced there and only contains ThreadList-specific changes.

Summary by CodeRabbit

  • Refactor

    • Improved thread list rendering by simplifying the virtualization approach and implementing pagination instead.
    • Enhanced pagination behavior to prevent unnecessary data fetching while loading.
  • Tests

    • Updated thread list test setup.

@srijnabhargav srijnabhargav requested a review from a team as a code owner June 8, 2026 13:27
@dionisio-bot

dionisio-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f0c1e62

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@srijnabhargav srijnabhargav marked this pull request as draft June 8, 2026 13:27
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2289a94-46ba-49e3-8a43-3a164c3d9752

📥 Commits

Reviewing files that changed from the base of the PR and between 6908462 and f0a93f0.

📒 Files selected for processing (2)
  • apps/meteor/client/views/room/contextualBar/Threads/ThreadList.spec.tsx
  • apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx
💤 Files with no reviewable changes (1)
  • apps/meteor/client/views/room/contextualBar/Threads/ThreadList.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer

Walkthrough

ThreadList component is migrated from react-virtuoso to PaginatedVirtualList. The change removes useResizeObserver-based container sizing and updates test mocks accordingly. Pagination behavior is refined to disable onEndReached while pending.

Changes

ThreadList Migration to PaginatedVirtualList

Layer / File(s) Summary
ThreadList component virtualization migration
apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx
ThreadList replaces react-virtuoso with PaginatedVirtualList, removes useResizeObserver hook and its ref-based sizing measurement, wraps the list in a Box with minHeight: 0, and conditionally disables onEndReached callback while pending. Imports are updated to reflect the new virtualization dependency.
ThreadList test infrastructure cleanup
apps/meteor/client/views/room/contextualBar/Threads/ThreadList.spec.tsx
VirtuosoMockContext import and its Provider wrapper are removed from the "error-not-allowed" test case; the HTTP endpoint mock and rendered error assertion remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • MartinSchoeler
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: migrating ThreadList component from react-virtuoso to PaginatedVirtualList, which is the primary focus of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Jun 8, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 14 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/components/VirtualList/VirtualList.tsx">

<violation number="1" location="apps/meteor/client/components/VirtualList/VirtualList.tsx:67">
P1: Pagination lock can get permanently stuck after a successful `onEndReached` call that does not change tracked item metadata, blocking all future pagination.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

if (isEndReachedLockedRef.current) {
return;
}
isEndReachedLockedRef.current = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: Pagination lock can get permanently stuck after a successful onEndReached call that does not change tracked item metadata, blocking all future pagination.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/components/VirtualList/VirtualList.tsx, line 67:

<comment>Pagination lock can get permanently stuck after a successful `onEndReached` call that does not change tracked item metadata, blocking all future pagination.</comment>

<file context>
@@ -0,0 +1,109 @@
+			if (isEndReachedLockedRef.current) {
+				return;
+			}
+			isEndReachedLockedRef.current = true;
+
+			try {
</file context>

@srijnabhargav srijnabhargav force-pushed the feat/virtua-threadlist-migration branch from 6908462 to 019d3de Compare June 8, 2026 17:58
@srijnabhargav srijnabhargav marked this pull request as ready for review June 8, 2026 17:59

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@srijnabhargav srijnabhargav force-pushed the feat/virtua-threadlist-migration branch from 019d3de to e21d902 Compare June 8, 2026 18:39
@coderabbitai coderabbitai Bot removed the type: feature Pull requests that introduces new feature label Jun 8, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.07%. Comparing base (1a9ced9) to head (f0c1e62).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40845      +/-   ##
===========================================
+ Coverage    70.02%   70.07%   +0.04%     
===========================================
  Files         3355     3355              
  Lines       129162   129153       -9     
  Branches     22337    22392      +55     
===========================================
+ Hits         90443    90500      +57     
+ Misses       35421    35356      -65     
+ Partials      3298     3297       -1     
Flag Coverage Δ
e2e 59.24% <ø> (-0.02%) ⬇️
e2e-api 46.26% <ø> (+0.07%) ⬆️
unit 69.98% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@srijnabhargav srijnabhargav force-pushed the feat/virtua-threadlist-migration branch from f0a93f0 to f0c1e62 Compare June 11, 2026 15:17
@srijnabhargav

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest develop after the Virtua foundation PR merged. No functional changes beyond the ThreadList migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant