feat(version-history): add version-history component
Merged
SY
11h ago+1687+1687+0123456789012345678901234567890123456789-2-2-0123456789
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(diffLinesfromlib/diff.ts),Dialog,Badge, andButton - WAI-ARIA
listboxnavigation (ArrowUp/ArrowDown/Home/End,Space,Enter,Shift+Arrow) - Async
getContentloading state, cancellation guard, and retry UI - Pure logic in
registry/default/lib/version-history-utils.ts
Closes #124
Checklist
-
bun run typecheck,bun run lintandbun run testpass (registry:build,typecheck,lint, and 8 targeted Vitest suites / 44 tests passed locally acrossradixandbase; full Linux suite passed in GitHub Actionscheckjob on2196d64) - Tests cover the change, including keyboard interaction for UI components
- New components are added to
registry.json,lib/catalog.ts,components/docs/preview-registry.tsxandlib/agent-docs/component-usage.ts, each at its alphabetical position - Checked in light and dark mode (
/components/version-historyverified in light/dark themes across desktop1280x900and mobile390x844with 0 console/hydration errors)