Workspace List

Parallel agents' workspaces grouped by repository, each with its status, branch and change size.

Installation

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

Usage

import { type WorkspaceGroup, WorkspaceList } from "./ui/uicontext/components/kit/WorkspaceList.ts"
const Message = UiSchema.TaggedEnum({	RequestedOpenList: { href: Schema.String },	RequestedArchiveList: { workspace: Schema.String },	RequestedNewList: { group: Schema.String },	RequestedToggleGroupList: { group: Schema.String, collapsed: Schema.Boolean },})// one group per repository; the app decides each row's status from its agent, branch and checksexport const Sidebar = (h: Html.H<typeof Message.Type>, groups: ReadonlyArray<WorkspaceGroup>, current: string) =>	WorkspaceList(h, {		props: { label: "Workspaces", groups, current, archivable: true, newShortcut: "n" },		onEmit: {			RequestedOpen: ({ href }) => Message.RequestedOpenList({ href }),			RequestedArchive: ({ workspace }) => Message.RequestedArchiveList({ workspace }),			RequestedNew: ({ group }) => Message.RequestedNewList({ group }),			RequestedToggleGroup: ({ group, collapsed }) => Message.RequestedToggleGroupList({ group, collapsed }),		},	})

API reference

Props

WorkspaceList props
NameTypeDescription
labelrequiredstring—
groupsrequiredWorkspaceGroup[]—
currentstringThe open workspace's id
newShortcutstringThe keys the app listens for to start a workspace, shown on the first New row: "N"
archivablebooleanRows can be archived
agentIdstring—

Events

WorkspaceList events
EventPayloadDescription
RequestedOpen{ workspace: string; href: string }Open a workspace: Alt+Up or Alt+Down asked for the one before or after
RequestedArchive{ workspace: string }—
RequestedNew{ group: string }Start a workspace in a repository
RequestedToggleGroup{ group: string; collapsed: boolean }—

Agent actions

What agents can do with WorkspaceList
ActionDescription
ClickedGroupFold or unfold a repository's workspaces, by the group id
ClickedNewStart a workspace in a repository, by the group id
ClickedArchiveasks firstArchive a workspace, by its id

Accessibility

  • A nav landmark with a list per repository; each row is a link whose name says the title, status, unread and change size aloud.
  • Alt+Up and Alt+Down open the workspace before or after from anywhere on the page. Group headers are buttons with aria-expanded.
  • Archive is a real button that shows on hover and keyboard focus; agents must name the workspace they archive, and a person confirms.

Source