From 5c84c28a6752f15858dc979c0bd3b7d0e06e180a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 28 Feb 2026 18:53:41 -0500 Subject: [PATCH] Make note picker add notes to persistent context instead of one-shot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the paperclip button created a one-shot attachment that was only included for the single message it was sent with, then discarded. Now selecting a note via the picker calls includeNote() directly, so it appears in the "In Context" sidebar and stays for the entire conversation — consistent with clicking "+" on a suggested note. Removed attachedNote ref, removeAttachedNote(), the pinned-note sidebar block, and the contextNoteId/contextNoteTitle sendMessage arguments that are no longer needed. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/views/ChatView.vue | 34 ++++----------------------------- 1 file changed, 4 insertions(+), 30 deletions(-) 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(() => { -