From 58cf399e47237ccad246de738e5648f17a67cdfc Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 12 Nov 2026 18:09:19 +0200 Subject: [PATCH] feat: secret questions in the AI chat take a hidden input and show the answer masked; review labels for SMS delivery settings --- .../home/components/ai/ai-action.models.ts | 3 ++- .../components/ai/ai-question.component.html | 16 +++++++++++----- .../home/components/ai/ai-question.component.ts | 12 +++++++++--- .../app/shared/models/solution-creator.models.ts | 1 + .../src/assets/locale/locale.constant-en_US.json | 4 +++- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts b/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts index 7c7ecb33cf..1a1606d08d 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts @@ -241,7 +241,8 @@ export function aiQuestionsOf(args: unknown): AiQuestion[] { .slice(0, 6) .map(option => ({label: option.label.trim(), hint: typeof option.hint === 'string' ? option.hint : undefined})), recommended: Array.isArray(question.recommended) ? question.recommended.filter(label => typeof label === 'string') : undefined, - multiple: question.multiple === true + multiple: question.multiple === true, + secret: question.secret === true && !(Array.isArray(question.options) && question.options.length) })); } 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 f348f69429..408c696d4f 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 @@ -15,7 +15,7 @@ @for (item of answers; track item.question.id) {
{{ item.question.question }} - +
} @@ -78,12 +78,18 @@
@if (isFree(step)) {
-
+
{{ 'ai-assistant.question.your-answer' | translate }} - + @if (step.secret) { + + } @else { + + }
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-question.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-question.component.ts index 7c7d2f078e..3afd0b2fac 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-question.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-question.component.ts @@ -133,11 +133,17 @@ export class AiQuestionComponent { } } - type(question: AiQuestion, area: HTMLTextAreaElement): void { + type(question: AiQuestion, area: HTMLTextAreaElement | HTMLInputElement): void { this.pickOther(question); this.typed.update(values => ({...values, [question.id]: area.value})); - area.style.height = 'auto'; - area.style.height = area.scrollHeight + 'px'; + if (area instanceof HTMLTextAreaElement) { + area.style.height = 'auto'; + area.style.height = area.scrollHeight + 'px'; + } + } + + shown(item: {question: AiQuestion; answer: string}): string { + return item.question.secret && item.answer ? '••••••••' : item.answer; } next(): void { diff --git a/ui-ngx/src/app/shared/models/solution-creator.models.ts b/ui-ngx/src/app/shared/models/solution-creator.models.ts index 075ea20a1d..7016ec7389 100644 --- a/ui-ngx/src/app/shared/models/solution-creator.models.ts +++ b/ui-ngx/src/app/shared/models/solution-creator.models.ts @@ -74,6 +74,7 @@ export interface AiQuestion { options: AiQuestionOption[]; recommended?: string | string[]; multiple?: boolean; + secret?: boolean; } export interface AiQuestionAnswer { 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 2ed17bf7fc..1b51293fc7 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -705,7 +705,8 @@ "none": "None", "no-answer": "No answer", "your-answer": "Your answer", - "type-answer": "Type the answer" + "type-answer": "Type the answer", + "type-secret": "Paste it here; it stays hidden" }, "ai-assistant": "AI Assistant", "configure-with-ai": "Configure with AI", @@ -1459,6 +1460,7 @@ "when": "Sends at", "slack": "Slack", "mobileApp": "Mobile app", + "sms": "SMS", "body": "Message", "keys": "Keys", "scope": "Scope"