fix: Prevent auto-scroll to thread parent message on click - #36531
fix: Prevent auto-scroll to thread parent message on click#36531onozaty wants to merge 10 commits into
Conversation
Remove unintended navigation to parent message when clicking thread message preview. Always navigate to the clicked message instead of parent message.
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 7577eea The changes in this PR will be included in the next version bump. This PR includes changesets to release 39 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Please fox the outstanding issues above. |
There was a problem hiding this comment.
Hey thanks for the contribution!
I think the old behavior of the non-sequential thread preview was mistakenly changed, can you restore the first ThreadMessageRow onclick?
Let's try to restore the old behavior, that each row had it's own onclick.
You can take a look on how the component used to look like on this diff
https://github.com/RocketChat/Rocket.Chat/pull/31549/files#diff-302dadc0469566a97b3b28cfaa3f87208b9565ba5b5e192b99705423e3d95d6cR82
Never mind, upon further investigation, it seems that the issue lays deeper than just adding the onclick back
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #36531 +/- ##
=========================================
Coverage 65.85% 65.86%
=========================================
Files 3186 3190 +4
Lines 106663 106801 +138
Branches 20310 20325 +15
=========================================
+ Hits 70241 70340 +99
- Misses 33757 33799 +42
+ Partials 2665 2662 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Thank you for working on this. |
Remove unintended navigation to parent message when clicking thread message preview. Always navigate to the clicked message instead of parent message.
Proposed changes (including videos or screenshots)
Fixed the click behavior in
ThreadMessagePreview.tsxto always navigate to the clicked reply message instead of conditionally navigating to the parent message.This restores the intuitive behavior where clicking a message takes you to that specific message.
Root Cause:
The keyboard navigation feature added in #31549 unified the click handling, causing all clicks on thread message previews with parent message display (
!sequential) to navigate to the parent message instead of the actual clicked message.Solution:
handleThreadClickto always usemessage._id(the reply message ID)sequentialflagChanges:
apps/meteor/client/components/message/variants/ThreadMessagePreview.tsxIssue(s)
Closes #32710
Steps to test or reproduce
Before fix

After fix

Test both scenarios:
Further comments
This change restores the expected user behavior from v6.6.0 and earlier versions. The modification maintains keyboard navigation functionality while fixing the unintended click behavior. No breaking changes are introduced as this simply corrects a regression in user experience.
The fix ensures consistent behavior regardless of the
sequentialflag state, making the interface more predictable for users.