Skip to content

feat: AI descriptions in version history - #124

Merged
fjbarrett merged 2 commits into
mainfrom
feat/version-history-ai-describe
Jun 15, 2026
Merged

feat: AI descriptions in version history#124
fjbarrett merged 2 commits into
mainfrom
feat/version-history-ai-describe

Conversation

@fjbarrett

Copy link
Copy Markdown
Owner

Summary

  • Collapses the raw diff view in version history; replaces it with a one-sentence AI-generated description of what changed (fetched on demand from Claude Haiku)
  • Word delta (+N / -N words) shown next to the timestamp so users get a quick sense of change size without expanding
  • A "Show diff" toggle beneath the description reveals the raw line-level diff for users who want it
  • New POST /api/notes/describe-diff route — auth-gated, 2 000-char truncation before sending to API, graceful 501 if ANTHROPIC_API_KEY is unset

Test plan

  • Open version history on a note with multiple versions
  • Verify word delta shows in each row
  • Expand a version → "Describing changes…" appears briefly, then AI description
  • Click "Show diff" → raw diff view toggles below description
  • Remove ANTHROPIC_API_KEY from env → endpoint returns 501, description shows "Unable to describe changes."

Setup

Add ANTHROPIC_API_KEY=sk-ant-... to .env.local (or Vercel env vars).

🤖 Generated with Claude Code

Replaces raw diff display with Claude-generated natural language
descriptions of what changed between versions. The description is
fetched on demand when a version is expanded, keeping the list fast.

- Word delta (+N / -N words) shown inline in collapsed state
- Expanded state shows the AI description with a "Show diff" toggle
  for users who still want the raw line-level view
- Uses claude-haiku-4-5 via direct Anthropic API call; requires
  ANTHROPIC_API_KEY env var (gracefully disabled if absent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
keep Ready Ready Preview, Comment Jun 15, 2026 10:20pm

@fjbarrett
fjbarrett merged commit 152da9e into main Jun 15, 2026
@fjbarrett
fjbarrett deleted the feat/version-history-ai-describe branch June 15, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant