From f40a85fe6badd05ec8831596f5f2b9e315654cc4 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 2 Dec 2026 13:02:32 +0200 Subject: [PATCH 1/7] AI chat review follow-up: a dropped solution message counts only the visible messages on both sides, so a hidden start or skip message no longer makes an unsent prompt look received; when every recovery poll fails the prompt comes back with the connection notice, which the start screen now shows too; the history table fits a narrow chat (smaller sparkline, Range wraps); a long facts block scrolls inside the capped height unless it is a change form; the unused search-alarms-of detail keys and the never-bound disabled input of the question card are removed --- .../ai/ai-action-detail.component.html | 2 +- .../components/ai/ai-action-detail.models.ts | 2 +- .../ai/ai-color-field.component.html | 8 ++--- .../components/ai/ai-color-field.component.ts | 7 ---- .../ai/ai-number-field.component.html | 6 ++-- .../ai/ai-number-field.component.ts | 4 --- .../components/ai/ai-question.component.html | 36 +++++++++---------- .../components/ai/ai-question.component.ts | 16 +++------ .../ai/ai-secret-field.component.html | 4 +-- .../ai/ai-secret-field.component.ts | 1 - .../ai/solution/solution-chat.component.html | 4 +++ .../ai/solution/solution-chat.component.scss | 10 ++++++ .../ai/solution/solution-chat.component.ts | 14 +++++--- .../assets/locale/locale.constant-en_US.json | 2 -- ui-ngx/src/theme/ai-theme.scss | 21 ++++++++++- 15 files changed, 78 insertions(+), 59 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html index 939c25ddff..d4eb2310ea 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html @@ -142,7 +142,7 @@ } } @if (plainRows(block.rows).length) { -
+
@for (fact of plainRows(block.rows); track $index) {
{{ label(fact) }}
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts index 0757247883..3ca2b37366 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts @@ -127,7 +127,7 @@ export interface AiStepView { const ASKED_FOR: Record = { 'search-named': 'named', 'search-typed': 'typed', 'search-text': 'text', 'search-related-from': 'related-from', - 'search-related-to': 'related-to', 'search-alarms-of': 'alarms-of', 'read-attributes-scope': 'attributes-scope', + 'search-related-to': 'related-to', 'read-attributes-scope': 'attributes-scope', 'search-alarms': 'alarms', 'search-alarms-on': 'alarms-on', 'search-alarms-filter-on': 'alarms-filter-on', 'search-alarms-window': 'alarms-window', 'search-alarms-filter-window': 'alarms-filter-window', 'search-alarms-on-window': 'alarms-on-window', 'search-alarms-filter-on-window': 'alarms-filter-on-window', 'read-history': 'history', 'read-history-keys': 'history-keys', 'read-latest-keys': 'latest-keys', 'iot-hub-query': 'query', diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html index 4e9c9baef8..26b3ad0bd7 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html @@ -7,12 +7,12 @@
@for (option of question().options; track option.label) { } - diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts index d38ab5bd0d..27c16f7082 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts @@ -22,7 +22,6 @@ export class AiColorFieldComponent { question = input.required(); value = model(''); - disabled = input(false); enter = output(); private elementRef: ElementRef = inject(ElementRef); @@ -40,9 +39,6 @@ export class AiColorFieldComponent { } openHex(): void { - if (this.disabled()) { - return; - } if (!this.other()) { this.value.set('#'); } @@ -76,9 +72,6 @@ export class AiColorFieldComponent { } openPicker(picker: HTMLInputElement, field: HTMLInputElement): void { - if (this.disabled()) { - return; - } picker.value = aiHexOf(field.value) ?? '#000000'; try { picker.showPicker(); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html index 262b55a238..b2f16d33d2 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html @@ -5,16 +5,16 @@ -->
- - @if (question().number?.unit) { {{ question().number.unit }} } -
@if (wrong()) { diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts index 685fdc4bf0..b7eae1fd27 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts @@ -15,7 +15,6 @@ export class AiNumberFieldComponent { question = input.required(); value = model(''); - disabled = input(false); enter = output(); private translate = inject(TranslateService); @@ -31,9 +30,6 @@ export class AiNumberFieldComponent { } stepBy(field: HTMLInputElement, direction: number): void { - if (this.disabled()) { - return; - } const current = aiReadNumber(field.value, this.locale()); const base = isNaN(current) ? (this.question().number?.suggested ?? 0) : current; const decimals = Math.max(aiStepDecimals(this.step()), isNaN(current) ? 0 : aiStepDecimals(current)); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-question.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-question.component.html index 79c6653a57..3fe0631674 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-question.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-question.component.html @@ -30,11 +30,11 @@ }
- - +
} @else if (current(); as question) { @@ -56,11 +56,11 @@ arrow_back{{ 'action.back' | translate }} } - - + } @@ -78,15 +78,15 @@
@switch (kind(step)) { @case ('color') { - } @case ('secret') { - } @case ('number') { - } @case ('text') { @@ -94,7 +94,7 @@
{{ otherLabel(step) }} - @@ -106,7 +106,7 @@ [style.--n]="step.options.length"> @for (option of step.options; track option.label) { @@ -115,7 +115,7 @@ {{ otherLabel(step) }} - @@ -128,11 +128,11 @@ @for (option of step.options; track option.label) { + (click)="pick(step, option.label)">{{ option.label }} }
@@ -142,16 +142,16 @@ @for (option of step.options; track option.label) { + (click)="pick(step, option.label)">{{ option.label }} } + (click)="pickOther(step)">{{ step.other?.label ? step.other.label + '…' : ('ai-assistant.question.other-chip' | translate) }}
@if (isOther(step) && step.number) { - } @else if (isOther(step)) { - @@ -164,7 +164,7 @@ [style.--n]="step.options.length"> @for (option of step.options; track option.label) { @@ -173,7 +173,7 @@ {{ otherLabel(step) }} -