mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-17 20:31:47 +02:00
ui : skip sibling refetch for in-place message edits
refreshAllMessages refetches every message of the conversation just to rebuild sibling info, but preserve-responses and non-branching assistant edits never create branches, so the sibling map stays valid. Refresh only after actions that branch (editWithBranching kept) or delete. Assisted-by: pi:zai-org/GLM-5.3
This commit is contained in:
@@ -51,8 +51,9 @@
|
||||
newExtras?: DatabaseMessageExtra[]
|
||||
) => {
|
||||
onUserAction?.();
|
||||
// in-place edit: the store already updated activeMessages and no
|
||||
// branch is created, so sibling info stays valid without a refetch
|
||||
await chatStore.editUserMessagePreserveResponses(message.id, newContent, newExtras);
|
||||
refreshAllMessages();
|
||||
},
|
||||
|
||||
editWithBranching: async (
|
||||
@@ -72,7 +73,10 @@
|
||||
) => {
|
||||
onUserAction?.();
|
||||
await chatStore.editAssistantMessage(message.id, newContent, shouldBranch);
|
||||
refreshAllMessages();
|
||||
|
||||
// only a branch changes sibling info; an in-place edit already
|
||||
// landed in activeMessages
|
||||
if (shouldBranch) refreshAllMessages();
|
||||
},
|
||||
|
||||
forkConversation: async (
|
||||
|
||||
Reference in New Issue
Block a user