Skip to content
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

Chatroom scrolling bug #2548

Closed
taoeffect opened this issue Jan 27, 2025 · 3 comments
Closed

Chatroom scrolling bug #2548

taoeffect opened this issue Jan 27, 2025 · 3 comments

Comments

@taoeffect
Copy link
Member

taoeffect commented Jan 27, 2025

Problem

Switching between chatrooms when you've left scrolled to the bottom doesn't show the bottom when you switch back:

scrolling-bug-ff.compressed.mov

Solution

Make sure that you're scrolled all the way down, while still preserving the ability to remember where you were.

If you're far enough down it should scroll you all the way to the bottom.

*Note: implement #2556 before implementing this issue.

@SebinSong
Copy link
Collaborator

SebinSong commented Feb 4, 2025

@taoeffect
Need your help in demystifying one thing re chatroom.js contract. It's height prop of GIMessage (eg. below)

process ({ direction, data, meta, hash, height, innerSigningContractID }, { state }) {

Q.
From my investigation, it seems like a value we can use to determine if a specific GIMessage was created earlier/later than others. For example in a chatroom context, (It appears) the app uses this value to determine a particular chat-message piece was sent earlier than another (if height of messageA is greater than height of messageB, messageA is more recent message).

reference:

const bottomMessageCreatedHeight = msg.height
const latestMessageCreatedHeight = this.currentChatRoomReadUntil?.createdHeight
// No need to check for pending here as it's checked above
if (!latestMessageCreatedHeight || latestMessageCreatedHeight <= bottomMessageCreatedHeight) {
this.updateReadUntilMessageHash({
messageHash: msg.hash,
createdHeight: msg.height
})
}

Is my understanding correct?

@taoeffect
Copy link
Member Author

if height of messageA is greater than height of messageB, messageA is more recent message

That's correct. 👍

SebinSong added a commit that referenced this issue Feb 10, 2025
taoeffect pushed a commit that referenced this issue Feb 10, 2025
* fix the issue

* possible fix for issue Status: #2548

* use the existing jumpToLatest()
@taoeffect
Copy link
Member Author

Closed in #2598!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants