fix: stabilize chat auto-scroll and bottom resume

- Unify send and session resumes around the latest chat tail
- Keep smooth follow active during assistant message growth
Remove staged chat rendering from the main scroll path
This commit is contained in:
Bohdan Triapitsyn
2026-04-06 20:18:20 +03:00
parent f884919165
commit a516650f96
9 changed files with 289 additions and 152 deletions
+12 -5
View File
@@ -1305,9 +1305,6 @@ const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollTo
return;
}
// Re-pin and scroll to bottom when sending
scrollToBottom?.({ instant: true, force: true });
if (!currentProviderId || !currentModelId) {
console.warn('Cannot send message: provider or model not selected');
return;
@@ -1483,7 +1480,7 @@ const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollTo
...additionalParts.flatMap(p => p.attachments ?? []),
];
void sendMessage(
const sendPromise = sendMessage(
primaryText,
currentProviderId,
currentModelId,
@@ -1493,7 +1490,17 @@ const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollTo
additionalParts.length > 0 ? additionalParts : undefined,
currentVariant,
inputMode
).then(() => {
);
if (typeof window === 'undefined') {
scrollToBottom?.({ instant: true, force: true });
} else {
window.requestAnimationFrame(() => {
scrollToBottom?.({ instant: true, force: true });
});
}
void sendPromise.then(() => {
// Clear linked issue after successful message send
if (linkedIssue) {
setLinkedIssue(null);