feat: scroll to rich ui once rendered (#21698)

* Update Chat.svelte

* Update Chat.svelte
This commit is contained in:
Classic298
2026-02-21 21:35:32 +01:00
committed by GitHub
parent 5d4547f934
commit 9f7dd31e12

View File

@@ -427,6 +427,15 @@
message.files = data.files;
} else if (type === 'chat:message:embeds' || type === 'embeds') {
message.embeds = data.embeds;
// Auto-scroll to the embed once it's rendered in the DOM
await tick();
setTimeout(() => {
const embedEl = document.getElementById(`${event.message_id}-embeds-0`);
if (embedEl) {
embedEl.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
}, 100);
} else if (type === 'chat:message:error') {
message.error = data.error;
} else if (type === 'chat:message:follow_ups') {