feat(client): undo button on the activity screen #356

Closed
opened 2026-06-29 12:57:21 +00:00 by james · 0 comments
Owner

Makes the undo backend (#354 / ADR-0031) user-facing: an undo affordance on each reversible row of the activity history (#350), with an inline confirmation before anything is reversed.

Scope

  • @carol/api-client: useUndoAuditEvent() — mutation over POST /api/agent/audit/{id}/undo, returns the inverse ProposalDto.
  • apps/client/lib/activity/isUndoable.ts (pure, tested): hide the undo affordance for the delete-family tools (delete_*/remove_*/merge_*); the server's 409 not_undoable stays as the backstop.
  • activity.tsx: an "undo" button (Lucide RotateCcw) on each undoable row → proposes the inverse → renders an inline confirmation card (summary + diff + apply/decline). Apply commits via useCommitProposal and invalidates the audit list; decline rejects. Errors (incl. 409) render inline via formatApiError.
  • i18n: activity.undo + activity.confirm.*; updated the lede (was "nothing here can be undone").

Out of scope (follow-ups)

  • Undoing deletes (needs subtree-capture backend work, ADR-0031).

Part of epic #47.

Makes the undo backend (#354 / ADR-0031) user-facing: an undo affordance on each reversible row of the activity history (#350), with an inline confirmation before anything is reversed. ## Scope - **`@carol/api-client`**: `useUndoAuditEvent()` — mutation over `POST /api/agent/audit/{id}/undo`, returns the inverse `ProposalDto`. - **`apps/client/lib/activity/isUndoable.ts`** (pure, tested): hide the undo affordance for the delete-family tools (`delete_*`/`remove_*`/`merge_*`); the server's 409 `not_undoable` stays as the backstop. - **`activity.tsx`**: an "undo" button (Lucide `RotateCcw`) on each undoable row → proposes the inverse → renders an inline confirmation card (summary + diff + apply/decline). Apply commits via `useCommitProposal` and invalidates the audit list; decline rejects. Errors (incl. 409) render inline via `formatApiError`. - **i18n**: `activity.undo` + `activity.confirm.*`; updated the lede (was "nothing here can be undone"). ## Out of scope (follow-ups) - Undoing deletes (needs subtree-capture backend work, ADR-0031). Part of epic #47.
james closed this issue 2026-06-29 13:11:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#356
No description provided.