Files
PaperClipAI/ui
DottaandPaperclip fb2f836a1c Build routine revision history tab and conflict-aware save flow
Adds the History tab on routine detail (PAP-3584) on top of the revision API
shipped in PAP-3583. Board users can now inspect every routine revision,
preview historical content, compare against current with structured
field-changes plus a description line diff, and restore an older revision —
which always appends a new latest revision so history stays append-only.

Behavior:

- New API client methods listRevisions / restoreRevision plus a routines
  revisions queryKey.
- Routine save now sends the current latestRevisionId as baseRevisionId; a
  409 from the server flips an "Out of date" banner on the editor and
  invalidates the detail query so the user can reload before retrying.
- Historical-preview banner spells out the append-only semantics and
  shows the next revision number.
- Restore confirmation dialog enumerates side effects, including a per-
  trigger callout for any webhook trigger that will be re-created with a
  fresh secret. Recreated webhook secret material is mounted in the
  existing routine secret banner so the user can copy URL + secret once.
- Conflict path: when the routine editor has unsaved local edits, the
  History tab blocks historical previews and surfaces an itemized
  "Unsaved routine edits" banner with Discard / Save and continue.
- Loading, empty (only revision 1), and error states are covered.
- Restored success state highlights the new revision row, auto-selects
  it, and surfaces a success toast naming both rev numbers.

Tests:

- ui/src/lib/line-diff.test.ts covers the lifted diff helper.
- ui/src/components/RoutineHistoryTab.test.tsx covers empty state,
  list rendering, historical-preview banner copy, dirty-edit conflict
  blocking, and the restore mutation success path.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 10:58:54 -05:00
..

@paperclipai/ui

Published static assets for the Paperclip board UI.

What gets published

The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.

Storybook

Storybook config, stories, and fixtures live under ui/storybook/.

pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook

Typical use

Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.