Class ChatTodoList
A collapsible checklist an agent maintains while it works through a multi-step task.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class ChatTodoList : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The list is read-only: the caller owns the items and their status, and re-assigns items whenever the agent updates the plan. Only the open/closed state belongs to the element.
The header shows the title, how many items are Completed out of the total, and a caret. Clicking anywhere on it toggles open. An empty list hides itself entirely rather than showing an empty box, matching the web implementation.
The in-progress glyph is a static ring with a filled centre rather than a spinner. A checklist shows several rows at once, and a spinning one pulls the eye away from the text, which is the part that actually changes.
The body is a ScrollView. When a new list arrives, or the list opens, and the
in-progress item is out of view, the body scrolls by the least amount that brings it in, and
only the body: no scrollable ancestor moves. The registry caps the body at a fixed height; no
sizing token matches that cap, so the body grows with its items until a host sets a
max-height on it.
Examples
A checklist mid-run.
var todo = new ChatTodoList
{
items = new[]
{
new ChatTodoItem("Read the player controller", ChatTodoStatus.Completed),
new ChatTodoItem("Raise the jump force", ChatTodoStatus.InProgress),
new ChatTodoItem("Re-run the tests"),
}
};
parentElement.Add(todo);
Starting collapsed, under a different heading.
<appui:ChatTodoList title="Plan" open="false" />
Constructors
ChatTodoList()
Default constructor.
Declaration
public ChatTodoList()
Fields
caretUssClassName
The styling class of the header's caret.
Declaration
public const string caretUssClassName = "appui-chat-todo-list__caret"
Field Value
| Type | Description |
|---|---|
| string |
closeUssClassName
The styling class of the close action.
Declaration
public const string closeUssClassName = "appui-chat-todo-list__close"
Field Value
| Type | Description |
|---|---|
| string |
completedToneUssClassName
The styling class prefix carrying the completed check's tone.
Declaration
public const string completedToneUssClassName = "appui-chat-todo-list--completed-tone-"
Field Value
| Type | Description |
|---|---|
| string |
defaultTitle
The default header label.
Declaration
public const string defaultTitle = "Tasks"
Field Value
| Type | Description |
|---|---|
| string |
headerIconUssClassName
The styling class of the header's leading glyph.
Declaration
public const string headerIconUssClassName = "appui-chat-todo-list__header-icon"
Field Value
| Type | Description |
|---|---|
| string |
headerUssClassName
The styling class of the header.
Declaration
public const string headerUssClassName = "appui-chat-todo-list__header"
Field Value
| Type | Description |
|---|---|
| string |
inProgressGlyphUssClassName
The styling class of the in-progress glyph: a static ring with a filled centre.
Declaration
public const string inProgressGlyphUssClassName = "appui-chat-todo-list__in-progress-glyph"
Field Value
| Type | Description |
|---|---|
| string |
itemStatusUssClassName
The styling class of an item row's status glyph slot.
Declaration
public const string itemStatusUssClassName = "appui-chat-todo-list__item-status"
Field Value
| Type | Description |
|---|---|
| string |
itemStatusVariantUssClassName
The styling class carrying an item row's status.
Declaration
public const string itemStatusVariantUssClassName = "appui-chat-todo-list__item--status-"
Field Value
| Type | Description |
|---|---|
| string |
itemTextUssClassName
The styling class of an item row's text.
Declaration
public const string itemTextUssClassName = "appui-chat-todo-list__item-text"
Field Value
| Type | Description |
|---|---|
| string |
itemUssClassName
The styling class of one item row.
Declaration
public const string itemUssClassName = "appui-chat-todo-list__item"
Field Value
| Type | Description |
|---|---|
| string |
itemsUssClassName
The styling class of the item container.
Declaration
public const string itemsUssClassName = "appui-chat-todo-list__items"
Field Value
| Type | Description |
|---|---|
| string |
maximizeUssClassName
The styling class of the maximize action.
Declaration
public const string maximizeUssClassName = "appui-chat-todo-list__maximize"
Field Value
| Type | Description |
|---|---|
| string |
pendingGlyphUssClassName
The styling class of the empty outline circle a pending item is drawn with.
Declaration
public const string pendingGlyphUssClassName = "appui-chat-todo-list__pending-glyph"
Field Value
| Type | Description |
|---|---|
| string |
sizeUssClassName
The styling class prefix carrying the size variant.
Declaration
public const string sizeUssClassName = "appui-chat-todo-list--size-"
Field Value
| Type | Description |
|---|---|
| string |
tallyUssClassName
The styling class of the "done out of total" tally.
Declaration
public const string tallyUssClassName = "appui-chat-todo-list__tally"
Field Value
| Type | Description |
|---|---|
| string |
titleUssClassName
The styling class of the header's title.
Declaration
public const string titleUssClassName = "appui-chat-todo-list__title"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The ChatTodoList main styling class.
Declaration
public const string ussClassName = "appui-chat-todo-list"
Field Value
| Type | Description |
|---|---|
| string |
Properties
clickable
The header's press handler. Toggles open.
Declaration
public Pressable clickable { get; }
Property Value
| Type | Description |
|---|---|
| Pressable |
collapsible
Whether the header collapses the list. True by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool collapsible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Off, the body stays open, the caret goes away and the header no longer responds to a press, so open is ignored while it is off. For a list that owns its surface and has nothing to collapse into.
completedCount
How many items are Completed.
Declaration
public int completedCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
completedTone
The colour of a completed item's check. Positive by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public ChatTodoCompletedTone completedTone { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatTodoCompletedTone |
Remarks
The registry's completedTone, which it puts on ChatTodoItems, the bare list
inside the card. UI Toolkit has no separate bare list, so it lives here.
itemCount
How many items the list holds.
Declaration
public int itemCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
items
The checklist itself. Assigning re-renders every row.
Declaration
public IEnumerable<ChatTodoItem> items { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<ChatTodoItem> |
Remarks
The setter copies the incoming sequence, so a caller mutating its own list afterwards does not silently desynchronise what is on screen. Null clears the list.
open
Whether the item list is expanded. True by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool open { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
showClose
Whether the header offers a close action. False by default. See showMaximize.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool showClose { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
showMaximize
Whether the header offers a maximize action. False by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool showMaximize { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
The registry shows the button whenever an onMaximize handler is passed. C# has no
way to omit a prop, so the control is an explicit flag and
maximizeRequested carries the intent.
size
How much room the list takes. Md by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public ChatTodoListSize size { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatTodoListSize |
title
The header label. "Tasks" by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public string title { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetCompletedToneUssClassName(ChatTodoCompletedTone)
Declaration
public static string GetCompletedToneUssClassName(ChatTodoCompletedTone enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ChatTodoCompletedTone | enumValue |
Returns
| Type | Description |
|---|---|
| string |
GetSizeUssClassName(ChatTodoListSize)
Declaration
public static string GetSizeUssClassName(ChatTodoListSize enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ChatTodoListSize | enumValue |
Returns
| Type | Description |
|---|---|
| string |
GetStatusUssClassName(ChatTodoStatus)
Declaration
public static string GetStatusUssClassName(ChatTodoStatus enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ChatTodoStatus | enumValue |
Returns
| Type | Description |
|---|---|
| string |
Events
closeRequested
Raised when the close action is activated. Shown by showClose.
Declaration
public event Action closeRequested
Event Type
| Type | Description |
|---|---|
| Action |
maximizeRequested
Raised when the maximize action is activated. Shown by showMaximize.
Declaration
public event Action maximizeRequested
Event Type
| Type | Description |
|---|---|
| Action |