# Activity message

> **Note:** The activity message component is currently experimental and may undergo changes in future releases.

**Activity message** is a single, self-contained unit that represents one meaningful step or phase in an AI activity. It exposes progress, intermediate actions, and the path that leads to an outcome.

## Usage

Activity messages are used when the system performs multi-step or non-instant operations and the intermediate work has to stay visible for transparency, progress, or auditability.

When several activity messages are stacked in execution order, they form an activity trace: one collapsible group that tells how a result was produced.

![Activity message](<../images/activity-message.png>)

### When to use

- For AI generation where progress stays visible while the answer is produced.
- For agent-based execution such as file edits, commands, or other system actions.
- For tool-calling flows where the input and the output of each call matter.
- When intermediate steps increase trust in the outcome or have to be auditable afterwards.

### Best practices

- Emit one activity message per meaningful step, and avoid mapping every internal call to its own message.
- Derive headings from the step itself, such as the tool being called, rather than from free-form model output.
- Keep supporting detail collapsed by default, and expand it only when the detail is the point of the step.
- Surface the reason of a failure in the content of the failed activity, not only in its heading.
- Avoid nesting activity messages, unless a step contains meaningful intermediate activities.

## Design

### Anatomy

![Activity message anatomy](<../images/activity-message-anatomy.png>)

- **1\. Icon(optional)**: Communicates the type of activity.
- **2\. Title:** Names the step the activity represents.
- **3\. Segment:** A vertical line that connects consecutive activity messages
- **4\. Content:** The detail of the activity.

When a sequence needs to be shown or hidden as a whole, all the activity messages can be wrapped in an activity trace, which expands and collapses all of them under a single heading.

![Activity trace](<../images/activity-trace.png>)

### Icons

Element recommends a base set of icons and meanings. They are not enforced: the mapping can be adapted, and additional types can be introduced if needed.

- Reasoning: `element-self-learning`
- Retrieval: `element-search`
- Computation: `element-function`
- Generation: `element-generate`
- System action: `element-settings`
- Workflow: `element-maintenance`
- Read: `element-document`
- Summary: `element-checked`
- Generic: use the default icon

### States

- The default state shows its icon and title.
- A failed activity replaces the icon with an error icon.
- A running activity shows a spinner icon and cannot be expanded until the step completes.
- On hover and while expanded, the icon is prelaced with the expand and collapse control.

![Activity message states](<../images/activity-message-states.png>)

### Parts and nested instances

Each activity message can be divided into multiple parts. Parts are optional and can be made collapsible independently.

Nesting activity messages is optional and should be reserved for niche, advanced cases where a step has meaningful intermediate activities.

![Activity message parts and nested instances](<../images/activity-message-parts-and-nest.png>)

## Code

The activity UI is built from three components.

- **`si-activity-message`**: the main building block, representing one step of the activity. It has a heading, an optional icon and a state (`running` or `failed`), and its projected content is collapsible. In most cases the detail of a step is placed directly inside the activity message. Activity messages can be **nested** inside another activity message when a step has meaningful intermediate activities.
- **`si-activity-trace`** (optional): a collapsible container that groups a sequence of activity messages under one heading and expands or collapses them as a whole.
- **`si-activity-message-part`** (optional): a titled block inside an activity message, optionally collapsible on its own. Only needed when the detail of a step has to be split into separately titled sections, for example the input and output of a tool call. Parts are **leaves**, they carry content and never contain further activity messages.

```
si-activity-trace                     optional group, collapses everything
├── si-activity-message               step 1: detail directly inside
├── si-activity-message               step 2: detail split into parts
│   ├── si-activity-message-part      leaf, e.g. "Input"
│   └── si-activity-message-part      leaf, e.g. "Output"
└── si-activity-message               step 3
    └── si-activity-message           nested step (advanced cases only)
```

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';
import {
  elementAi,
  elementChecked,
  elementDocument,
  elementFunction,
  elementGenerate,
  elementMaintenance,
  elementSearch,
  elementSelfLearning,
  elementSettings
} from '@siemens/element-icons';
import {
  SiActivityMessageComponent,
  SiActivityMessagePartComponent,
  SiActivityTraceComponent
} from '@siemens/element-ng/chat-messages';
import { addIcons } from '@siemens/element-ng/icon';
import { SiMarkdownComponent } from '@siemens/element-ng/markdown';

@Component({
  selector: 'app-sample',
  imports: [
    SiActivityMessageComponent,
    SiActivityMessagePartComponent,
    SiActivityTraceComponent,
    SiMarkdownComponent
  ],
  templateUrl: './si-activity-message.html'
})
export class SampleComponent {
  protected readonly icons = addIcons({
    elementAi,
    elementChecked,
    elementDocument,
    elementFunction,
    elementGenerate,
    elementMaintenance,
    elementSearch,
    elementSelfLearning,
    elementSettings
  });

  protected readonly summary = `I reviewed the available information and identified the main points:

- The request is focused on recent operational data
- Three relevant sources are available
- The final response should include a concise recommendation`;
}
```

Template:

```html
<div class="p-2">
  <div class="mb-6">
    <si-activity-message heading="Completed activity with details" [expanded]="true">
      <si-markdown [markdown]="summary" />
    </si-activity-message>
    <si-activity-message state="running" heading="Running activity">
      Searching the available data sources.
    </si-activity-message>
    <si-activity-message state="failed" heading="Failed activity">
      The activity could not access the maintenance service.
    </si-activity-message>
    <si-activity-message heading="Completed activity with the default icon">
      Completed a general processing step.
    </si-activity-message>
  </div>

  <si-activity-trace class="mb-6" heading="Expanded activity trace" [expanded]="true">
    <si-activity-message heading="Reasoning" [icon]="icons.elementSelfLearning">
      Reading specific files and identifying relevant content.
    </si-activity-message>
    <si-activity-message heading="Retrieval" [icon]="icons.elementSearch" [expanded]="true">
      <si-activity-message-part heading="Input">
        Project requirements and available KPI definitions
      </si-activity-message-part>
      <si-activity-message-part heading="Output" collapsible>
        Found the relevant dashboard guidance and data sources.
      </si-activity-message-part>
    </si-activity-message>
    <si-activity-message heading="Computation" [icon]="icons.elementFunction">
      Transforming and processing the collected data.
    </si-activity-message>
    <si-activity-message heading="Generation" [icon]="icons.elementGenerate">
      Creating the requested content.
    </si-activity-message>
    <si-activity-message heading="System action" [icon]="icons.elementSettings">
      Applying changes and running commands.
    </si-activity-message>
    <si-activity-message heading="Workflow" [icon]="icons.elementMaintenance">
      Orchestrating the required tools.
    </si-activity-message>
    <si-activity-message heading="Read" [icon]="icons.elementDocument">
      Reading a specific file.
    </si-activity-message>
    <si-activity-message heading="Summary" [icon]="icons.elementChecked">
      Preparing the final high-level result.
    </si-activity-message>
    <si-activity-message heading="Generic">Completing a general activity.</si-activity-message>
  </si-activity-trace>

  <si-activity-message
    heading="Advanced: optional nested activities"
    [icon]="icons.elementAi"
    [expanded]="true"
  >
    <si-activity-message heading="Validated source data">
      Checked the source fields and value ranges.
    </si-activity-message>
    <si-activity-message heading="Calculated recommendations">
      Ranked the available actions by expected impact.
    </si-activity-message>
  </si-activity-message>
</div>
```

### [SiActivityTraceComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-trace.component.ts#L21-L33>)

**Kind:** component

**Selector:** `si-activity-trace`

```
import { SiActivityTraceComponent } from '@siemens/element-ng/chat-messages';
```

Collapsible container for grouping multiple activity messages.

```
component SiActivityTraceComponent
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [expanded](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-trace.component.ts#L30-L30>) | `boolean` | `false` | Whether the trace content is expanded. |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-trace.component.ts#L23-L23>) (required) | `TranslatableString` |  | Trace heading. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [expandedChange](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-trace.component.ts#L30-L30>) | `boolean` | Whether the trace content is expanded. |

### [SiActivityMessageComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message.component.ts#L26-L48>)

**Kind:** component

**Selector:** `si-activity-message`

```
import { SiActivityMessageComponent } from '@siemens/element-ng/chat-messages';
```

Collapsible activity message for displaying progress and intermediate steps in a chat.

```
component SiActivityMessageComponent
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [expanded](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message.component.ts#L41-L41>) | `boolean` | `false` | Whether the activity details are expanded. |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message.component.ts#L28-L28>) (required) | `TranslatableString` |  | Activity heading. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message.component.ts#L31-L31>) | `string \| undefined` |  | Activity icon. |
| [state](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message.component.ts#L34-L34>) | `"running" \| "failed" \| undefined` |  | Current state of the activity. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [expandedChange](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message.component.ts#L41-L41>) | `boolean` | Whether the activity details are expanded. |

### [SiActivityMessagePartComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message-part.component.ts#L21-L40>)

**Kind:** component

**Selector:** `si-activity-message-part`

```
import { SiActivityMessagePartComponent } from '@siemens/element-ng/chat-messages';
```

Titled content part for use inside an activity message.

```
component SiActivityMessagePartComponent
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [collapsible](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message-part.component.ts#L30-L30>) | `boolean` | `false` | Whether the part can be collapsed and expanded. |
| [expanded](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message-part.component.ts#L37-L37>) | `boolean` | `true` | Whether collapsible content is expanded. |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message-part.component.ts#L23-L23>) (required) | `TranslatableString` |  | Part heading. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [expandedChange](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-activity-message-part.component.ts#L37-L37>) | `boolean` | Whether collapsible content is expanded. |

### Types Documentation

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
