Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
const ref = sectionRef[messagesId]
if (ref?.scrollDown != null) {
ref.scrollDown()
} else {
console.warn('scrollDown not implemented for section', messagesId)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,25 @@
export let active: boolean = false
export let isDefault: boolean = false
export let onRenderTopChange: (active: boolean) => void

let messagesSection: MessagesSection | undefined

// Expose scrolling/editing helpers so the parent TOC component can control this section.
export function scrollDown (): void {
messagesSection?.scrollDown()
}

export function canScrollDown (): boolean {
return messagesSection?.canScrollDown() ?? false
}

export function editLastMessage (): void {
messagesSection?.editLastMessage()
}
</script>

<MessagesSection
bind:this={messagesSection}
{doc}
{readonly}
{isContextLoaded}
Expand Down