Skip to content

Commit d64acca

Browse files
committed
Merge branch 'rc'
2 parents 2cbcf1a + 59571d0 commit d64acca

18 files changed

+42
-56
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.3"
7+
version = "20250903.5"
88
license = "Apache-2.0"
99
license-files = ["LICENSE*"]
1010
description = "The Home Assistant frontend"

src/components/ha-automation-row.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ export class HaAutomationRow extends LitElement {
8383
!(ev.ctrlKey || ev.metaKey) &&
8484
!ev.shiftKey &&
8585
(ev.key === "ArrowUp" || ev.key === "ArrowDown")
86-
) &&
87-
!(
88-
(ev.ctrlKey || ev.metaKey) &&
89-
!ev.shiftKey &&
90-
!ev.altKey &&
91-
(ev.key === "c" ||
92-
ev.key === "x" ||
93-
ev.key === "Delete" ||
94-
ev.key === "Backspace")
9586
)
9687
) {
9788
return;
@@ -112,22 +103,6 @@ export class HaAutomationRow extends LitElement {
112103
return;
113104
}
114105

115-
if (ev.ctrlKey || ev.metaKey) {
116-
if (ev.key === "c") {
117-
fireEvent(this, "copy-row");
118-
return;
119-
}
120-
if (ev.key === "x") {
121-
fireEvent(this, "cut-row");
122-
return;
123-
}
124-
125-
if (ev.key === "Delete" || ev.key === "Backspace") {
126-
fireEvent(this, "delete-row");
127-
return;
128-
}
129-
}
130-
131106
this.click();
132107
}
133108

src/mixins/keyboard-shortcut-mixin.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { LitElement } from "lit";
22
import type { Constructor } from "../types";
3+
import { canOverrideAlphanumericInput } from "../common/dom/can-override-input";
34

45
declare global {
56
type SupportedShortcuts = Record<string, () => void>;
@@ -17,6 +18,14 @@ export const KeyboardShortcutMixin = <T extends Constructor<LitElement>>(
1718
!event.altKey &&
1819
event.key in supportedShortcuts
1920
) {
21+
// Only capture the event if the user is not focused on an input
22+
if (!canOverrideAlphanumericInput(event.composedPath())) {
23+
return;
24+
}
25+
// Don't capture the event if the user is selecting text
26+
if (window.getSelection()?.toString()) {
27+
return;
28+
}
2029
event.preventDefault();
2130
supportedShortcuts[event.key]();
2231
return;

src/panels/config/automation/action/ha-automation-action-editor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export default class HaAutomationActionEditor extends LitElement {
5050
class=${classMap({
5151
"card-content": true,
5252
disabled:
53-
this.disabled || (this.action.enabled === false && !this.yamlMode),
53+
!this.indent &&
54+
(this.disabled ||
55+
(this.action.enabled === false && !this.yamlMode)),
5456
yaml: yamlMode,
5557
indent: this.indent,
5658
card: !this.inSidebar,
@@ -97,7 +99,7 @@ export default class HaAutomationActionEditor extends LitElement {
9799
if (!ev.detail.isValid) {
98100
return;
99101
}
100-
fireEvent(this, "yaml-changed", {
102+
fireEvent(this, this.inSidebar ? "yaml-changed" : "value-changed", {
101103
value: migrateAutomationAction(ev.detail.value),
102104
});
103105
}

src/panels/config/automation/action/ha-automation-action-row.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,6 @@ export default class HaAutomationActionRow extends LitElement {
460460
.sortSelected=${this.sortSelected}
461461
@click=${this._toggleSidebar}
462462
@toggle-collapsed=${this._toggleCollapse}
463-
@copy-row=${this._copyAction}
464-
@cut-row=${this._cutAction}
465-
@delete-row=${this._onDelete}
466463
>${this._renderRow()}</ha-automation-row
467464
>`
468465
: html`

src/panels/config/automation/action/types/ha-automation-action-condition.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { customElement, property, query } from "lit/decorators";
33
import memoizeOne from "memoize-one";
44
import { fireEvent } from "../../../../../common/dom/fire_event";
55
import { stringCompare } from "../../../../../common/string/compare";
6+
import { stopPropagation } from "../../../../../common/dom/stop_propagation";
67
import type { LocalizeFunc } from "../../../../../common/translations/localize";
78
import "../../../../../components/ha-list-item";
89
import "../../../../../components/ha-select";
@@ -66,6 +67,7 @@ export class HaConditionAction extends LitElement implements ActionElement {
6667
.value=${this.action.condition}
6768
naturalMenuWidth
6869
@selected=${this._typeChanged}
70+
@closed=${stopPropagation}
6971
>
7072
${this._processedTypes(this.hass.localize).map(
7173
([opt, label, icon]) => html`

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ export default class HaAutomationConditionEditor extends LitElement {
5353
class=${classMap({
5454
"card-content": true,
5555
disabled:
56-
this.disabled ||
57-
(this.condition.enabled === false && !this.yamlMode),
56+
!this.indent &&
57+
(this.disabled ||
58+
(this.condition.enabled === false && !this.yamlMode)),
5859
yaml: yamlMode,
5960
indent: this.indent,
6061
card: !this.inSidebar,
@@ -103,7 +104,9 @@ export default class HaAutomationConditionEditor extends LitElement {
103104
if (!ev.detail.isValid) {
104105
return;
105106
}
106-
fireEvent(this, "yaml-changed", { value: ev.detail.value });
107+
fireEvent(this, this.inSidebar ? "yaml-changed" : "value-changed", {
108+
value: ev.detail.value,
109+
});
107110
}
108111

109112
private _onUiChanged(ev: CustomEvent) {

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ export default class HaAutomationConditionRow extends LitElement {
369369
.sortSelected=${this.sortSelected}
370370
@click=${this._toggleSidebar}
371371
@toggle-collapsed=${this._toggleCollapse}
372-
@copy-row=${this._copyCondition}
373-
@cut-row=${this._cutCondition}
374-
@delete-row=${this._onDelete}
375372
>${this._renderRow()}</ha-automation-row
376373
>`
377374
: html`
@@ -386,12 +383,12 @@ export default class HaAutomationConditionRow extends LitElement {
386383
error: this._testingResult === false,
387384
})}"
388385
>
389-
${this._testingResult
390-
? this.hass.localize(
391-
"ui.panel.config.automation.editor.conditions.testing_pass"
392-
)
386+
${this._testingResult === undefined
387+
? nothing
393388
: this.hass.localize(
394-
"ui.panel.config.automation.editor.conditions.testing_error"
389+
`ui.panel.config.automation.editor.conditions.testing_${
390+
this._testingResult ? "pass" : "error"
391+
}`
395392
)}
396393
</div>
397394
</ha-card>

src/panels/config/automation/ha-automation-editor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ export class HaAutomationEditor extends PreventUnsavedMixin(
593593
this.hass
594594
) {
595595
const initData = getAutomationEditorInitData();
596+
this._dirty = !!initData;
596597
let baseConfig: Partial<AutomationConfig> = { description: "" };
597598
if (!initData || !("use_blueprint" in initData)) {
598599
baseConfig = {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ export default class HaAutomationSidebarCondition extends LitElement {
296296
narrow: this.narrow,
297297
})}"
298298
>
299-
${this._testingResult
300-
? this.hass.localize(
301-
"ui.panel.config.automation.editor.conditions.testing_pass"
302-
)
299+
${this._testingResult === undefined
300+
? nothing
303301
: this.hass.localize(
304-
"ui.panel.config.automation.editor.conditions.testing_error"
302+
`ui.panel.config.automation.editor.conditions.testing_${
303+
this._testingResult ? "pass" : "error"
304+
}`
305305
)}
306306
</div>
307307
</div>

0 commit comments

Comments
 (0)