From 9ef0bd6e46febd3d567fa42348c57103ed8f235f Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 5 Jun 2024 03:53:40 -0400 Subject: [PATCH] Fix Assist styling (#20997) --- .../ha-voice-command-dialog.ts | 58 +++++++++---------- src/translations/en.json | 2 +- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index c1fab545ed..59e023723a 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -215,10 +215,10 @@ export class HaVoiceCommandDialog extends LitElement {
${this._conversation!.map( + // New lines matter for messages + // prettier-ignore (message) => html` -
- ${message.text} -
+
${message.text}
` )}
@@ -355,7 +355,7 @@ export class HaVoiceCommandDialog extends LitElement { private _handleSendMessage() { if (this._messageInput.value) { - this._processText(this._messageInput.value); + this._processText(this._messageInput.value.trim()); this._messageInput.value = ""; this._showSendButton = false; } @@ -427,34 +427,28 @@ export class HaVoiceCommandDialog extends LitElement { private async _showNotSupportedMessage() { this._addMessage({ who: "hass", - text: html` -

- ${this.hass.localize( - "ui.dialogs.voice_command.not_supported_microphone_browser" - )} -

-

- ${this.hass.localize( - "ui.dialogs.voice_command.not_supported_microphone_documentation", - { - documentation_link: html` - - ${this.hass.localize( - "ui.dialogs.voice_command.not_supported_microphone_documentation_link" - )} - - `, - } - )} -

- `, + text: + // New lines matter for messages + // prettier-ignore + html`${this.hass.localize( + "ui.dialogs.voice_command.not_supported_microphone_browser" + )} + + ${this.hass.localize( + "ui.dialogs.voice_command.not_supported_microphone_documentation", + { + documentation_link: html`${this.hass.localize( + "ui.dialogs.voice_command.not_supported_microphone_documentation_link" + )}`, + } + )}`, }); } diff --git a/src/translations/en.json b/src/translations/en.json index 23be084a37..f177a46277 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1113,7 +1113,7 @@ "start_listening": "Start listening", "manage_assistants": "Manage assistants", "not_supported_microphone_browser": "Your connection to Home Assistant is not secured using HTTPS. This causes browsers to block Home Assistant from accessing the microphone.", - "not_supported_microphone_documentation": "Visit {documentation_link} to learn how to use a secure URL", + "not_supported_microphone_documentation": "Use the Home Assistant app or visit {documentation_link} to learn how to use a secure URL", "not_supported_microphone_documentation_link": "the documentation" }, "generic": {