Activity Inbox

Mentions, thread replies and reactions aimed at you, with filters and mark read.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/activity-inbox

Usage

import { ActivityFilter, ActivityInbox, type ActivityItem } from "./ui/uicontext/components/kit/ActivityInbox.ts"
const Message = UiSchema.TaggedEnum({	ChoseFilter: { filter: ActivityFilter },	ReadItems: { ids: Schema.Array(Schema.String) },})export const Inbox = (h: Html.H<typeof Message.Type>, items: ReadonlyArray<ActivityItem>, filter: ActivityFilter, now: string) =>	ActivityInbox(h, {		props: { items, filter, now },		onEmit: {			RequestedFilter: ({ filter }) => Message.ChoseFilter({ filter }),			RequestedMarkRead: ({ id }) => Message.ReadItems({ ids: [id] }),			RequestedMarkAllRead: ({ ids }) => Message.ReadItems({ ids }),		},	})

Examples

Nothing yet

Nothing yet. Mentions, replies and reactions land here.

API reference

Props

ActivityInbox props
NameTypeDescription
itemsrequiredActivityItem[]—
filterrequiredActivityFilter—
nowrequiredstringThe time now, ISO: "5 minutes ago"
agentIdstring—

Events

ActivityInbox events
EventPayloadDescription
RequestedFilter{ filter: ActivityFilter }—
RequestedMarkRead{ id: string }Mark one item read: its Mark read button, or opening it
RequestedMarkAllRead{ ids: string[] }Mark every item the filter shows read

Agent actions

What agents can do with ActivityInbox
ActionDescription
ClickedFilterShow all activity, or only mentions, threads or reactions
ClickedMarkReadMark one item read, by id
ClickedMarkAllReadMark everything the filter shows read

Accessibility

  • Filters are toggle buttons with their unread counts. Each row is a link that says who did what where, with its time and Mark read.
  • Mark all read applies to what the filter shows; the empty state says what lands here.

Source