fix: document Chat button now sends title+reference only (no content snippet)
Some checks are pending
ci / docker publish / build (amd64) (push) Waiting to run
ci / docker publish / build (arm64) (push) Waiting to run
ci / docker publish / merge manifest + tag (push) Blocked by required conditions

Removed the 120-char snippet preview from the _sendToChat() reference.
The injected text is now clean: [Title](#document-<id>). Also captured
Deep Research 'Send to Chat' reference injection feature to task board.
This commit is contained in:
Lukas Parsons 2026-07-07 14:00:30 -04:00
parent a9d0df0b50
commit 66b45e7d27
2 changed files with 4 additions and 3 deletions

View file

@ -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-<id>)`) 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

View file

@ -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();