Loading component…
Loading component…
What your agent did in your apps, who approved it, and what can still be undone.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/Activity from ./agent-activity.
import { AgentActivityScreen } from "@/components/ui/agent-activity";
export default function Page() {
const [items, setItems] = useState(initialActivity);
return (
<AgentActivityScreen
apps={connectedApps} // logos mark the rows
items={items}
onUndo={async (item) => {
// the row already shows Undone – put it back if this fails
const ok = await api.undo(item.id);
if (!ok) setItems((l) => l.map((a) => (a.id === item.id ? { ...a, undone: false } : a)));
}}
onOpenTask={(task) => router.push("/tasks?task=" + task)}
onNavigate={(label) => router.push(routes[label])}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| apps | { id; name; account?; logo?; tile?; icon? }[] | seven sample apps | The apps it works in – logo is an SVG on a white tile (or on tile, a brand color); without one, a Hugeicons icon |
| items | { id; at; app; text; task?; by: "auto" \| "approved"; rule?; approvedAt?; details?: { label; value }[]; preview?; undo?: { until; how }; final?; undone?; cost? }[] | Everything it did, newest shown first. text is the step as a sentence; by says who let it; rule is the Permissions rule it acted under; details and preview say exactly what happened; undo makes Undo possible until a time and says what it does; final says why it can't be taken back. Pass a stable array (state) | |
| defaultSelected | string \| null | "a1" | The step open on the right when the screen starts |
| onUndo | (item: ActivityItem) => void | Called with Undo – the row shows Undone right away; set undone: false again if it fails | |
| onOpenTask | (task: string) => void | Called with the arrow next to the task – without it the screen calls onNavigate("Tasks") | |
| onSelect | (id: string) => void | Called when a step is opened | |
| onNavigate | (label: string) => void | Called with the label of a sidebar item – and with "Permissions" from Why it could | |
| labels | { activity?; all?; auto?; approved?; undo?; undone?; final?; why?; undoTitle?; … } | Labels, e.g. for a translation | |
| loading | boolean | While your activity loads: gray rows under gray day heads in the list and gray lines in the Step panel, in the shape of the real ones (the shared Skeleton) | |
| empty | boolean | No activity at all: the list shows Nothing yet with a sentence on what shows up here and a Set permissions button (calls onNavigate with "Permissions"); the Step panel shows nothing open | |
| className | string | Extra class on the root |
Fills its container – give it the full viewport height in your app
Rows have a fixed rhythm: time, logo, sentence with task and who let it, and Undo or Final in a fixed column
Below 560px the time makes room, the sentence takes two lines, Undo becomes its icon and the search folds to its icon until you type
Long sentences end in '…' with the whole in a tooltip and the panel; a long preview shows six lines with Show all; a step from an app it doesn't know keeps a neutral mark, so every row lines up
Touch targets grow to 36px on touch screens
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"