- Edit prompt asks for APPEND/PREPEND/REPLACE + only new content
- Frontend applies the edit surgically (append/prepend/replace)
- Much faster: AI only generates the new text, not the whole doc
- Chat mode still streams response progressively
- Backend streams tokens via Server-Sent Events
- Frontend reads stream with fetch + ReadableStream
- Edit mode: document updates live as tokens arrive
- Chat mode: response text appears progressively
- No more waiting for full generation to complete
- AI chat panel at bottom of editor (all 3 modes)
- Edit mode: AI modifies document directly (no explanations)
- Chat mode: AI answers questions about the document
- Verify dropdown: Spec Review, Grammar & Spelling, Summary
- Enter sends, Shift+Enter for newline
- /api/ai/chat endpoint with edit/chat system prompts
- Grammar and spec verify actions added to /api/ai/generate