ActionLog
StableA lasting list of what an assistant did, with who approved it and a timed Undo.
Also known as audit log, activity log, history
Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.
A morning of chores
5 actions: 3 done, 1 failed, 1 waiting
Moved 12 receipts to the Taxes folder
Home helper10:42
You approvedDoneSent the invoice to Dana
Home helper10:40
Allowed by a saved ruleDoneCan't be undone. The email was already sent.
Renamed 40 photos from the trip
Photo helper10:31
Automatic check approvedDoneUndo time is overBooked the hotel in Lisbon
Travel helper10:12
You approvedFailedPaid the electricity bill
Home helper10:45
Waiting
<ActionLog
items={[
{ id: "1", action: "Moved 12 receipts to the Taxes folder", actor: "Home helper", status: "done", time: "10:42", approvedBy: "you", undoMinutes: 8 },
{ id: "2", action: "Sent the invoice to Dana", actor: "Home helper", status: "done", time: "10:40", approvedBy: "rule", notUndoableReason: "The email was already sent." },
{ id: "3", action: "Renamed 40 photos from the trip", actor: "Photo helper", status: "done", time: "10:31", approvedBy: "check", undoMinutes: 0 },
{ id: "4", action: "Booked the hotel in Lisbon", actor: "Travel helper", status: "failed", time: "10:12", approvedBy: "you" },
{ id: "5", action: "Paid the electricity bill", actor: "Home helper", status: "waiting", time: "10:45" },
]}
onUndo={(id) => console.log("undo", id)}
/>Try the filter, then press Undo on the first row. It becomes Undone and the summary updates.
When to use it
A lasting record of what an assistant did, so people can check its work and undo it while there is still time. Each row says who acted, how it ended and who said yes.
Made of: Summary line · Filter by status · Row: action, who, time · Approved-by mark · Status badge · Undo button with time left, or 'Can't be undone' and the reason · Status text for screen readers
Use it for
- A history of the actions an assistant took for the person.
- Offering Undo for a limited time after an action.
- Explaining in words why an action cannot be undone.
Not for
- Saved versions of a document to go back to: use VersionHistory.
- Points to return to inside a single run: use CheckpointList.
- A short catch-up after time away: use CatchUpSummary.
Do and avoid
2 actions: 1 done, 1 failed
Moved 12 invoices to Archive
Invoice helper10:42
You approvedDoneBooked a table for two
Trip helper10:30
Allowed by a saved ruleFailed
1 action: 1 done
Sent the invoice email to Dana
Invoice helper10:42
You approvedDone
Do
- Show the time left on every Undo button.
- Say why an action cannot be undone.
- Keep the log after the session so people can check later.
- Show who approved each action.
- Keep undoMinutes up to date. The button shows the number you pass and does not count down by itself.
Avoid
- Don't hide failed actions. Trust drops when failures are quiet.
- Don't offer Undo after the time is over.
- Don't promise Undo for things like sent emails.
- Don't remove undone rows. Show them as Undone.
On a phone
- Each row wraps: the action text takes the full width and the status badge and Undo button drop underneath when the row is narrow.
- The filter control scrolls sideways inside its own box if its five options do not fit.
- Undo and the filter options keep their size and have a 44px tap area on a touch screen.
Seen in products
- Smashing Magazine's 'Action Audit and Undo' pattern: a readable log, a timeline, status indicators and time-limited undo windows that say what cannot be undone.
- The same article names 'permanent loss of trust' after an irreversible error and suggests a reversion rate under 5%.
- Amir Elion's pattern library lists 'silent irreversible action' as a failure, fixed by a preview and a time-limited undo.
- Most products only undo code. Replit also saves data and environment, and Claude Code says shell commands are not covered.
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
| itemsrequired | ActionLogItem[] | none | Rows: id, action, actor, status (done | failed | undone | waiting), time (text), approvedBy, undoMinutes, notUndoableReason. |
| onUndo | (id: string) => void | none | Called when Undo is pressed. The row then shows Undone. |
| defaultFilter | ActionStatus | "all" | "all" | Starting status filter. |
| labels | ActionLogLabels | none | Replace filter names, Undo text (undoFor receives the minutes left), the empty text and the not-undoable text. |
| className | string | none | Extra classes on the section. |
"Show code under the preview gives the code for the example on the stage."
States
States this part has beyond its default look. Build each one your screen can reach. States set by a property are in the Code tab.
- done
- An action with status done shows a green badge, and an Undo button while undoMinutes is above zero.
- failed
- An action with status failed shows a red badge.
- undone
- An action with status undone, or one you just undid, shows a neutral badge.
- waiting
- An action with status waiting shows an info badge.
- cannot undo
- A done action with notUndoableReason shows that reason instead of an Undo button.
- undo ended
- A done action with undoMinutes of 0 shows that the undo time is over.
- filtered empty
- When the chosen filter matches nothing, a short message replaces the list.
Tokens
Change one of these and every part that uses it follows.
--border--surface--success-soft--danger-soft--info-soft--radius-card
Built in
- Each status has an icon and a word, never color alone.
- The Undo button's name includes the action and the time left.
- Screen readers hear the result of each filter change and each undo.
- The filter is one group of options that works with the arrow keys.
- Rows wrap on narrow screens, and the filter scrolls sideways instead of being cut off.
What you need to do
- Write each action in plain words, because it is read as part of the Undo button's name.
- Give notUndoableReason for anything that can never be undone, so people learn why.
Built toward WCAG 2.2 AA and checked automatically; no independent audit yet. Read the accessibility guide