Fix Assist styling (#20997)

This commit is contained in:
Paulus Schoutsen 2024-06-05 03:53:40 -04:00 committed by GitHub
parent 53eb7f771f
commit 9ef0bd6e46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 33 deletions

View File

@ -215,10 +215,10 @@ export class HaVoiceCommandDialog extends LitElement {
<div class="messages">
<div class="messages-container" id="scroll-container">
${this._conversation!.map(
// New lines matter for messages
// prettier-ignore
(message) => html`
<div class=${this._computeMessageClasses(message)}>
${message.text}
</div>
<div class=${this._computeMessageClasses(message)}>${message.text}</div>
`
)}
</div>
@ -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`
<p>
${this.hass.localize(
"ui.dialogs.voice_command.not_supported_microphone_browser"
)}
</p>
<p>
${this.hass.localize(
"ui.dialogs.voice_command.not_supported_microphone_documentation",
{
documentation_link: html`
<a
target="_blank"
rel="noopener noreferrer"
href=${documentationUrl(
this.hass,
"/docs/configuration/securing/#remote-access"
)}
>
${this.hass.localize(
"ui.dialogs.voice_command.not_supported_microphone_documentation_link"
)}
</a>
`,
}
)}
</p>
`,
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`<a
target="_blank"
rel="noopener noreferrer"
href=${documentationUrl(
this.hass,
"/docs/configuration/securing/#remote-access"
)}
>${this.hass.localize(
"ui.dialogs.voice_command.not_supported_microphone_documentation_link"
)}</a>`,
}
)}`,
});
}

View File

@ -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": {