fix(webui): cancel stale history reads on local navigation
This commit is contained in:
1 parent
27ef6fe24f
commit
6baf7178a8
4 files changed
+43
-8
No files matched your search
@@ -530,6 +530,9 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
||||
}, []);
|
||||
|
||||
const jumpToUserPrompt = useCallback((promptId: string) => {
|
||||
// A local destination also supersedes an in-flight remote jump.
|
||||
navigation?.cancel();
|
||||
pendingPromptJumpRef.current = null;
|
||||
if (navigateToVisiblePrompt(promptId)) return;
|
||||
if (navigation?.prompts.some((prompt) => prompt.id === promptId && prompt.cursor)) {
|
||||
threadMotionRef.current?.takeUserControl();
|
||||
@@ -1146,10 +1149,10 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
||||
variant="outline"
|
||||
size="icon"
|
||||
onClick={() => {
|
||||
navigation?.latest();
|
||||
if (historyWindow) {
|
||||
pendingConversationScrollRef.current = true;
|
||||
setVisibleMessageCount(INITIAL_HISTORY_WINDOW);
|
||||
navigation?.latest();
|
||||
} else scrollToBottom(true, { force: true });
|
||||
}}
|
||||
className={cn(
|
||||
|
||||
Reference in new issue
Block a user