fix(app): auto-scroll

This commit is contained in:
Adam
2026-01-22 07:15:47 -06:00
parent 09997bb6c8
commit 3807523f49

View File

@@ -924,8 +924,6 @@ export default function Page() {
sync.session.diff(id) sync.session.diff(id)
}) })
const isWorking = createMemo(() => status().type !== "idle")
const autoScroll = createAutoScroll({ const autoScroll = createAutoScroll({
working: () => true, working: () => true,
overflowAnchor: "dynamic", overflowAnchor: "dynamic",
@@ -948,18 +946,6 @@ export default function Page() {
), ),
) )
createEffect(
on(
isWorking,
(working, prev) => {
if (!working || prev) return
if (autoScroll.userScrolled()) return
autoScroll.forceScrollToBottom()
},
{ defer: true },
),
)
let scrollSpyFrame: number | undefined let scrollSpyFrame: number | undefined
let scrollSpyTarget: HTMLDivElement | undefined let scrollSpyTarget: HTMLDivElement | undefined
@@ -1415,7 +1401,7 @@ export default function Page() {
}} }}
onScroll={(e) => { onScroll={(e) => {
if (!hasScrollGesture()) return if (!hasScrollGesture()) return
setScrollGesture(Date.now()) markScrollGesture(e.target)
autoScroll.handleScroll() autoScroll.handleScroll()
if (isDesktop() && autoScroll.userScrolled()) scheduleScrollSpy(e.currentTarget) if (isDesktop() && autoScroll.userScrolled()) scheduleScrollSpy(e.currentTarget)
}} }}