diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index 8116212..e373f77 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -27,7 +27,6 @@ const showResearchModal = ref(false); const researchTopic = ref(""); // Note picker state -const attachedNote = ref<{ id: number; title: string } | null>(null); const showNotePicker = ref(false); const noteSearchQuery = ref(""); const noteSearchResults = ref<{ id: number; title: string }[]>([]); @@ -99,7 +98,6 @@ watch(convId, async (newId) => { includedNoteIds.value = new Set(); includedNotes.value = []; suggestedNotes.value = []; - attachedNote.value = null; store.lastContextMeta = null; if (newId) { // Skip re-fetch if this conversation is already loaded (avoids race @@ -175,19 +173,15 @@ async function sendMessage() { } sending.value = true; - const contextNoteId = attachedNote.value?.id ?? undefined; - const contextNoteTitle = attachedNote.value?.title ?? undefined; - attachedNote.value = null; messageInput.value = ""; resetTextareaHeight(); scrollToBottom(); await store.sendMessage( content, - contextNoteId, + undefined, includedNoteIds.value.size ? [...includedNoteIds.value] : undefined, true, // enable thinking in the full chat view - contextNoteTitle, ); sending.value = false; @@ -300,14 +294,10 @@ function onNoteSearchInput() { } function selectNote(note: { id: number; title: string }) { - attachedNote.value = note; + includeNote(note); showNotePicker.value = false; } -function removeAttachedNote() { - attachedNote.value = null; -} - function includeNote(note: { id: number; title: string }) { if (includedNoteIds.value.has(note.id)) return; includedNoteIds.value = new Set([...includedNoteIds.value, note.id]); @@ -471,20 +461,11 @@ onUnmounted(() => { -