Compare commits
No commits in common. "8d87068ba76849bc569389e3c753a0774261b295" and "4807c0b9f10b87511de6bd566b36397a69a1286a" have entirely different histories.
8d87068ba7
...
4807c0b9f1
@ -142,8 +142,7 @@
|
|||||||
group.action?.streaming ||
|
group.action?.streaming ||
|
||||||
group.action?.type === 'text' ||
|
group.action?.type === 'text' ||
|
||||||
group.action?.type === 'thinking',
|
group.action?.type === 'thinking',
|
||||||
'thinking-finished': group.action?.type === 'thinking' && !group.action?.streaming,
|
'thinking-finished': group.action?.type === 'thinking' && !group.action?.streaming
|
||||||
'no-entry-animation': !streamingMessage || index !== latestMessageIndex
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@ -366,8 +365,7 @@
|
|||||||
'completed-tool': action.type === 'tool' && !action.streaming,
|
'completed-tool': action.type === 'tool' && !action.streaming,
|
||||||
'immediate-show':
|
'immediate-show':
|
||||||
action.streaming || action.type === 'text' || action.type === 'thinking',
|
action.streaming || action.type === 'text' || action.type === 'thinking',
|
||||||
'thinking-finished': action.type === 'thinking' && !action.streaming,
|
'thinking-finished': action.type === 'thinking' && !action.streaming
|
||||||
'no-entry-animation': !streamingMessage || index !== latestMessageIndex
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@ -790,9 +788,9 @@ const {
|
|||||||
stopScroll
|
stopScroll
|
||||||
} = useStickToBottom({
|
} = useStickToBottom({
|
||||||
resize: {
|
resize: {
|
||||||
damping: 0.5,
|
damping: 0.68,
|
||||||
stiffness: 0.28,
|
stiffness: 0.11,
|
||||||
mass: 0.75
|
mass: 1.05
|
||||||
},
|
},
|
||||||
initial: 'instant'
|
initial: 'instant'
|
||||||
});
|
});
|
||||||
@ -809,7 +807,6 @@ let lastUserWheelUpTs = 0;
|
|||||||
let lastProgrammaticHintTs = 0;
|
let lastProgrammaticHintTs = 0;
|
||||||
let lastProgrammaticHintSource = '';
|
let lastProgrammaticHintSource = '';
|
||||||
let suppressUserIntentUntil = 0;
|
let suppressUserIntentUntil = 0;
|
||||||
let isHandlingLargeGrowth = false;
|
|
||||||
let scrollListener: ((event: Event) => void) | null = null;
|
let scrollListener: ((event: Event) => void) | null = null;
|
||||||
let wheelListener: ((event: WheelEvent) => void) | null = null;
|
let wheelListener: ((event: WheelEvent) => void) | null = null;
|
||||||
let traceAttachLogged = false;
|
let traceAttachLogged = false;
|
||||||
@ -925,32 +922,6 @@ function attachBounceListener() {
|
|||||||
const heightDelta = height - lastObservedHeight;
|
const heightDelta = height - lastObservedHeight;
|
||||||
lastObservedTop = top;
|
lastObservedTop = top;
|
||||||
lastObservedHeight = height;
|
lastObservedHeight = height;
|
||||||
|
|
||||||
// 大幅高度增长检测:当 scrollHeight 突增(内容大幅展开/渲染),
|
|
||||||
// 且用户没有主动脱离锁定(escapedFromLock=false)时,
|
|
||||||
// 用 instant 瞬间追底,绕过 spring 动画的延迟。
|
|
||||||
// 这解决了思考块展开、Markdown 表格渲染等场景下滚动跟不上内容增长的问题。
|
|
||||||
const largeGrowthThreshold = Math.max(200, target.clientHeight * 0.35 || 200);
|
|
||||||
if (
|
|
||||||
!isHandlingLargeGrowth &&
|
|
||||||
heightDelta > largeGrowthThreshold &&
|
|
||||||
!escapedFromLock.value
|
|
||||||
) {
|
|
||||||
isHandlingLargeGrowth = true;
|
|
||||||
markProgrammaticHint('ChatArea.largeGrowth');
|
|
||||||
suppressUserIntentUntil = Date.now() + 900;
|
|
||||||
scrollToBottom({ animation: 'instant', preserveScrollPosition: false });
|
|
||||||
bounceTraceLog(
|
|
||||||
'large-growth:instant-scroll',
|
|
||||||
{ heightDelta, threshold: largeGrowthThreshold, ...getScrollMetrics(target) },
|
|
||||||
'large-growth:instant-scroll',
|
|
||||||
120
|
|
||||||
);
|
|
||||||
setTimeout(() => {
|
|
||||||
isHandlingLargeGrowth = false;
|
|
||||||
}, 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const trusted = (event as any).isTrusted === true;
|
const trusted = (event as any).isTrusted === true;
|
||||||
const closeToProgrammaticHint = now - lastProgrammaticHintTs <= 140;
|
const closeToProgrammaticHint = now - lastProgrammaticHintTs <= 140;
|
||||||
|
|||||||
@ -766,10 +766,6 @@
|
|||||||
animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
|
animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-item.no-entry-animation {
|
|
||||||
animation: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-item.streaming-content,
|
.action-item.streaming-content,
|
||||||
.action-item.immediate-show {
|
.action-item.immediate-show {
|
||||||
animation: quickFadeIn 0.2s ease-out both;
|
animation: quickFadeIn 0.2s ease-out both;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user