Skip to content

fix: thread pagination not loading when dragging the scrollbar - #41705

Merged
dionisio-bot[bot] merged 2 commits into
developfrom
fix/thread-scrollbar-pagination
Aug 6, 2026
Merged

fix: thread pagination not loading when dragging the scrollbar#41705
dionisio-bot[bot] merged 2 commits into
developfrom
fix/thread-scrollbar-pagination

Conversation

@jessicaschelly

@jessicaschelly jessicaschelly commented Aug 5, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Thread pagination was guarded until the user interacted with the message list. However, dragging the custom overlay scrollbar did not count as an interaction because the scrollbar is rendered outside the scrollable viewport.

This change listens for pointerdown on the viewport's parent, where events from the overlay scrollbar are received. The listener is removed during cleanup. This matches the existing room-history pagination behavior in #41098.

The test verifies that:

  • Scrolling before a recognized user interaction does not fetch another page.
  • Interacting with the overlay scrollbar and reaching the upper pagination threshold fetches the previous page.

Issue(s)

CORE-2512

Steps to test or reproduce

  1. Open a channel with a thread containing enough replies to have unloaded pages.
  2. Open the thread.
  3. Without using the mouse wheel, drag the overlay scrollbar to the top.
  4. Confirm that reaching the pagination threshold fetches the previous page.
  5. Confirm that wheel, touch, and keyboard scrolling continue to work as expected.

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved thread message scrolling behavior so older messages load only after intentional scrollbar interaction followed by scrolling.
    • Prevented unintended message fetches from scrolling alone.
  • Tests
    • Added coverage for scrollbar interaction and ensured previous-page requests occur exactly once.

@dionisio-bot

dionisio-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a7c8ef7

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

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

ThreadMessageList now tracks pointer interaction on the scroll container parent. New tests verify that ordinary scrolling does not fetch older messages, while overlay-scrollbar interaction triggers one previous-page fetch.

Changes

Thread pagination interaction

Layer / File(s) Summary
Pointer interaction tracking
apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.tsx
The list registers pointerdown on its parent element and removes the previous touchmove listener. Wheel and keyboard listeners remain active.
Previous-page loading validation
apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.spec.tsx
The test setup mocks virtualization, UI components, hooks, context, and message data. The pagination test verifies that scrolling alone does not fetch older messages, while overlay-scrollbar interaction triggers fetchPreviousPage once.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: martinschoeler, tassoevan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the fix for thread pagination when dragging the scrollbar.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2512: Request failed with status code 401

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.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.64%. Comparing base (692be5e) to head (a7c8ef7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #41705    +/-   ##
=========================================
  Coverage    68.64%   68.64%            
=========================================
  Files         4164     4164            
  Lines       158957   159264   +307     
  Branches     28160    28282   +122     
=========================================
+ Hits        109113   109334   +221     
- Misses       44678    44771    +93     
+ Partials      5166     5159     -7     
Flag Coverage Δ
e2e 58.85% <66.66%> (-0.03%) ⬇️
e2e-api 45.73% <ø> (-0.02%) ⬇️
unit 70.53% <100.00%> (-0.03%) ⬇️

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.

@jessicaschelly jessicaschelly changed the title fix: thread scrollbar pagination fix: trigger thread pagination when dragging the scrollbar Aug 5, 2026
@jessicaschelly jessicaschelly changed the title fix: trigger thread pagination when dragging the scrollbar fix: load thread pages when dragging the scrollbar Aug 5, 2026
@jessicaschelly
jessicaschelly marked this pull request as ready for review August 5, 2026 20:57
@jessicaschelly
jessicaschelly requested a review from a team as a code owner August 5, 2026 20:57
@jessicaschelly jessicaschelly added this to the 8.8.0 milestone Aug 5, 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.

All reported issues were addressed across 2 files

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

Re-trigger cubic

@nazabucciarelli

Copy link
Copy Markdown
Contributor

we should add a patch changeset and modify the PR title to explain what's being fixed instead of how (https://developer.rocket.chat/docs/pull-requests-tags)

@nazabucciarelli nazabucciarelli added the stat: QA assured Means it has been tested and approved by a company insider label Aug 6, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 6, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@jessicaschelly jessicaschelly added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Aug 6, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 6, 2026
@jessicaschelly jessicaschelly changed the title fix: load thread pages when dragging the scrollbar fix: load more thread messages when dragging the scrollbar Aug 6, 2026
@jessicaschelly jessicaschelly changed the title fix: load more thread messages when dragging the scrollbar fix: thread pagination not loading when dragging the scrollbar Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@jessicaschelly jessicaschelly added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Aug 6, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@jessicaschelly jessicaschelly removed the stat: ready to merge PR tested and approved waiting for merge label Aug 6, 2026
@jessicaschelly jessicaschelly added the stat: ready to merge PR tested and approved waiting for merge label Aug 6, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 6, 2026
Merged via the queue into develop with commit 9f7dc1f Aug 6, 2026
56 checks passed
@dionisio-bot
dionisio-bot Bot deleted the fix/thread-scrollbar-pagination branch August 6, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants