Class ChatActivityTimeline
The collapsed record of what an agent did before it answered.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class ChatActivityTimeline : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
Closed, the timeline is a single line: the label, an ellipsis while the turn is still streaming, and the total measured time. Opened, it lists every ChatActivityPart as a row with its own glyph, joined by a vertical connector. The connector is inset and drawn behind the rows rather than masked by an opaque icon background, so the timeline sits correctly on any surface.
Closed, a finished timeline reads as a tally of what it did -- "3 thoughts, 2 tools" -- rather than repeating the label. While it runs it shows the label and a live elapsed count, and the label sweeps as a Shimmer. It is finished once the turn ends or, earlier, once isFollowedByText says the answer's own prose has begun.
Pending tool calls reuse CircularProgress for their spinner rather than reimplementing one.
Examples
A finished turn with one thought and one tool call.
var timeline = new ChatActivityTimeline
{
parts = new[]
{
new ChatActivityPart(ChatActivityPartKind.Thinking, "The jump force lives on the controller.", elapsedMs: 800),
new ChatActivityPart(ChatActivityPartKind.Tool, "Read PlayerController.cs", elapsedMs: 4200),
},
open = true
};
parentElement.Add(timeline);
In UXML.
<appui:ChatActivityTimeline label="Running tool" is-streaming="true" />
Constructors
ChatActivityTimeline()
Default constructor.
Declaration
public ChatActivityTimeline()
Fields
caretUssClassName
The styling class of the summary caret.
Declaration
public const string caretUssClassName = "appui-chat-activity-timeline__caret"
Field Value
| Type | Description |
|---|---|
| string |
connectorUssClassName
The styling class of the vertical connector between rows.
Declaration
public const string connectorUssClassName = "appui-chat-activity-timeline__connector"
Field Value
| Type | Description |
|---|---|
| string |
defaultLabel
The default summary label.
Declaration
public const string defaultLabel = "Thinking"
Field Value
| Type | Description |
|---|---|
| string |
entriesUssClassName
The styling class of a timeline whose rows are laid out as one-line entries.
Declaration
public const string entriesUssClassName = "appui-chat-activity-timeline--entries"
Field Value
| Type | Description |
|---|---|
| string |
headerBottomUssClassName
The styling class of a timeline whose header sits at its foot.
Declaration
public const string headerBottomUssClassName = "appui-chat-activity-timeline--header-bottom"
Field Value
| Type | Description |
|---|---|
| string |
lastRowUssClassName
The styling class marking the last row, which draws no connector.
Declaration
public const string lastRowUssClassName = "appui-chat-activity-timeline__row--last"
Field Value
| Type | Description |
|---|---|
| string |
maxPinnedEntries
Past this many rows a pinned list would be most of the view, so the entries stand down and scroll with their rows.
Declaration
public const int maxPinnedEntries = 6
Field Value
| Type | Description |
|---|---|
| int |
rowElapsedUssClassName
The styling class of a row's elapsed badge.
Declaration
public const string rowElapsedUssClassName = "appui-chat-activity-timeline__row-elapsed"
Field Value
| Type | Description |
|---|---|
| string |
rowGlyphUssClassName
The styling class of a row's glyph slot.
Declaration
public const string rowGlyphUssClassName = "appui-chat-activity-timeline__row-glyph"
Field Value
| Type | Description |
|---|---|
| string |
rowPagerLabelUssClassName
The styling class of the pager's "2 of 3" label.
Declaration
public const string rowPagerLabelUssClassName = "appui-chat-activity-timeline__row-pager-label"
Field Value
| Type | Description |
|---|---|
| string |
rowPagerUssClassName
The styling class of the pager a folded row uses to step through its parts.
Declaration
public const string rowPagerUssClassName = "appui-chat-activity-timeline__row-pager"
Field Value
| Type | Description |
|---|---|
| string |
rowPinnedFootUssClassName
The styling class of an entry that pins at the foot of the scroll area.
Declaration
public const string rowPinnedFootUssClassName = "appui-chat-activity-timeline__row--pinned-foot"
Field Value
| Type | Description |
|---|---|
| string |
rowPinnedHeadUssClassName
The styling class of an entry that pins at the head of the scroll area.
Declaration
public const string rowPinnedHeadUssClassName = "appui-chat-activity-timeline__row--pinned-head"
Field Value
| Type | Description |
|---|---|
| string |
rowTextUssClassName
The styling class of a row's text.
Declaration
public const string rowTextUssClassName = "appui-chat-activity-timeline__row-text"
Field Value
| Type | Description |
|---|---|
| string |
rowUssClassName
The styling class of one row.
Declaration
public const string rowUssClassName = "appui-chat-activity-timeline__row"
Field Value
| Type | Description |
|---|---|
| string |
rowsUssClassName
The styling class of the row container.
Declaration
public const string rowsUssClassName = "appui-chat-activity-timeline__rows"
Field Value
| Type | Description |
|---|---|
| string |
summaryElapsedUssClassName
The styling class of the total elapsed time in the summary.
Declaration
public const string summaryElapsedUssClassName = "appui-chat-activity-timeline__summary-elapsed"
Field Value
| Type | Description |
|---|---|
| string |
summaryLabelUssClassName
The styling class of the summary label.
Declaration
public const string summaryLabelUssClassName = "appui-chat-activity-timeline__summary-label"
Field Value
| Type | Description |
|---|---|
| string |
summaryStatsUssClassName
The styling class of the live figures in the summary.
Declaration
public const string summaryStatsUssClassName = "appui-chat-activity-timeline__summary-stats"
Field Value
| Type | Description |
|---|---|
| string |
summaryUssClassName
The styling class of the summary line.
Declaration
public const string summaryUssClassName = "appui-chat-activity-timeline__summary"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The ChatActivityTimeline main styling class.
Declaration
public const string ussClassName = "appui-chat-activity-timeline"
Field Value
| Type | Description |
|---|---|
| string |
Properties
activeToolNames
The names of the tool calls still in flight, newest first. Empty once the activity is over.
Declaration
public IReadOnlyList<string> activeToolNames { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
clickable
The summary line's press handler. Toggles open.
Declaration
public Pressable clickable { get; }
Property Value
| Type | Description |
|---|---|
| Pressable |
foldRowsByKind
Folds every part of one kind into a single row: one row for the thinking and one per named tool, each showing its newest part with a pager back through the rest. The rows then sit in the order they last saw activity. False by default: one row per part, in order. A tool part with no toolName is never folded.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool foldRowsByKind { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
headerPlacement
Where the header sits. Top by default: a line above the rows. Bottom draws it as a chip at the foot of the group with the rows opening upward above it, its caret pointing up while closed.
Declaration
[CreateProperty]
[UxmlAttribute]
public ChatActivityHeaderPlacement headerPlacement { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatActivityHeaderPlacement |
isFinalized
Whether the activity is over: the turn ended, or its prose has already begun.
Declaration
public bool isFinalized { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isFollowedByText
Whether the answer's own text has already started, while the turn is still streaming.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool isFollowedByText { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Once the model is writing prose, the activity above it is finished even though the turn is not. Without this the timeline keeps counting while the reader is already reading the answer.
isStreaming
Whether the turn is still running. False by default, which appends the terminal "Done" row.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool isStreaming { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
label
The summary label. "Thinking" by default; pass something like "Running tool" when the turn is dominated by tool calls.
Declaration
[CreateProperty]
[UxmlAttribute]
public string label { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
maxPinnedShare
The share of the enclosing ScrollView the pinned entries may take at each end, from 0 to 1. Past it, the entries nearest the middle stop pinning. 1 by default, which leaves maxPinnedEntries as the only limit.
Declaration
[CreateProperty]
[UxmlAttribute]
public float maxPinnedShare { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
open
Whether the rows are expanded. False by default: the timeline is a footnote, not the answer.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool open { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
parts
The entries the timeline lists. Assigning re-renders every row.
Declaration
public IEnumerable<ChatActivityPart> parts { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<ChatActivityPart> |
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 timeline.
pinEntries
Lays the rows out as one-line entries and marks the ones that pin at the head and foot of the scroll area. None by default. A group of more than maxPinnedEntries rows pins nothing.
Declaration
[CreateProperty]
[UxmlAttribute]
public ChatActivityPinEntries pinEntries { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatActivityPinEntries |
Remarks
UI Toolkit has no sticky positioning, so the pinned entries are marked with rowPinnedHeadUssClassName and rowPinnedFootUssClassName but still scroll with the content.
rowCount
How many rows the opened timeline shows, including the terminal "Done" row.
Declaration
public int rowCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
startTime
When the activity started, so the running total survives the element being rebuilt.
Declaration
[CreateProperty]
public DateTime? startTime { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Remarks
Unset, the timeline can only add up the parts it was given, which is right for history. Set, it counts live from the stamp while the activity runs. Same reasoning, and the same wall-clock currency, as startTime.
stats
Live figures, for instance a token count, shown on the header. Null or empty shows nothing.
Declaration
[CreateProperty]
[UxmlAttribute]
public string stats { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
thoughtCount
How many Thinking parts the timeline holds.
Declaration
public int thoughtCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
toolCount
How many tool parts the timeline holds.
Declaration
public int toolCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
totalElapsedMs
The sum of every measured elapsedMs, in milliseconds. Unmeasured parts contribute nothing.
Declaration
public int totalElapsedMs { get; }
Property Value
| Type | Description |
|---|---|
| int |