Activity
A record’s activity in a context panel, newest first: what happened to it, one line each, and what people wrote about it, joined by a thin line.
Installation
import { Activity } from "@o/pipeline/experimental/blocks/activity";
Usage
Pass the rows as items, newest first. An event is an icon, its sentence as children and its time; a comment (kind: "comment") is an avatar, its author, its time and its words as children. Wrap a record a sentence names in ActivityEntity, passing the app’s link as render to open it.
Under its sentence an event can show a detail, such as the value before → after or a card for the record it created, and actions, such as “Send to HubSpot”. A comment can show attachments, reactions and a ”…” action, shown while it’s hovered or holds focus. Each row’s renderRow wraps it, in a popover’s root or a comment’s editor, so the parts passed in can read that context. Each row’s element carries its id as data-activity-item, so the app can scroll to one, and a comment with highlighted pulses once.
Slack
A comment’s source fills a 12px badge on its avatar’s corner, such as Slack’s 8px mark on its aubergine, and meta follows its time, so a Slack message reads “4d ago via Slack”. Its words show to four lines; when they run past them, the fourth ends ”… Read more” straight after its last word, which opens the rest in place. Its replies show in place from chat’s replies button (Message.ThreadTrigger), never with a reply box. Its words bring their own type: pass them as compact Prose (14px, as Figma’s comment), as the app’s comment editor draws them.
Read more
A short comment shows whole. A long one ends its fourth line ”… Read more”, which opens the rest in place, and stays open while the list scrolls.
Changes
A change can carry the value before → after as its detail, with the new value in ActivityEntity. An event’s group stands for rows made together, shown in place under it from its label, such as “3 changes”; the rows it shows are events too.
Stand-ins
Changes a lapsed login can’t show read as one row, saying how many and linking to where the login is reconnected.
Actions
actions puts controls under the sentence: Send to, Create in or Archive in a connected service, or splitting a meeting that was joined in error. A detail that says why a change didn’t reach a service reads in the sentence’s colour, under it.
Deal created
A row’s detail can be a card, such as the deal it created as it was.
Check-ins
A project’s check-ins that went wrong group into one row, its attempts in place, each opening its message.
Signal
A signal’s source and event open its details, with what it was about under it.
Filter
action puts a control over the header’s end, such as a ”…” menu with a Filter submenu of checkbox items. Pass a ghost md IconButton: the block draws it where other blocks draw their +, 4px from the end with its icon a step under the title.
When a filter leaves no rows, pass an empty that says so and offers to clear it.
Empty
With no rows, the block is one row: its title and “No activity yet.”, or empty.
See all
With seeAll, the block shows its first BLOCK_ROWS_SHOWN rows (4), as every block does, and with more, “See all” calls onSeeAll, where the app opens the full list in a drawer rather than expanding the block. total says how many See all lists when the items passed are only some of them.
Long lists
See all lists every row, which can be hundreds. With virtualize, the rows scroll inside the card under a header that stays, flush with the card’s sides and bottom, and fade over 24px at each edge with more beyond it. Only the rows near the view render, and the rest keep their space. Put the block in a flex column with a height, which it shrinks to fit; the column itself doesn’t scroll. Rows are measured as they render, so replies and reactions that change a row’s height don’t move the reader’s place. revealId brings a row into view once, such as a comment the reader was sent to, which a virtualized list may not have rendered yet. Keep the 4-row card unvirtualized.
Loading
A loading block is the block itself inside a loading SkeletonGroup, with placeholder rows: each row’s text is one placeholder, and its icon draws its own, such as an empty Glyph.
We invite you to share your thoughts and feedback with us! Your insights are incredibly valuable, and we genuinely want to hear what you have to say.