mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
fix: keep edited replies searchable by their new text (#31844)
Saving an edited reply stored the new structured output but set the message's plain content to an empty string. Chat search only matches message content, so the chat could no longer be found by the edited text, nor by the text it replaced. editMessage now fills content from the edited output with the existing getOutputText, the same text the reply is shown with. Saving as a copy does the same. Output still takes precedence for rendering and for the next request to the model, so only the searchable copy changes. Fixes #31471 Co-authored-by: RaulMermans <214883465+RaulMermans@users.noreply.github.com>
This commit is contained in:
parent
41ca360ccf
commit
de9234a2b8
1 changed files with 3 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
|||
import { toast } from 'svelte-sonner';
|
||||
import { deleteChatMessageById, updateChatById } from '$lib/apis/chats';
|
||||
import { copyToClipboard, extractCurlyBraceWords, getDeepestChildId } from '$lib/utils';
|
||||
import { getOutputText } from './Messages/structuredOutput';
|
||||
|
||||
import Message from './Messages/Message.svelte';
|
||||
import Loader from '../common/Loader.svelte';
|
||||
|
|
@ -372,7 +373,7 @@
|
|||
files: undefined,
|
||||
annotation: undefined,
|
||||
feedbackId: undefined,
|
||||
content: output !== undefined ? '' : content,
|
||||
content: output !== undefined ? getOutputText(output) : content,
|
||||
...(output !== undefined ? { output } : {}),
|
||||
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
|
||||
};
|
||||
|
|
@ -397,7 +398,7 @@
|
|||
}
|
||||
if (output !== undefined) {
|
||||
history.messages[messageId].output = output;
|
||||
history.messages[messageId].content = '';
|
||||
history.messages[messageId].content = getOutputText(output);
|
||||
}
|
||||
await updateChat();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue