constMessage=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 checksexportconstSidebar=(h:Html.H<typeofMessage.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
Name
Type
Description
labelrequired
string
—
groupsrequired
WorkspaceGroup[]
—
current
string
The open workspace's id
newShortcut
string
The keys the app listens for to start a workspace, shown on the first New row: "N"
archivable
boolean
Rows can be archived
agentId
string
—
Events
WorkspaceList events
Event
Payload
Description
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
Action
Description
ClickedGroup
Fold or unfold a repository's workspaces, by the group id
ClickedNew
Start a workspace in a repository, by the group id
ClickedArchiveasks first
Archive 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.