fix: Auto-Scroll bei Assistant-Antworten repariert [appimage]
All checks were successful
Build AppImage / build (push) Successful in 6m56s
All checks were successful
Build AppImage / build (push) Successful in 6m56s
Role-Change-Effect scrollt jetzt bei jedem Rollenwechsel (nicht nur user), Content-Tracker trackt auch parts-Array fuer Tool-Calls und Streaming. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dcc42ee903
commit
c2f2cae2ef
1 changed files with 11 additions and 8 deletions
|
|
@ -105,6 +105,11 @@
|
|||
$messages.length,
|
||||
$isProcessing,
|
||||
last?.content?.length ?? 0,
|
||||
last?.parts?.length ?? 0,
|
||||
// Letzten Part tracken — bei Streaming waechst dessen content
|
||||
(last?.parts && last.parts.length > 0)
|
||||
? last.parts[last.parts.length - 1]?.content?.length ?? 0
|
||||
: 0,
|
||||
last?.toolCalls?.length ?? 0,
|
||||
last?.toolCalls?.map((t) => t.status).join(',') ?? '',
|
||||
];
|
||||
|
|
@ -120,14 +125,12 @@
|
|||
const last = $messages[$messages.length - 1];
|
||||
const role = last?.role ?? null;
|
||||
if (role && role !== lastRole) {
|
||||
if (role === 'user') {
|
||||
// Beim Senden: wieder ans Ende kleben — und sofort scrollen,
|
||||
// nicht auf den naechsten Stream-Token warten. Force=true geht
|
||||
// am userScrolledUp-Guard vorbei. Ein rAF, damit das DOM die
|
||||
// neue Message schon gerendert hat.
|
||||
userScrolledUp = false;
|
||||
requestAnimationFrame(() => scrollToBottom(true));
|
||||
}
|
||||
// Beim Rollenwechsel (user→assistant oder assistant→user):
|
||||
// Immer wieder ans Ende kleben. Ohne das bleibt userScrolledUp=true
|
||||
// wenn checkScroll zwischen User-Send und Assistant-Antwort feuert,
|
||||
// und der Auto-Scroll fuer die gesamte Antwort ist tot.
|
||||
userScrolledUp = false;
|
||||
requestAnimationFrame(() => scrollToBottom(true));
|
||||
lastRole = role;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue