Skip to content

regression: first scroll interaction load more - #41098

Merged
dionisio-bot[bot] merged 1 commit into
release-8.6.0from
regression/scroll
Jun 29, 2026
Merged

regression: first scroll interaction load more#41098
dionisio-bot[bot] merged 1 commit into
release-8.6.0from
regression/scroll

Conversation

@MartinSchoeler

@MartinSchoeler MartinSchoeler commented Jun 29, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Fixes issue that if you scroll using the scrollbar without doing another interaction before, load more messages would not work

Issue(s)

CORE-2355

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved message loading behavior by recognizing a user interaction when pressing down on the chat area’s parent container.
    • This helps scroll/history loading respond more reliably after users begin interacting with the conversation view.

@dionisio-bot

dionisio-bot Bot commented Jun 29, 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 Jun 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7cdebcd

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 Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

In useGetMore, the touchmove event listener on the message container element is replaced with a pointerdown listener registered on element.parentElement. Cleanup logic is updated to remove the new pointerdown listener from the parent instead of touchmove from the element.

Changes

Event listener swap in useGetMore

Layer / File(s) Summary
pointerdown replaces touchmove for interaction gating
apps/meteor/client/views/room/body/hooks/useGetMore.ts
Registers pointerdown on element.parentElement to mark user interaction; removes the prior touchmove registration and updates cleanup to remove the parent pointerdown listener.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main fix: a regression around first scroll interaction and loading more messages.
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.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2355: 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.

@MartinSchoeler
MartinSchoeler marked this pull request as ready for review June 29, 2026 13:55
@MartinSchoeler
MartinSchoeler requested a review from a team as a code owner June 29, 2026 13:55

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
apps/meteor/client/views/room/body/hooks/useGetMore.ts (1)

108-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a regression test for the new pointerdown path.

CORE-2355 is specifically about scrollbar-driven loading, but the provided useGetMore.spec.tsx coverage still only marks interaction with wheel before scroll. Please add a case that dispatches pointerdown on the scroll container’s parent and then scroll, otherwise this exact path can regress again without a failing test.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/client/views/room/body/hooks/useGetMore.ts` around lines 108 -
120, Add a regression test for the new pointerdown interaction path in
useGetMore.spec.tsx: the current coverage only simulates wheel before scroll, so
add a case that dispatches pointerdown on the scroll container’s parent element
and then triggers scroll to verify the same loading behavior. Use the useGetMore
hook and its existing test helpers/fixtures to locate the scroll container, and
make sure the test asserts the scrollbar-driven path still loads more after
parent pointerdown interaction.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/meteor/client/views/room/body/hooks/useGetMore.ts`:
- Around line 108-120: Add a regression test for the new pointerdown interaction
path in useGetMore.spec.tsx: the current coverage only simulates wheel before
scroll, so add a case that dispatches pointerdown on the scroll container’s
parent element and then triggers scroll to verify the same loading behavior. Use
the useGetMore hook and its existing test helpers/fixtures to locate the scroll
container, and make sure the test asserts the scrollbar-driven path still loads
more after parent pointerdown interaction.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1c26975-5ca6-422c-ace1-ca51bf3fe128

📥 Commits

Reviewing files that changed from the base of the PR and between 8a7f181 and 7cdebcd.

📒 Files selected for processing (1)
  • apps/meteor/client/views/room/body/hooks/useGetMore.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/room/body/hooks/useGetMore.ts
🧠 Learnings (5)
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/views/room/body/hooks/useGetMore.ts
📚 Learning: 2026-05-11T20:30:35.265Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 40480
File: apps/meteor/client/meteor/startup/accounts.ts:59-61
Timestamp: 2026-05-11T20:30:35.265Z
Learning: In Rocket.Chat’s Meteor client code, when calling `dispatchToastMessage` with `{ type: 'error' }`, pass the raw caught error object as `message` without manual normalization. `dispatchToastMessage` is designed to accept `message: unknown` for error toasts, so avoid converting errors to strings (e.g., `String(error)`) or extracting `error.message` before passing them.

Applied to files:

  • apps/meteor/client/views/room/body/hooks/useGetMore.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/client/views/room/body/hooks/useGetMore.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/client/views/room/body/hooks/useGetMore.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/views/room/body/hooks/useGetMore.ts

@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 1 file

Re-trigger cubic

@ggazzo ggazzo added this to the 8.6.0 milestone Jun 29, 2026
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Jun 29, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 29, 2026
@dionisio-bot
dionisio-bot Bot merged commit 5857fb0 into release-8.6.0 Jun 29, 2026
18 checks passed
@dionisio-bot
dionisio-bot Bot deleted the regression/scroll branch June 29, 2026 14:02
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.17%. Comparing base (8a7f181) to head (7cdebcd).
⚠️ Report is 1 commits behind head on release-8.6.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.6.0   #41098      +/-   ##
=================================================
+ Coverage          70.15%   70.17%   +0.02%     
=================================================
  Files               3371     3371              
  Lines             130417   130419       +2     
  Branches           22561    22615      +54     
=================================================
+ Hits               91489    91521      +32     
+ Misses             35611    35582      -29     
+ Partials            3317     3316       -1     
Flag Coverage Δ
unit 70.12% <100.00%> (+0.04%) ⬆️

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.

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.

2 participants