fix: resolve merge conflicts with upstream main

This commit is contained in:
WangzJi 2025-06-30 10:28:27 +08:00
parent 235c336381
commit ef7b17f9ab
No known key found for this signature in database
GPG Key ID: C237805F3F8E1CB6
2 changed files with 41 additions and 45 deletions

View File

@ -86,7 +86,7 @@ const ChatContentContainer = ({}, ref: React.ForwardedRef<any>) => {
useEffect(() => { useEffect(() => {
console.log('ChatContentContainer updating prevMessageCountRef:', { console.log('ChatContentContainer updating prevMessageCountRef:', {
currentLength: history.length, currentLength: history.length,
prevCount: prevMessageCountRef.current prevCount: prevMessageCountRef.current,
}); });
// Only update if this is the first time (count is 0) // Only update if this is the first time (count is 0)
@ -128,7 +128,7 @@ const ChatContentContainer = ({}, ref: React.ForwardedRef<any>) => {
historyLength: history.length, historyLength: history.length,
userRecentlyScrolled, userRecentlyScrolled,
isUserScrolling: isUserScrollingRef.current, isUserScrolling: isUserScrollingRef.current,
isAutoScrolling: isAutoScrollingRef.current isAutoScrolling: isAutoScrollingRef.current,
}); });
// Always handle new messages first - this is the highest priority // Always handle new messages first - this is the highest priority
@ -172,7 +172,7 @@ const ChatContentContainer = ({}, ref: React.ForwardedRef<any>) => {
currentHeight, currentHeight,
lastHeight: lastContentHeightRef.current, lastHeight: lastContentHeightRef.current,
heightDiff, heightDiff,
threshold: 12 threshold: 12,
}); });
// Only scroll if content height increased by at least ~0.5 lines (12px) for smoother experience // Only scroll if content height increased by at least ~0.5 lines (12px) for smoother experience
@ -201,7 +201,7 @@ const ChatContentContainer = ({}, ref: React.ForwardedRef<any>) => {
console.log('ChatContentContainer streaming blocked:', { console.log('ChatContentContainer streaming blocked:', {
userRecentlyScrolled, userRecentlyScrolled,
isUserScrolling: isUserScrollingRef.current, isUserScrolling: isUserScrollingRef.current,
isAutoScrolling: isAutoScrollingRef.current isAutoScrolling: isAutoScrollingRef.current,
}); });
} }
}, [history]); }, [history]);
@ -276,11 +276,7 @@ const ChatContentContainer = ({}, ref: React.ForwardedRef<any>) => {
return ( return (
<div className='flex flex-1 relative'> <div className='flex flex-1 relative'>
<div <div ref={scrollRef} className='h-full w-full mx-auto overflow-y-auto' style={{ scrollBehavior: 'smooth' }}>
ref={scrollRef}
className='h-full w-full mx-auto overflow-y-auto'
style={{ scrollBehavior: 'smooth' }}
>
<ChatHeader isScrollToTop={isScrollToTop} /> <ChatHeader isScrollToTop={isScrollToTop} />
<ChatCompletion /> <ChatCompletion />
</div> </div>

View File

@ -100,7 +100,7 @@ const ChatCompletion: React.FC = () => {
useEffect(() => { useEffect(() => {
console.log('ChatCompletion updating prevMessageCountRef:', { console.log('ChatCompletion updating prevMessageCountRef:', {
currentLength: history.length, currentLength: history.length,
prevCount: prevMessageCountRef.current prevCount: prevMessageCountRef.current,
}); });
// Only update if this is the first time (count is 0) // Only update if this is the first time (count is 0)
@ -142,7 +142,7 @@ const ChatCompletion: React.FC = () => {
historyLength: history.length, historyLength: history.length,
userRecentlyScrolled, userRecentlyScrolled,
isUserScrolling: isUserScrollingRef.current, isUserScrolling: isUserScrollingRef.current,
isAutoScrolling: isAutoScrollingRef.current isAutoScrolling: isAutoScrollingRef.current,
}); });
// Always handle new messages first - this is the highest priority // Always handle new messages first - this is the highest priority
@ -186,7 +186,7 @@ const ChatCompletion: React.FC = () => {
currentHeight, currentHeight,
lastHeight: lastContentHeightRef.current, lastHeight: lastContentHeightRef.current,
heightDiff, heightDiff,
threshold: 12 threshold: 12,
}); });
// Only scroll if content height increased by at least ~0.5 lines (12px) for smoother experience // Only scroll if content height increased by at least ~0.5 lines (12px) for smoother experience
@ -215,7 +215,7 @@ const ChatCompletion: React.FC = () => {
console.log('ChatCompletion streaming blocked:', { console.log('ChatCompletion streaming blocked:', {
userRecentlyScrolled, userRecentlyScrolled,
isUserScrolling: isUserScrollingRef.current, isUserScrolling: isUserScrollingRef.current,
isAutoScrolling: isAutoScrollingRef.current isAutoScrolling: isAutoScrollingRef.current,
}); });
} }
}, [history]); }, [history]);