Components · Tasks
Tasks
The parts every task view shares — the status badge and task chip that show where a task is, the status pixels, and the shell of a task panel.
import { Tasks } from "@botiverse/raft-ui";These are the parts every task view shares. TaskStatusBadge writes a task's status as a status chip: the status's soft tint, its pixel and its name. TaskChip is the same chip carrying a task instead, such as a task mentioned in running text (#design:#25). TasksPanelRoot and its parts are the shell of a page of tasks. The five statuses and how tasks are shown are in Tasks; their colors are in Color.
When to use
Anatomy
TaskStatusBadge: aTaskChipwith the status pixel and the status name, which the caller supplies.TaskChip: the chip.statussets its tint. Its children are a status icon, then the task number, then the assignee.TaskStatusIcon, andTaskBacklogIcon,TaskTodoIcon,TaskInProgressIcon,TaskInReviewIcon,TaskDoneIcon,TaskClosedIcon: the status pixel. Backlog's is hollow (Color).TasksPanelRoot: the column of a task page.TasksPanelToolbar: the bar on top, with a seam under it. It holdsTasksPanelToolbarNewTask,TasksPanelToolbarFiltersandTasksPanelToolbarView(Board / List), and lays them out by the panel's own width: below 28rem (448px) New task and the view switch share the first line and the filters take the second; from 28rem they share one row that wraps. A task column 360px wide on a wide window takes the narrow layout (Switch on the region's width).TasksPanelToolbarGroupandTasksPanelToolbarLabelare for anything else in it. It is the toolbar over a list (Component tokens,list-toolbar): 8px above and below its controls and between its lines, at least 49px with its seam on a phone and a touch screen; on a desktop, once it is one row, the 44px header. The Board / List track is 6px taller than a control, so with it the row is 55px on a phone.TasksPanelViewport: the scrolling content: a TaskBoard or a TaskList.TasksPanelEmpty: holds an EmptyState when there are no tasks.
TaskLoadingList,TaskLoadingRow: placeholder rows while tasks load.taskStatusSoft,taskStatusStrongandTASK_STATUS_IDS: the recipes for building another status surface from the sametask-status-*tokens.
Not yet implemented in raft-ui: this example shows the tasks before 0042, with five statuses and no completion control.
Variants
States
- Loading:
loadingdims aTaskChipand ignores the pointer while the task is resolved. - The panel is loading:
TaskLoadingList, the same size as the cards it stands for (Feedback). - No tasks:
TasksPanelEmpty, with one empty state when there are no tasks and another when the filters match none. - Failed to load: an error at the panel's scope, with Retry.
Behavior
- Make a status chip on a task card a button that opens the list of statuses, with a down arrow after the name (TaskCard). The other ways to change a status are in Tasks.
- Make a task reference in running text open the task. A task row under a message opens it too; only its completion control changes the status (Tasks in a conversation).
Content
- Spell the statuses Backlog, Todo, In progress, Done and Closed.
TaskStatusBadgehas no built-in label: the caller passes it, and translates it. - Set the task number in Space Mono:
#25(Typography). - In a task reference, write the place, then the number:
#design:#25(Referring to a task).
Accessibility
None of these parts wraps a Base UI primitive; TaskChip renders a <span> unless render makes it a link or a button.
- The status pixel is hidden from assistive technology. Always pass the status name, or keep the task number next to it.
- Render a task chip that opens the task as an
<a>or a<button>, and give it anaria-labelthat says what it opens ("Open task #25") when its text doesn't. Atitleis not an accessible name.
Rules
- Build any new surface that shows a task status from
taskStatusSoftandtaskStatusStrong, so a status has one color everywhere. - Don't give a chip a border: the tint is a highlight, not a sticker (Status). Backlog's chip, which has no tint, is the exception (Color).
- A chip splits its padding evenly between its two ends: 7px each, 5px when
sm, 4.5px inline, the same total as before. The status pixel is drawn to its edges, so the space before it is all padding; with 2px less on that end, the pixel sat 6px from the edge and the last letter 8.5px (Alignment). An inline chip keeps the status pixel in its own 10px box, 4px from the text (Chips in running text).
API
TasksPanelEmpty, TasksPanelRoot, TasksPanelToolbar, TasksPanelToolbarFilters, TasksPanelToolbarGroup, TasksPanelToolbarLabel, TasksPanelToolbarNewTask, TasksPanelToolbarView
Also takes the attributes of its element.
TasksPanelViewport
Also takes the attributes of its element.
TaskLoadingList, TaskLoadingRow
Also takes the attributes of its element.
TaskChip
Also takes the attributes of its element.
TaskBacklogIcon, TaskClosedIcon, TaskDoneIcon, TaskInProgressIcon, TaskInReviewIcon
Takes the attributes of its element.
TaskStatusIcon
Also takes the attributes of its element.
TaskTodoIcon
Takes the attributes of its element.
TaskStatusBadge
Also takes the attributes of its element.
Related
Changes
- 0.73.0 · ChangedEvery region that scrolls is a ScrollArea:
PanelScrollViewport,ActivityInboxViewport,SearchShellViewport,NotificationCenterScroller,FilesViewport,TasksPanelViewport, ChoiceList's scroller,MobileNavServerPopoverList,ComposerSuggestionList,AnnouncementDialogBody,MessageActionCardScopeListViewportandDialogNavshow ScrollArea's overlay scrollbar instead of the platform's. Native scrolling stays only in the places scroll-area.md lists, each with its reason, and a test fails on any other. - 0.58.0 · AddedTasks: a sixth status,
backlog, inTaskStatusIdandTASK_STATUS_IDS(nowbacklog, todo, in-progress, in-review, done, closed). It has no hue: a hollow pixel edged inline-strong(TaskStatusIcon, newTaskBacklogIcon), an untinted chip with a hairline outline (TaskChip,TaskStatusBadge,TaskCardStatus) and a hollowTimelineItemmarker. - 0.5.58 · Fixed
TaskChip/TaskStatusBadgesize="sm"take thesmBadge's own box (padding, border, line height), so it no longer drifts from the Badge beside it. - 0.5.55 · Fixed
TaskChip/TaskStatusBadgesize="sm"now also match thesmBadge's font weight and letter spacing (Elegant 500 / 0.22px, Brutal 700), so the chip no longer reads as a different font beside the Badges in slock's Activity card row. The default size and the inline variant are unchanged. - 0.5.54 · Added
TaskChipandTaskStatusBadgetakesize="sm", which gives the chip thesmBadge's text size and height (Elegant 11px / 18px, Brutal 10px / 20px; icon 10px) for a chip that shares a row with Badges, such as slock's Activity card metadata row. The default size and the inline variant are unchanged. - 0.5.41 · Changed
TaskStatusBadgenow renders throughTaskChipand has no look of its own: a status badge in a task panel and the task chip under a message share one shape, size, border and colour and differ only in content (status icon + the caller's label). Visible change: in Elegant the badge goes from 12px to the chip's 13px with a hairline border and a 19px height; in Brutal from bold 12px at 20px tall to the chip's medium 13px at about 18px tall, so rows that carry it are about 2px shorter.data-slot="task-status-badge"anddata-statusare kept; no API change. - 0.5.39 · FixedBrutal
TaskStatusBadgedraws a 1px black keyline instead of 2px, matchingTaskChipandBadge;py-pxkeeps it exactly 20px tall, so surrounding layout does not move (Elegant unchanged). - 0.5.38 · Fixed
TaskChip'sinlinevariant no longer paints its own neutral fill and transparent border over the status styling: task references inside message bodies take the same per-status fill, border, text and icon colours as the task chip under a message (Elegant; Brutal unchanged; font size and baseline rules untouched).