feat(version-history): add version-history component

Merged
SY
11h ago
+1687-2

What and why

Add the version-history component for inspecting document/config/prompt revisions, comparing one version against current or two versions against each other, loading content lazily via getContent, and restoring a revision after confirmation.

  • Composes Timeline, Avatar, DiffViewer (diffLines from lib/diff.ts), Dialog, Badge, and Button
  • WAI-ARIA listbox navigation (ArrowUp/ArrowDown/Home/End, Space, Enter, Shift+Arrow)
  • Async getContent loading state, cancellation guard, and retry UI
  • Pure logic in registry/default/lib/version-history-utils.ts

Closes #124

Checklist

  • bun run typecheck, bun run lint and bun run test pass (registry:build, typecheck, lint, and 8 targeted Vitest suites / 44 tests passed locally across radix and base; full Linux suite passed in GitHub Actions check job on 2196d64)
  • Tests cover the change, including keyboard interaction for UI components
  • New components are added to registry.json, lib/catalog.ts, components/docs/preview-registry.tsx and lib/agent-docs/component-usage.ts, each at its alphabetical position
  • Checked in light and dark mode (/components/version-history verified in light/dark themes across desktop 1280x900 and mobile 390x844 with 0 console/hydration errors)