diff --git a/docs/improvement-tasks.md b/docs/improvement-tasks.md index 393edaa4..991e54c7 100644 --- a/docs/improvement-tasks.md +++ b/docs/improvement-tasks.md @@ -24,6 +24,9 @@ Last updated: 2026-07-07 - A `grep_documents` or `search_documents` tool for semantic/fulltext search - Auto-inject active document content into agent context when relevant +- [ ] **Deep Research: "Send to Chat" reference injection (not just new-chat Discuss)** + The only way to link research to chat is the "Discuss" button, which creates a brand-new session via `/api/research/spinoff`. Need a second button to inject a research reference (`[Title](#research-)`) into the currently active chat's message input, matching the document "Chat" button pattern. Applies to: research panel sidebar (panel.js:1012), research library cards (documentLibrary.js:2767), and the inline result message (chatRenderer.js:1070). + - [ ] **First-party document support in agent mode** Documents feel "disjointed from the agent." The agent creates documents fine but can't easily discover or reference existing ones contextually. Ideas: - "Agent workspace" awareness — automatically surface relevant documents based on chat context diff --git a/static/js/document.js b/static/js/document.js index 6d58ba7e..5bdc168e 100644 --- a/static/js/document.js +++ b/static/js/document.js @@ -671,9 +671,7 @@ import { bindMenuDismiss, dismissOrRemove } from './escMenuStack.js'; if (!activeDocId) return; const doc = docs.get(activeDocId); if (!doc) return; - const content = typeof doc.content === 'string' ? doc.content : ''; - const snippet = content.substring(0, 120).replace(/\n/g, ' '); - const ref = `[${doc.title || 'Untitled'}](#document-${activeDocId})${snippet ? ' — ' + snippet + (content.length > 120 ? '...' : '') : ''}`; + const ref = `[${doc.title || 'Untitled'}](#document-${activeDocId})`; const msgEl = document.getElementById('message'); if (!msgEl) return; const current = msgEl.value.trim();