diff --git a/packages/app/src/components/chat/ChatInput.vue b/packages/app/src/components/chat/ChatInput.vue
index 3057939e..faa03135 100644
--- a/packages/app/src/components/chat/ChatInput.vue
+++ b/packages/app/src/components/chat/ChatInput.vue
@@ -6,23 +6,37 @@
:is-searching="isSearching"
@select="handleSearchSelect"
/>
+
+
+
+
+
Replying to
+
{{ replyTo.excerpt }}
+
+
+
+
@@ -76,9 +77,11 @@
:disabled="isStreaming"
:streaming="isStreaming"
:placeholder="isStreaming ? 'Waiting for response...' : 'Message AIUI...'"
+ :reply-to="replyTo"
@send="handleSend"
@extract="handleExtract"
@stop="handleStop"
+ @clear-reply="clearReply"
/>
@@ -123,6 +126,18 @@ import { useCodeContext } from '@/composables/useCodeContext'
const codeContext = useCodeContext()
const messageListRef = ref(null)
+// Reply-to threading state
+const replyTo = ref<{ messageId: string; excerpt: string } | null>(null)
+
+function handleReply(messageId: string, content: string) {
+ const excerpt = content.slice(0, 100) + (content.length > 100 ? '...' : '')
+ replyTo.value = { messageId, excerpt }
+}
+
+function clearReply() {
+ replyTo.value = null
+}
+
const messages = computed(() => chatStore.messages)
const virtualizer = useVirtualizer(computed(() => ({
@@ -244,7 +259,14 @@ async function handleSend(text: string) {
}
}
- await sendMessage(text)
+ // Prepend quote if replying to a message
+ let finalText = text
+ if (replyTo.value) {
+ const quoteLine = replyTo.value.excerpt.split('\n').map(l => `> ${l}`).join('\n')
+ finalText = `${quoteLine}\n\n${text}`
+ clearReply()
+ }
+ await sendMessage(finalText)
}
function handlePromptSelect(_userMsg: Message, assistantMsg: Message | null) {