diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 93a546315b..0ac31e4db4 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1343,7 +1343,17 @@ ) => { const currentId = history.currentId; const next = incoming?.messages ?? {}; + // An edited prompt adds a sibling; other viewers should keep their selected branch. + const hasNewBranch = Object.values(next).some( + (message: any) => + message.role === 'user' && + !history.messages[message.id] && + Object.values(history.messages).some( + (existing: any) => existing.role === 'user' && existing.parentId === message.parentId + ) + ); const follow = + !hasNewBranch && !generating && !( taskIds?.length && diff --git a/src/lib/components/chat/Messages/Message.svelte b/src/lib/components/chat/Messages/Message.svelte index 4ee20362d9..c23030f71f 100644 --- a/src/lib/components/chat/Messages/Message.svelte +++ b/src/lib/components/chat/Messages/Message.svelte @@ -89,6 +89,7 @@ {deleteMessage} {allowDelete} {readOnly} + {shareMode} {compactPreview} {editCodeBlock} {topPadding} diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte index 5baf321e7d..fece2f1a26 100644 --- a/src/lib/components/chat/Messages/UserMessage.svelte +++ b/src/lib/components/chat/Messages/UserMessage.svelte @@ -45,6 +45,7 @@ export let isFirstMessage: boolean; export let readOnly: boolean; + export let shareMode: 'continue' | null = null; export let allowDelete = true; export let compactPreview = false; export let editCodeBlock = true; @@ -334,7 +335,7 @@