diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index d0d7264b3b..87f9ac92a2 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -1,5 +1,6 @@ import { consume } from "@lit/context"; import { + mdiAppleKeyboardCommand, mdiCog, mdiContentSave, mdiDebugStepOver, @@ -87,6 +88,7 @@ import "./blueprint-automation-editor"; import "./manual-automation-editor"; import type { HaManualAutomationEditor } from "./manual-automation-editor"; import { UndoRedoMixin } from "../../../mixins/undo-redo-mixin"; +import { isMac } from "../../../util/is_mac"; declare global { interface HTMLElementTagNameMap { @@ -215,6 +217,10 @@ export class HaAutomationEditor extends UndoRedoMixin< : undefined; const useBlueprint = "use_blueprint" in this._config; + const shortcutIcon = isMac + ? html`` + : this.hass.localize("ui.panel.config.automation.editor.ctrl"); + return html` + + ${this.hass.localize("ui.common.undo")} + ( + ${shortcutIcon} + + + Z) + + - ` + + + ${this.hass.localize("ui.common.redo")} + + (${shortcutIcon} + + + Y) + + ` : nothing} ${this._config?.id && !this.narrow ? html` @@ -1292,6 +1317,15 @@ export class HaAutomationEditor extends UndoRedoMixin< ha-fab.dirty { bottom: calc(16px + var(--safe-area-inset-bottom, 0px)); } + ha-tooltip ha-svg-icon { + width: 12px; + } + ha-tooltip .shortcut { + display: inline-flex; + flex-direction: row; + align-items: center; + gap: 2px; + } `, ]; } diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 1b2dd7de65..566e6e18b1 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -1,5 +1,6 @@ import { consume } from "@lit/context"; import { + mdiAppleKeyboardCommand, mdiCog, mdiContentSave, mdiDebugStepOver, @@ -75,6 +76,7 @@ import "./blueprint-script-editor"; import "./manual-script-editor"; import type { HaManualScriptEditor } from "./manual-script-editor"; import { UndoRedoMixin } from "../../../mixins/undo-redo-mixin"; +import { isMac } from "../../../util/is_mac"; const baseEditorMixins = SubscribeMixin( PreventUnsavedMixin(KeyboardShortcutMixin(LitElement)) @@ -168,6 +170,10 @@ export class HaScriptEditor extends UndoRedoMixin< : undefined; const useBlueprint = "use_blueprint" in this._config; + const shortcutIcon = isMac + ? html`` + : this.hass.localize("ui.panel.config.automation.editor.ctrl"); + return html` + + ${this.hass.localize("ui.common.undo")} + + (${shortcutIcon} + + + Z) + + - ` + + + ${this.hass.localize("ui.common.redo")} + + (${shortcutIcon} + + + Y) + + ` : nothing} ${this.scriptId && !this.narrow ? html` @@ -1233,6 +1257,15 @@ export class HaScriptEditor extends UndoRedoMixin< text-decoration: none; color: var(--primary-color); } + ha-tooltip ha-svg-icon { + width: 12px; + } + ha-tooltip .shortcut { + display: inline-flex; + flex-direction: row; + align-items: center; + gap: 2px; + } `, ]; }