Skip to content

Commit 2cbcf1a

Browse files
committed
Merge branch 'rc'
2 parents 510fc71 + 1c1c0d7 commit 2cbcf1a

16 files changed

+304
-152
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "home-assistant-frontend"
7-
version = "20250903.2"
7+
version = "20250903.3"
88
license = "Apache-2.0"
99
license-files = ["LICENSE*"]
1010
description = "The Home Assistant frontend"

src/components/ha-bottom-sheet.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ export class HaBottomSheet extends LitElement {
232232
box-shadow: var(--wa-shadow-l);
233233
padding: 0;
234234
margin: 0;
235-
236235
top: auto;
237236
inset-inline-end: auto;
238237
bottom: 0;

src/dialogs/shortcuts/dialog-shortcuts.ts

Lines changed: 78 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -11,126 +11,138 @@ import type { HomeAssistant } from "../../types";
1111
import { isMac } from "../../util/is_mac";
1212

1313
interface Text {
14-
type: "text";
15-
key: LocalizeKeys;
14+
textTranslationKey: LocalizeKeys;
1615
}
1716

18-
type ShortcutString = string | { key: LocalizeKeys };
17+
interface LocalizedShortcut {
18+
shortcutTranslationKey: LocalizeKeys;
19+
}
20+
21+
type ShortcutString = string | LocalizedShortcut;
1922

2023
interface Shortcut {
21-
type: "shortcut";
2224
shortcut: ShortcutString[];
23-
key: LocalizeKeys;
25+
descriptionTranslationKey: LocalizeKeys;
2426
}
2527

2628
interface Section {
27-
key: LocalizeKeys;
29+
titleTranslationKey: LocalizeKeys;
2830
items: (Text | Shortcut)[];
2931
}
3032

3133
const CTRL_CMD = "__CTRL_CMD__";
3234

3335
const _SHORTCUTS: Section[] = [
3436
{
35-
key: "ui.dialogs.shortcuts.searching.title",
37+
titleTranslationKey: "ui.dialogs.shortcuts.searching.title",
3638
items: [
37-
{ type: "text", key: "ui.dialogs.shortcuts.searching.on_any_page" },
3839
{
39-
type: "shortcut",
40+
textTranslationKey: "ui.dialogs.shortcuts.searching.on_any_page",
41+
},
42+
{
4043
shortcut: ["C"],
41-
key: "ui.dialogs.shortcuts.searching.search_command",
44+
descriptionTranslationKey:
45+
"ui.dialogs.shortcuts.searching.search_command",
4246
},
4347
{
44-
type: "shortcut",
4548
shortcut: ["E"],
46-
key: "ui.dialogs.shortcuts.searching.search_entities",
49+
descriptionTranslationKey:
50+
"ui.dialogs.shortcuts.searching.search_entities",
4751
},
4852
{
49-
type: "shortcut",
5053
shortcut: ["D"],
51-
key: "ui.dialogs.shortcuts.searching.search_devices",
54+
descriptionTranslationKey:
55+
"ui.dialogs.shortcuts.searching.search_devices",
5256
},
5357
{
54-
type: "text",
55-
key: "ui.dialogs.shortcuts.searching.on_pages_with_tables",
58+
textTranslationKey:
59+
"ui.dialogs.shortcuts.searching.on_pages_with_tables",
5660
},
5761
{
58-
type: "shortcut",
5962
shortcut: [CTRL_CMD, "F"],
60-
key: "ui.dialogs.shortcuts.searching.search_in_table",
63+
descriptionTranslationKey:
64+
"ui.dialogs.shortcuts.searching.search_in_table",
6165
},
6266
],
6367
},
6468
{
65-
key: "ui.dialogs.shortcuts.assist.title",
69+
titleTranslationKey: "ui.dialogs.shortcuts.assist.title",
6670
items: [
6771
{
68-
type: "shortcut",
6972
shortcut: ["A"],
70-
key: "ui.dialogs.shortcuts.assist.open_assist",
73+
descriptionTranslationKey: "ui.dialogs.shortcuts.assist.open_assist",
7174
},
7275
],
7376
},
7477
{
75-
key: "ui.dialogs.shortcuts.automation_script.title",
78+
titleTranslationKey: "ui.dialogs.shortcuts.automation_script.title",
7679
items: [
7780
{
78-
type: "shortcut",
7981
shortcut: [CTRL_CMD, "C"],
80-
key: "ui.dialogs.shortcuts.automation_script.copy",
82+
descriptionTranslationKey:
83+
"ui.dialogs.shortcuts.automation_script.copy",
8184
},
8285
{
83-
type: "shortcut",
8486
shortcut: [CTRL_CMD, "X"],
85-
key: "ui.dialogs.shortcuts.automation_script.cut",
87+
descriptionTranslationKey: "ui.dialogs.shortcuts.automation_script.cut",
8688
},
8789
{
88-
type: "shortcut",
89-
shortcut: [CTRL_CMD, "del"],
90-
key: "ui.dialogs.shortcuts.automation_script.delete",
90+
shortcut: [
91+
CTRL_CMD,
92+
{ shortcutTranslationKey: "ui.dialogs.shortcuts.keys.del" },
93+
],
94+
descriptionTranslationKey:
95+
"ui.dialogs.shortcuts.automation_script.delete",
9196
},
9297
{
93-
type: "shortcut",
9498
shortcut: [CTRL_CMD, "V"],
95-
key: "ui.dialogs.shortcuts.automation_script.paste",
99+
descriptionTranslationKey:
100+
"ui.dialogs.shortcuts.automation_script.paste",
96101
},
97102
{
98-
type: "shortcut",
99103
shortcut: [CTRL_CMD, "S"],
100-
key: "ui.dialogs.shortcuts.automation_script.save",
104+
descriptionTranslationKey:
105+
"ui.dialogs.shortcuts.automation_script.save",
101106
},
102107
],
103108
},
104109
{
105-
key: "ui.dialogs.shortcuts.charts.title",
110+
titleTranslationKey: "ui.dialogs.shortcuts.charts.title",
106111
items: [
107112
{
108-
type: "shortcut",
109-
shortcut: [CTRL_CMD, { key: "ui.dialogs.shortcuts.shortcuts.drag" }],
110-
key: "ui.dialogs.shortcuts.charts.drag_to_zoom",
113+
shortcut: [
114+
CTRL_CMD,
115+
{ shortcutTranslationKey: "ui.dialogs.shortcuts.shortcuts.drag" },
116+
],
117+
descriptionTranslationKey: "ui.dialogs.shortcuts.charts.drag_to_zoom",
111118
},
112119
{
113-
type: "shortcut",
114120
shortcut: [
115121
CTRL_CMD,
116-
{ key: "ui.dialogs.shortcuts.shortcuts.scroll_wheel" },
122+
{
123+
shortcutTranslationKey:
124+
"ui.dialogs.shortcuts.shortcuts.scroll_wheel",
125+
},
117126
],
118-
key: "ui.dialogs.shortcuts.charts.scroll_to_zoom",
127+
descriptionTranslationKey: "ui.dialogs.shortcuts.charts.scroll_to_zoom",
119128
},
120129
{
121-
type: "shortcut",
122-
shortcut: [{ key: "ui.dialogs.shortcuts.shortcuts.double_click" }],
123-
key: "ui.dialogs.shortcuts.charts.double_click",
130+
shortcut: [
131+
{
132+
shortcutTranslationKey:
133+
"ui.dialogs.shortcuts.shortcuts.double_click",
134+
},
135+
],
136+
descriptionTranslationKey: "ui.dialogs.shortcuts.charts.double_click",
124137
},
125138
],
126139
},
127140
{
128-
key: "ui.dialogs.shortcuts.other.title",
141+
titleTranslationKey: "ui.dialogs.shortcuts.other.title",
129142
items: [
130143
{
131-
type: "shortcut",
132144
shortcut: ["M"],
133-
key: "ui.dialogs.shortcuts.other.my_link",
145+
descriptionTranslationKey: "ui.dialogs.shortcuts.other.my_link",
134146
},
135147
],
136148
},
@@ -152,28 +164,28 @@ class DialogShortcuts extends LitElement {
152164
}
153165

154166
private _renderShortcut(
155-
shortcuts: ShortcutString[],
156-
translationKey: LocalizeKeys
167+
shortcutKeys: ShortcutString[],
168+
descriptionKey: LocalizeKeys
157169
) {
158-
const keys = shortcuts.map((shortcut) =>
159-
typeof shortcut === "string" ? shortcut : this.hass.localize(shortcut.key)
160-
);
161-
162170
return html`
163171
<div class="shortcut">
164-
${keys.map(
165-
(key) =>
172+
${shortcutKeys.map(
173+
(shortcutKey) =>
166174
html`<span
167-
>${key === CTRL_CMD
175+
>${shortcutKey === CTRL_CMD
168176
? isMac
169177
? html`<ha-svg-icon
170178
.path=${mdiAppleKeyboardCommand}
171179
></ha-svg-icon>`
172180
: this.hass.localize("ui.panel.config.automation.editor.ctrl")
173-
: key}</span
181+
: typeof shortcutKey === "string"
182+
? shortcutKey
183+
: this.hass.localize(
184+
shortcutKey.shortcutTranslationKey
185+
)}</span
174186
>`
175187
)}
176-
${this.hass.localize(translationKey)}
188+
${this.hass.localize(descriptionKey)}
177189
</div>
178190
`;
179191
}
@@ -197,16 +209,18 @@ class DialogShortcuts extends LitElement {
197209
<div class="content">
198210
${_SHORTCUTS.map(
199211
(section) => html`
200-
<h3>${this.hass.localize(section.key)}</h3>
212+
<h3>${this.hass.localize(section.titleTranslationKey)}</h3>
201213
<div class="items">
202214
${section.items.map((item) => {
203-
if (item.type === "text") {
204-
return html`<p>${this.hass.localize(item.key)}</p>`;
205-
}
206-
if (item.type === "shortcut") {
207-
return this._renderShortcut(item.shortcut, item.key);
215+
if ("shortcut" in item) {
216+
return this._renderShortcut(
217+
(item as Shortcut).shortcut,
218+
(item as Shortcut).descriptionTranslationKey
219+
);
208220
}
209-
return nothing;
221+
return html`<p>
222+
${this.hass.localize((item as Text).textTranslationKey)}
223+
</p>`;
210224
})}
211225
</div>
212226
`

src/panels/config/automation/sidebar/ha-automation-sidebar-card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ export default class HaAutomationSidebarCard extends LitElement {
171171
transition: box-shadow 180ms ease-in-out;
172172
border-bottom-left-radius: 0;
173173
border-bottom-right-radius: 0;
174-
z-index: 6;
175174
position: relative;
176175
background-color: var(
177176
--ha-dialog-surface-background,
@@ -201,6 +200,7 @@ export default class HaAutomationSidebarCard extends LitElement {
201200
.card-content {
202201
max-height: calc(100% - 80px);
203202
overflow: auto;
203+
margin-top: 0;
204204
}
205205
206206
@media (min-width: 450px) and (min-height: 500px) {

src/panels/config/automation/sidebar/ha-automation-sidebar-condition.ts

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export default class HaAutomationSidebarCondition extends LitElement {
6565
}
6666
}
6767
}
68+
// Reset testing state when condition changes
69+
if (changedProperties.has("sidebarKey")) {
70+
this._testing = false;
71+
}
6872
}
6973

7074
protected render() {
@@ -283,20 +287,23 @@ export default class HaAutomationSidebarCondition extends LitElement {
283287
sidebar
284288
></ha-automation-condition-editor>`
285289
)}
286-
<div
287-
class="testing ${classMap({
288-
active: this._testing,
289-
pass: this._testingResult === true,
290-
error: this._testingResult === false,
291-
})}"
292-
>
293-
${this._testingResult
294-
? this.hass.localize(
295-
"ui.panel.config.automation.editor.conditions.testing_pass"
296-
)
297-
: this.hass.localize(
298-
"ui.panel.config.automation.editor.conditions.testing_error"
299-
)}
290+
<div class="testing-wrapper">
291+
<div
292+
class="testing ${classMap({
293+
active: this._testing,
294+
pass: this._testingResult === true,
295+
error: this._testingResult === false,
296+
narrow: this.narrow,
297+
})}"
298+
>
299+
${this._testingResult
300+
? this.hass.localize(
301+
"ui.panel.config.automation.editor.conditions.testing_pass"
302+
)
303+
: this.hass.localize(
304+
"ui.panel.config.automation.editor.conditions.testing_error"
305+
)}
306+
</div>
300307
</div>
301308
</ha-automation-sidebar-card>`;
302309
}
@@ -396,21 +403,13 @@ export default class HaAutomationSidebarCondition extends LitElement {
396403
ha-automation-sidebar-card {
397404
position: relative;
398405
}
399-
.testing {
406+
.testing-wrapper {
400407
position: absolute;
401-
z-index: 6;
402408
top: 0px;
403409
right: 0px;
404410
left: 0px;
405-
text-transform: uppercase;
406-
font-size: var(--ha-font-size-m);
407-
font-weight: var(--ha-font-weight-bold);
408-
background-color: var(--divider-color, #e0e0e0);
409-
color: var(--text-primary-color);
410-
max-height: 0px;
411+
margin: -1px;
411412
overflow: hidden;
412-
transition: max-height 0.3s;
413-
text-align: center;
414413
border-top-right-radius: var(
415414
--ha-card-border-radius,
416415
var(--ha-border-radius-lg)
@@ -419,15 +418,33 @@ export default class HaAutomationSidebarCondition extends LitElement {
419418
--ha-card-border-radius,
420419
var(--ha-border-radius-lg)
421420
);
421+
pointer-events: none;
422+
height: 100px;
423+
}
424+
.testing {
425+
--testing-color: var(--divider-color, #e0e0e0);
426+
text-transform: uppercase;
427+
font-size: var(--ha-font-size-m);
428+
font-weight: var(--ha-font-weight-bold);
429+
background-color: var(--testing-color);
430+
color: var(--text-primary-color);
431+
max-height: 0px;
432+
transition:
433+
max-height 0.3s ease-in-out,
434+
padding-top 0.3s ease-in-out;
435+
text-align: center;
436+
}
437+
.testing.active.narrow {
438+
padding-top: 16px;
422439
}
423440
.testing.active {
424-
max-height: 100px;
441+
max-height: 100%;
425442
}
426443
.testing.error {
427-
background-color: var(--accent-color);
444+
--testing-color: var(--accent-color);
428445
}
429446
.testing.pass {
430-
background-color: var(--success-color);
447+
--testing-color: var(--success-color);
431448
}
432449
`,
433450
];

0 commit comments

Comments
 (0)