@if (change.labelCode) { {{ change.label }} } @else { {{ change.label }} }
-
+
@if (change.currentImage) {
} @else { {{ change.current }} }
→
{{ 'ai-assistant.review.changes-to' | translate }}
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts
index 07f3f2629f..5906317f70 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts
@@ -219,6 +219,8 @@ export class AiApprovalCardComponent implements OnChanges, AfterViewChecked {
@Input() completedExecution: ToolExecutionResult | null = null;
+ @Input() durationMs?: number;
+
@Input() autoApprove = false;
@Input() answered = false;
@@ -269,6 +271,9 @@ export class AiApprovalCardComponent implements OnChanges, AfterViewChecked {
this.denying = false;
this.state = 'denied';
}
+ if (changes.durationMs && this.handedOver && !changes.completedExecution) {
+ this.handedOver = {...this.handedOver, durationMs: this.durationMs};
+ }
if (changes.completedExecution && this.completedExecution?.executionId === this.data.executionId) {
const result = this.completedExecution;
if (result.approvalStatus === ToolApprovalResult.TIMEOUT) {
@@ -285,6 +290,7 @@ export class AiApprovalCardComponent implements OnChanges, AfterViewChecked {
result: result.result,
status: result.executionStatus,
startedAt: this.data.time ?? Date.now(),
+ durationMs: this.durationMs ?? result.durationMs,
affectedEntities: result.affectedEntities ?? []
};
this.handedFacts = DETAILED_TOOLS.has(this.data.tool ?? '') ? [] : this.reviewFacts();
@@ -398,8 +404,8 @@ export class AiApprovalCardComponent implements OnChanges, AfterViewChecked {
...this.rows('FACT', field => !isBlock(field)).map(row => row.image ? {label: row.label, raw: true, images: {value: row.value}}
: {label: row.label, raw: true, value: row.value, mono: row.valueCode, chip: row.chip}),
...this.rows('CHANGE', field => !isBlock(field)).map(row => row.image || row.currentImage
- ? {label: row.label, raw: true, images: {current: row.currentImage ? row.current : undefined, value: row.image ? row.value : undefined}}
- : {label: row.label, raw: true, value: `${row.current ?? '—'} → ${row.value}`, mono: row.valueCode})
+ ? {label: row.label, raw: true, change: true, images: {current: row.currentImage ? row.current : undefined, value: row.image ? row.value : undefined}}
+ : {label: row.label, raw: true, change: true, was: row.current ?? '—', value: row.value, mono: row.valueCode, long: this.isLongChange(row)})
];
}
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html
index dd8507412b..18465f5a25 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html
@@ -137,6 +137,7 @@
= {};
+
+ @Input() toolDurations: Record = {};
@Input() autoApprove = false;
@Input() scrollContainer: HTMLElement;
@Input() initialScroll: 'lastUserMessage' | 'bottom' = 'lastUserMessage';
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.html
index 5b224c38db..e4db3645df 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.html
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.html
@@ -72,6 +72,7 @@
[messages]="messages()"
[loading]="loading()"
[completedExecutions]="completedExecutions()"
+ [toolDurations]="toolDurations()"
[autoApprove]="autoApprove()"
[additionalStyles]="markdownStyles"
[scrollContainer]="chatArea"
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts
index f49109abf2..2f2d4c04f1 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts
@@ -184,6 +184,7 @@ export class AiChatComponent implements OnInit, OnDestroy {
historyLoading = signal(false);
completedExecutions = signal>({});
+ toolDurations = signal>({});
chat = computed(() => {
const id = this.chatId();
@@ -914,6 +915,7 @@ export class AiChatComponent implements OnInit, OnDestroy {
this.messages.set([]);
this.limitOut.set(null);
this.completedExecutions.set({});
+ this.toolDurations.set({});
this.denyReasons.set({});
this.answeredApprovals.set(new Set());
this.historyLoading.set(!!chatId);
@@ -1475,6 +1477,7 @@ export class AiChatComponent implements OnInit, OnDestroy {
}
private finishAction(finished: ToolFinished): void {
+ this.toolDurations.update(map => ({...map, [finished.executionId]: finished.durationMs}));
const known = this.messages().find(message => message.from === 'ACTION' && message.data.executionId === finished.executionId);
if (known?.from === 'ACTION' && known.data.status !== 'RUNNING') {
return;
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-code-block.ts b/ui-ngx/src/app/modules/home/components/ai/ai-code-block.ts
index daee69aa06..1ba63ff0d7 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-code-block.ts
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-code-block.ts
@@ -200,6 +200,7 @@ function decorate(pre: HTMLElement, translate: TranslateService, copy: (text: st
const text = (pre.textContent ?? '').replace(/\n$/, '');
const file = pre.querySelector('code')?.getAttribute('data-file');
const noCopy = pre.querySelector('code')?.hasAttribute('data-nocopy');
+ const alwaysFolds = !!pre.querySelector('code')?.hasAttribute('data-fold');
const language = languageOf(pre);
const lang = language?.lang ?? 'text';
const shell = lang === 'shell' || lang === 'powershell';
@@ -217,7 +218,7 @@ function decorate(pre: HTMLElement, translate: TranslateService, copy: (text: st
pre.className = 'tb-code';
pre.replaceChildren(code);
const lineCount = text.split('\n').length;
- const folds = lineCount > FOLD_LINES && lang !== 'diff';
+ const folds = (lineCount > FOLD_LINES || alwaysFolds) && lang !== 'diff';
const block = element('div', 'tb-codeblock');
const wrapper = pre.closest('.code-wrapper');
if (wrapper) {
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-hand-over.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-hand-over.component.html
index 874b04463f..bf263bf7d6 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-hand-over.component.html
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-hand-over.component.html
@@ -98,7 +98,7 @@
}
}
- @if (handOver().test; as test) {
+ @if (!handOver().waitFor && handOver().test; as test) {
@if (test.hint) {
{{ test.hint }}
@@ -153,6 +153,14 @@
}
+ @if (handOver().test; as test) {
+
+ @if (test.hint) {
+ {{ test.hint }}
+ }
+
+
+ }
} @else if (waiting()) {
diff --git a/ui-ngx/src/app/shared/models/ai-chat.models.ts b/ui-ngx/src/app/shared/models/ai-chat.models.ts
index d6c7442594..fadad8fb56 100644
--- a/ui-ngx/src/app/shared/models/ai-chat.models.ts
+++ b/ui-ngx/src/app/shared/models/ai-chat.models.ts
@@ -146,6 +146,7 @@ export interface ToolExecutionResult extends BaseChatToolEventData {
affectedEntities?: Array;
reason?: string;
result?: string;
+ durationMs?: number;
}
export interface ToolExecutionResultEvent extends BaseChatEvent {
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index 3ae8bc4053..0736833485 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -791,6 +791,25 @@
"all-visible": "The customer can see every entity this dashboard shows.",
"alarm-meta": "{{severity}}, {{status}} · since {{since}}",
"asked-for": "Asked for",
+ "several": "several entities",
+ "history-key": "Key",
+ "history-curve": "Over time",
+ "history-last": "Last",
+ "history-range": "Range",
+ "history-changes": "{{count}} changes",
+ "history-span": "{{min}} to {{max}}",
+ "no-alarms": "No alarms",
+ "alarm-filter": {
+ "ACTIVE": "active",
+ "CLEARED": "cleared",
+ "ACK": "acknowledged",
+ "UNACK": "not acknowledged",
+ "CRITICAL": "critical",
+ "MAJOR": "major",
+ "MINOR": "minor",
+ "WARNING": "warning",
+ "INDETERMINATE": "indeterminate"
+ },
"heads-up": "Heads-up",
"stages": "Stages",
"asked": {
@@ -800,11 +819,19 @@
"related-from": "what {{entity}} points to",
"related-to": "what points to {{entity}}",
"alarms-of": "{{entity}}",
+ "alarms": "{{filter}}",
+ "alarms-on": "on {{entity}}",
+ "alarms-filter-on": "{{filter}}, on {{entity}}",
+ "alarms-window": "{{window}}",
+ "alarms-filter-window": "{{filter}}, {{window}}",
+ "alarms-on-window": "on {{entity}}, {{window}}",
+ "alarms-filter-on-window": "{{filter}}, on {{entity}}, {{window}}",
"attributes-scope": "the {{scope}} of {{entity}}",
"history": "{{entity}}, {{from}} – {{to}}",
"history-keys": "{{keys}} on {{entity}}, {{from}} – {{to}}",
"latest-keys": "{{keys}} of {{entity}}",
- "query": "'{{query}}'"
+ "query": "'{{query}}'",
+ "widget": "{{name}}"
},
"alarm-status": {
"ACTIVE_UNACK": "active, not acknowledged",
@@ -1224,7 +1251,6 @@
"now": "now",
"cut-short": "Cut short: only the start of it was reported.",
"more": "and {{count}} more",
- "series": "{{points}} points · {{min}} – {{max}} · last {{last}}",
"installs": "{{count}} installs",
"hub-device": "Device",
"on-iot-hub": "On IoT Hub",
@@ -1348,8 +1374,8 @@
"done": "Looked up gateways"
},
"search-alarms": {
- "run": "Looking up alarms",
- "done": "Looked up alarms"
+ "run": "Searching alarms",
+ "done": "Searched alarms"
},
"search-alarm-rules": {
"run": "Looking up alarm rules",
@@ -2368,6 +2394,7 @@
"stopped-at": "Stopped listening at {{time}}",
"listen-again": "Listen again",
"test-first": "Test from this computer first",
+ "test-here": "Test from this computer",
"send-test": "Send a test value",
"send-test-tip": "Sends one value as the device, marked as a test; the wait keeps listening for the device itself",
"test-sent": "Sent a test value at {{time}}; it is on the latest telemetry. The wait goes on for the device itself.",
diff --git a/ui-ngx/src/theme/ai-theme.scss b/ui-ngx/src/theme/ai-theme.scss
index e5be90a4ce..41d90a04c6 100644
--- a/ui-ngx/src/theme/ai-theme.scss
+++ b/ui-ngx/src/theme/ai-theme.scss
@@ -1555,6 +1555,21 @@
display: grid;
gap: 10px;
}
+
+ .k-diff-v.pics {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+
+ .k-diff-to {
+ margin: 0;
+ }
+
+ .k-img {
+ width: 72px;
+ height: 54px;
+ }
+ }
}
.k-actions {
@@ -5137,10 +5152,8 @@ tb-ai-action-detail.k-detail {
.k-detail-recs,
.k-tels,
- .k-series,
.k-made,
- .k-detail-links,
- .k-detail-facts {
+ .k-detail-links {
max-height: 214px;
overflow-y: auto;
overscroll-behavior: contain;
@@ -5256,49 +5269,179 @@ tb-ai-action-detail.k-detail {
}
}
- .k-series {
- display: grid;
+ .k-diff {
+ margin-top: 8px;
gap: 6px;
- margin-top: 10px;
+
+ .k-diff-v {
+ font-size: var(--chat-line);
+ line-height: var(--chat-line-lh);
+ }
+
+ .k-diff-v.mono {
+ font-family: var(--tb-mono);
+ font-size: var(--chat-code);
+ }
+
+ .k-diff-l {
+ font-size: var(--chat-meta);
+ color: var(--tb-text-secondary);
+ }
}
- .k-series-row {
- display: grid;
- grid-template-columns: max-content 96px minmax(0, 1fr);
+ .k-img {
+ display: flex;
align-items: center;
gap: 10px;
- code.k-tel-key {
- padding: 2px 7px;
- border-radius: 5px;
- background: rgba(0, 0, 0, 0.06);
- font-family: var(--tb-mono);
- font-size: 13px;
- line-height: 20px;
- color: var(--tb-ink);
+ img, .k-img-none {
+ display: block;
+ width: 72px;
+ height: 54px;
+ box-sizing: border-box;
+ object-fit: contain;
+ border: 1px solid var(--tb-line);
+ border-radius: 6px;
+ background: var(--tb-surface);
+ }
+
+ > .mat-icon {
+ color: var(--tb-ink-38);
}
}
- .k-series-spark {
- width: 96px;
- height: 20px;
- overflow: visible;
+ .k-found {
+ margin: 4px 0 0;
+ font-size: var(--chat-line);
+ line-height: var(--chat-line-lh);
+ color: var(--tb-ink);
+ }
+
+ .k-group-h {
+ margin: 20px 0 0;
+ font-size: var(--chat-line);
+ line-height: var(--chat-line-lh);
+ font-weight: 500;
+ color: var(--tb-ink);
- path {
- fill: none;
- stroke: var(--ai-teal-500);
- stroke-width: 1.5;
- stroke-linejoin: round;
- vector-effect: non-scaling-stroke;
+ &:first-child {
+ margin-top: 0;
+ }
+
+ + * {
+ margin-top: 2px;
}
}
- .k-series-meta {
+ .k-key {
font-family: var(--tb-mono);
- font-size: 12px;
- line-height: 18px;
- color: var(--k-grey);
- font-variant-numeric: tabular-nums;
+ font-size: var(--chat-code);
+ }
+
+ .k-vals {
+ display: grid;
+ grid-template-columns: max-content minmax(0, 1fr);
+ align-items: baseline;
+ column-gap: 16px;
+ row-gap: 2px;
+ margin: 10px 0 0;
+ font-size: var(--chat-line);
+ line-height: var(--chat-line-lh);
+
+ dt {
+ font-size: var(--chat-meta);
+ line-height: var(--chat-line-lh);
+ color: var(--tb-text-secondary);
+ }
+
+ dd {
+ margin: 0;
+ min-width: 0;
+ overflow-wrap: anywhere;
+ color: var(--tb-ink);
+ }
+ }
+
+ .k-hist {
+ margin-top: 10px;
+ border-collapse: collapse;
+ font-size: var(--chat-line);
+ line-height: var(--chat-line-lh);
+
+ th, td {
+ padding: 2px 16px 2px 0;
+ text-align: left;
+ vertical-align: middle;
+ font-weight: 400;
+ }
+
+ :is(th, td):last-child {
+ padding-right: 0;
+ }
+
+ thead th {
+ padding-bottom: 4px;
+ font-size: var(--chat-meta);
+ line-height: var(--chat-meta-lh);
+ color: var(--tb-text-muted);
+ }
+
+ .k-key {
+ color: var(--tb-text-secondary);
+ }
+
+ td.c {
+ width: 112px;
+ }
+
+ .tb-spark {
+ position: relative;
+ width: 112px;
+ height: 20px;
+ }
+
+ .tb-spark-svg {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ display: block;
+
+ path {
+ fill: none;
+ stroke: var(--tb-ink-54);
+ stroke-width: 2;
+ stroke-linejoin: round;
+ stroke-linecap: round;
+ vector-effect: non-scaling-stroke;
+ }
+ }
+
+ .tb-spark-dot {
+ position: absolute;
+ right: -3px;
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: var(--tb-ink-54);
+ box-shadow: 0 0 0 2px var(--tb-surface);
+ }
+
+ :is(td, th).n {
+ text-align: right;
+ white-space: nowrap;
+ font-variant-numeric: tabular-nums;
+ }
+
+ td.n {
+ color: var(--tb-ink);
+ }
+
+ td.q {
+ white-space: nowrap;
+ font-variant-numeric: tabular-nums;
+ color: var(--tb-text-secondary);
+ }
}
.k-detail-facts {