chore: permissions ux

This commit is contained in:
Adam 2025-12-27 20:40:25 -06:00
commit 1b5bf32ce5
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
4 changed files with 56 additions and 10 deletions

View file

@ -35,6 +35,22 @@ export function createAutoScroll(options: AutoScrollOptions) {
})
}
function forceScrollToBottom() {
if (!scrollRef) return
setStore("userScrolled", false)
isAutoScrolling = true
if (autoScrollTimeout) clearTimeout(autoScrollTimeout)
autoScrollTimeout = setTimeout(() => {
isAutoScrolling = false
}, 1000)
scrollRef.scrollTo({
top: scrollRef.scrollHeight,
behavior: "smooth",
})
}
function handleScroll() {
if (!scrollRef) return
@ -161,6 +177,7 @@ export function createAutoScroll(options: AutoScrollOptions) {
handleScroll,
handleInteraction,
scrollToBottom,
forceScrollToBottom,
userScrolled: () => store.userScrolled,
}
}