-
Notifications
You must be signed in to change notification settings - Fork 86
PoC: Redesigned efficient ChatView #17999
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
base: master
Are you sure you want to change the base?
Conversation
Jenkins Builds
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PoC @micieslak !
I've just added some comments and playing a bit with it, I see:
- When scrolling up/down with the mouse, it reaches the first/last placeholder and doesn't trigger another block to be displayed. If you do it by holding the scroll bar and realease, then yes.
Screen.Recording.2025-05-27.at.13.47.16.mov
} | ||
|
||
RoundButton { | ||
id: recentMessagesButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot see this button on visible 🤔 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to scroll up (by dragging scroll handler). Then you will see that :)
storybook/pages/ChatViewPocPage.qml
Outdated
|
||
const offset = first.y - flickable.contentY | ||
|
||
flickable.contentY = Qt.binding(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On every adjustment it's created a new binding. Would it be needed to clear previous one somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary to position the view correctly. But the binding is broken later soon, e.g. when user scrolls the content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice solution! I like it a lot 💯
There are some limitations in terms of the number of messages we can support in the viewport and the content data (try to increase the max word count to 400 and resize the window). But I guess this would be the case with a ListView as well 🤔 In any case, the numberOfMessagesInViewport
is probably too high anyway and we could decrease it to 10-20 messages.
Another addition would be the ability to scale the images based on MessageDelegate
width. We can't fit such large images on smaller view ports. But probably something for the future.
Something like this:
Screen.Recording.2025-05-28.at.11.25.44.mov
storybook/pages/ChatViewPocPage.qml
Outdated
return first.y - offset | ||
}) | ||
|
||
const shift = Math.min(40, indexFilter.minimumIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be called when scrolling by wheel, trackpad or touch as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's missing thing now, it works only by dragging scroll handler by mouse explicitly
What does the PR do
Proposes new approach regarding ChatView mechanics.
Architecture compliance
My PR is consistent with this document: [Status Desktop Architecture Guide](https://github.com/status-im/status-desktop/blob/master/CONTRIBUTING.md
Screenshot of functionality (including design for comparison)