Setting List

Settings as rows, each with its control.

  • Email me when a workflow run fails.

    You won’t hear about failures until you open run history.

  • Runs, tasks used and what failed, every Monday.

  • Team Chat channel for alerts everyone should see.

  • Anyone with the link can see a run’s steps.

  • Members sign in through your identity provider.

    Only the Owner can change this.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/setting-list

Usage

import { type SettingItem, SettingList } from "./ui/uicontext/components/kit/SettingList.ts"
const Message = UiSchema.TaggedEnum({	SwitchedSetting: { id: Schema.String, on: Schema.Boolean },	ChoseSetting: { id: Schema.String, value: Schema.String },})export const Notifications = (h: Html.H<typeof Message.Type>, items: ReadonlyArray<SettingItem>) =>	SettingList(h, {		props: { label: "Notifications", items },		onEmit: {			RequestedSwitch: ({ id, on }) => Message.SwitchedSetting({ id, on }),			RequestedChoice: ({ id, value }) => Message.ChoseSetting({ id, value }),		},	})

API reference

Props

SettingList props
NameTypeDefaultDescription
labelrequiredstring—The list's accessible name: "Organization switches"
agentIdstringsettings:<label>The id agents know this list by; settings:<label> by default
itemsrequiredSettingItem[]—The rows: each a switch or a choice, with its description and state
readOnlystring—Why nothing in the list can change here, said once above it: "Only the Owner can change these."

Events

SettingList events
EventPayloadDescription
RequestedSwitch{ id: string; on: boolean }Turn a row's switch on or off
RequestedChoice{ id: string; value: string }Choose a value for a choice row

Agent actions

What agents can do with SettingList
ActionDescription
Toggledasks firstTurn an on/off row on or off, by id. Target: { id, value } as the snapshot shows it now.
Choseasks firstChoose a value on a choice row, by id (values in the snapshot's options). Target: { id, value }.

Accessibility

  • On and off rows are switches (role="switch"); choice rows are native selects. Each is described by its row's description.
  • A row waiting on the app is marked busy, and a refusal is announced under it.
  • A read-only list says why once, above it.

Source