web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[message-list] implement a scrollTo(item) or similar

Open manolo opened this issue 2 months ago • 6 comments

Describe your motivation

When using message list in a AI like chat, it should happen that each time we write new tokens to the message item, we could do something like messageList.scrollTo(item, bottom) so as we can read new text without having to manually scroll.

Describe the solution you'd like

.

Describe alternatives you've considered

No response

Additional context

No response

manolo avatar Oct 24 '25 11:10 manolo

There’s already a feature that keeps the list scrolled to the bottom if the user hasn't scrolled too far from it (50 px threshold): https://github.com/vaadin/web-components/blob/0f061c16a036aebeaabfd8502bf4a286bad5567c/packages/message-list/src/vaadin-message-list-mixin.js#L98-L108

jouni avatar Oct 24 '25 11:10 jouni

Perhaps that doesn't work when tokens are appended to the last message?

jouni avatar Oct 24 '25 11:10 jouni

Related feature request to scroller: https://github.com/vaadin/web-components/issues/10257

tomivirkki avatar Oct 24 '25 11:10 tomivirkki

There’s already a feature that keeps the list scrolled

Is there any java api for that?

manolo avatar Oct 24 '25 12:10 manolo

feature request to scroller

It means that messageList needs to be encapsulated in a scroller in flow?

manolo avatar Oct 24 '25 12:10 manolo

Is there any java api for that?

Should happen automatically/by default whenever new messages are added to the list.

jouni avatar Oct 24 '25 12:10 jouni