FIX: improves unread state precision (#20615)

- Will consider a message read only one the bottom of the message has been read
- Will allow to mark a message bigger than the view port as read
- Code should be more performant as the scroll is doing less (albeit more often)
- Gives us a very precise scroll state. Problem with throttling scroll is that you could end up never getting the even where scrollTop is at 0, opening a whole range of edge cases to handle
This commit is contained in:
Joffrey JAFFEUX
2023-03-09 19:06:33 +01:00
committed by GitHub
parent 4f9afabf87
commit 73be7b3dd8
7 changed files with 194 additions and 99 deletions

View File

@ -55,8 +55,8 @@ module("Discourse Chat | Component | chat-message", function (hooks) {
onSelectMessage: () => {},
bulkSelectMessages: () => {},
onHoverMessage: () => {},
didShowMessage: () => {},
didHideMessage: () => {},
messageDidEnterViewport: () => {},
messageDidLeaveViewport: () => {},
forceRendering: () => {},
};
}
@ -74,9 +74,8 @@ module("Discourse Chat | Component | chat-message", function (hooks) {
@onSelectMessage={{this.onSelectMessage}}
@bulkSelectMessages={{this.bulkSelectMessages}}
@onHoverMessage={{this.onHoverMessage}}
@didShowMessage={{this.didShowMessage}}
@didHideMessage={{this.didHideMessage}}
@didHideMessage={{this.didHideMessage}}
@messageDidEnterViewport={{this.messageDidEnterViewport}}
@messageDidLeaveViewport={{this.messageDidLeaveViewport}}
@forceRendering={{this.forceRendering}}
/>
`;