diff --git a/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts b/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts index e0d3028f40..4d5c631ab1 100644 --- a/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts +++ b/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts @@ -215,6 +215,9 @@ export class AiAssistantPanelService implements OnDestroy { } toggle(): void { + if (this._suppressed() && !this._open()) { + return; + } this._restored.set(false); this._open.update(open => !open); } @@ -341,6 +344,9 @@ export class AiAssistantPanelService implements OnDestroy { } openPanel(): void { + if (this._suppressed()) { + return; + } this._restored.set(false); this._open.set(true); } 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 5906317f70..99eff53c56 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 @@ -55,6 +55,8 @@ const MAX_FIELDS = 5; const DETAIL_TOKENS = new Set(['server-attributes', 'shared-attributes']); +const ATTRIBUTE_TOOLS = new Set(['save_attributes', 'delete_attributes']); + const VALUE_TOKENS: Record = { undo: ['none'], defaultDashboard: ['none'], @@ -195,6 +197,11 @@ function aiChangeHead(translate: TranslateService, data: ToolExecutionRequested) if (!HEAD_VERBS.has(verb)) { return translate.instant(label); } + if (DETAIL_TOKENS.has(review.detail) || ATTRIBUTE_TOOLS.has(data.tool)) { + const kind = DETAIL_TOKENS.has(review.detail) ? translate.instant('ai-assistant.review.detail.' + review.detail) + : translate.instant('ai-assistant.review.kind.attributes'); + return translate.instant('ai-assistant.review.head-change.' + verb, {kind}); + } const type = review.detail === 'alarm-rule' ? 'ALARM_RULE' : review.entityType; const key = 'ai-assistant.review.kind.' + type; const phrase = translate.instant(key); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss b/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss index 7fb233ca15..3c772e1f21 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss +++ b/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss @@ -1,12 +1,25 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 +:host { + display: inline-flex; + min-width: 0; +} + .cred { display: inline-flex; align-items: center; gap: 8px; + min-width: 0; + + > :not(.cred-line) { + flex-shrink: 0; + } } .cred-line { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; font: 400 var(--chat-meta)/var(--chat-meta-lh) var(--tb-font); color: var(--tb-ink-76); white-space: nowrap; diff --git a/ui-ngx/src/app/modules/home/components/ai/solution/solution-chat.component.ts b/ui-ngx/src/app/modules/home/components/ai/solution/solution-chat.component.ts index 1218acd6d8..c515c850b4 100644 --- a/ui-ngx/src/app/modules/home/components/ai/solution/solution-chat.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/solution/solution-chat.component.ts @@ -1214,7 +1214,7 @@ export class SolutionChatComponent extends PageComponent implements OnInit, OnDe this.aiSolutions.update(this.solutionId, {installed: false}); this.uninstalledAt.set(Date.now()); if (this.creatorStep() === 'result') { - this.back(); + this.pickedView.set({view: 'solution', phase: this.phase()}); } }); } diff --git a/ui-ngx/src/app/modules/home/home.component.html b/ui-ngx/src/app/modules/home/home.component.html index 1d76d5d396..e4a2d3177a 100644 --- a/ui-ngx/src/app/modules/home/home.component.html +++ b/ui-ngx/src/app/modules/home/home.component.html @@ -58,7 +58,7 @@ -
+
@if ((homeService.hideMainToolbar$ | async) === false) {