-
Notifications
You must be signed in to change notification settings - Fork 13.8k
chore: Improve channel view performance by virtualizing the messages lists #40105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
68f1e03
poc: Virtua message list
MartinSchoeler 2b410a2
fix: Adjust Send/Receive Message
MartinSchoeler 3570cf5
[WIP] fix: Adjust Detect & set is at bottom
MartinSchoeler 90c9667
fix: Adjust Jump to message
MartinSchoeler eabf178
adjust restore scroll position
MartinSchoeler b6a1859
fix: Adjust restore out of screen messages
MartinSchoeler 355c232
fix: adjust jump to bottom when new unreads
MartinSchoeler 60d1631
fix: Adjust unread marker message read
MartinSchoeler 4628fc0
chore: move unread onscroll to virtual list
MartinSchoeler eaa5127
chore: move more onscroll events to virtua
MartinSchoeler 3c66274
wip: datescroll
MartinSchoeler 2a765eb
chore: Lint & Update useHasNewMessages test
MartinSchoeler 731ca35
chore: thread virtualization
MartinSchoeler 35b87d8
fix: message url param creating empty room
MartinSchoeler 42dadba
fix: restore jump to thread message
MartinSchoeler 2159f4f
chore: update test
MartinSchoeler c19e040
ts
MartinSchoeler a4b39fb
test: move restorescrollposition test
MartinSchoeler 948e854
TS
MartinSchoeler 3d8a98a
test: adjust func params
MartinSchoeler 6d81aa8
chore: bot reviews
MartinSchoeler cd06a21
chore: restore list role
MartinSchoeler 9f4f856
test: use correct locator for new messagelist structure
MartinSchoeler 1b0fdd3
fix: jump to message stuck in loop
MartinSchoeler ad04cd5
fix wrong at bottom calculation
MartinSchoeler 4af5fb5
test: fix tests
MartinSchoeler 1e743e3
chore: move aftersendmessage callback to sendmessage.ts
MartinSchoeler 8f607d5
fix: sync errors
MartinSchoeler 393587f
chore: remove anti-pattern
MartinSchoeler 6dfe1ae
test: fix helper
MartinSchoeler 9f1be80
fix: restore missing class to messagelist
MartinSchoeler cd01acc
fix: room not being read in cases of unread 0 (first messages for exa…
MartinSchoeler 736af72
fix: test and typo on name
MartinSchoeler bde9ac9
fix: jump to thread main message not working
MartinSchoeler 17d9442
test: update sendMessage to use messageid
MartinSchoeler 5ae6131
test: fix test
MartinSchoeler 163ee77
fix: jumping to bottom too soon
MartinSchoeler d648cd2
fix: fix issues with room initialization
MartinSchoeler 4ef82ee
test: update unit tests
MartinSchoeler 27922c7
chore: review & remove comments
MartinSchoeler e51e1d4
review: add guard
MartinSchoeler a1d1263
review: fixes and cleanups
MartinSchoeler c208506
Merge branch 'develop' into chore/poc-virtua
ggazzo 85d1f8b
fix: Issues with jump to message
MartinSchoeler 97a1a2b
fix threads jump to bottom & use state
MartinSchoeler 78c1206
fix: missing dep
MartinSchoeler 8e75675
review: address bot reviews
MartinSchoeler 501262e
chore: use keepMounted to avoid refetches
MartinSchoeler e3ff359
fix: compensate for canPreview
MartinSchoeler b6321ab
review: use reduce & files
MartinSchoeler 8f967c2
test: fix flaky jump to message thread
MartinSchoeler 8905617
add keep mounted to threads
MartinSchoeler 8e6de5c
test: fix test
MartinSchoeler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ | |
| padding-bottom: 24px; | ||
| } | ||
|
|
||
| & ul.messages-list { | ||
| & .messages-list { | ||
| padding: 21px 0 10px; | ||
| } | ||
| } | ||
|
|
||
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
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
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
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
24 changes: 24 additions & 0 deletions
24
apps/meteor/client/lib/chats/flows/afterSendMessageCallback.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import type { IMessage } from '@rocket.chat/core-typings'; | ||
| import { clientCallbacks } from '@rocket.chat/ui-client'; | ||
|
|
||
| import { Rooms } from '../../../stores'; | ||
| import { getUser } from '../../user'; | ||
|
|
||
| export const afterSendMessageCallback = async (message: IMessage, rid: string) => { | ||
| const user = getUser(); | ||
| const room = Rooms.state.get(rid); | ||
|
|
||
| if (!room || !user) { | ||
| return; | ||
| } | ||
|
|
||
| const processedMessage = { | ||
| ...message, | ||
| u: { | ||
| _id: user?._id, | ||
| username: user?.username, | ||
| name: user?.name || '', | ||
| }, | ||
| }; | ||
| await clientCallbacks.run('afterSaveMessage', processedMessage, { room, user }); | ||
| }; | ||
|
MartinSchoeler marked this conversation as resolved.
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.