feat: add assistant mode, SSE streaming, and OpenCode server integration (#214)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-02 21:51:37 -04:00
1 parent 3cc24288a6
commit c3d6549f01
133 files changed
+7284 -6293

No files matched your search

+10 -8
View File
@@ -2,6 +2,7 @@ import { useRef, useEffect, useCallback } from 'react'
import type { Message } from '@/api/types'
const SCROLL_LOCK_MS = 300
const BOTTOM_THRESHOLD_PX = 48
interface UseAutoScrollOptions {
containerRef?: React.RefObject<HTMLDivElement | null>
@@ -52,6 +53,9 @@ export function useAutoScroll({
const markDisengaged = () => {
userScrolledAtRef.current = Date.now()
if (!userDisengagedRef.current) {
onScrollStateChangeRef.current?.(true)
}
userDisengagedRef.current = true
}
@@ -84,20 +88,18 @@ export function useAutoScroll({
const handleScroll = () => {
const { scrollTop, scrollHeight, clientHeight } = container
const isAtBottom = scrollHeight - scrollTop - clientHeight < 150
const isAtBottom = scrollHeight - scrollTop - clientHeight < BOTTOM_THRESHOLD_PX
if (isAtBottom) {
if (userDisengagedRef.current) {
userScrolledAtRef.current = 0
userDisengagedRef.current = false
onScrollStateChangeRef.current?.(false)
}
} else {
if (!userDisengagedRef.current) {
userScrolledAtRef.current = Date.now()
userDisengagedRef.current = true
onScrollStateChangeRef.current?.(true)
}
} else if (!userDisengagedRef.current) {
userScrolledAtRef.current = Date.now()
userDisengagedRef.current = true
onScrollStateChangeRef.current?.(true)
}
}