MCPcopy Create free account
hub / github.com/anomalyco/opencode / markAuto

Function markAuto

packages/ui/src/hooks/create-auto-scroll.tsx:41–52  ·  view source on GitHub ↗
(el: HTMLElement)

Source from the content-addressed store, hash-verified

39 // the handler can see a non-zero `distanceFromBottom` and incorrectly assume
40 // the user scrolled.
41 const markAuto = (el: HTMLElement) => {
42 auto = {
43 top: Math.max(0, el.scrollHeight - el.clientHeight),
44 time: Date.now(),
45 }
46
47 if (autoTimer) clearTimeout(autoTimer)
48 autoTimer = setTimeout(() => {
49 auto = undefined
50 autoTimer = undefined
51 }, 1500)
52 }
53
54 const isAuto = (el: HTMLElement) => {
55 const a = auto

Callers 2

scrollToBottomNowFunction · 0.85
scrollToBottomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected