diff --git a/src/components/trace/hat-trace-timeline.ts b/src/components/trace/hat-trace-timeline.ts index f453fa8f36..742c6c839c 100644 --- a/src/components/trace/hat-trace-timeline.ts +++ b/src/components/trace/hat-trace-timeline.ts @@ -541,17 +541,20 @@ export class HaAutomationTracer extends LitElement { this.shadowRoot!.querySelectorAll( "ha-timeline[data-path]" ).forEach((el) => { - el.style.setProperty( - "--timeline-ball-color", - this.selectedPath === el.dataset.path ? "var(--primary-color)" : null - ); - if (!this.allowPick || el.dataset.upgraded) { + el.toggleAttribute("selected", this.selectedPath === el.dataset.path); + if (!this.allowPick || el.tabIndex === 0) { return; } - el.dataset.upgraded = "1"; - el.addEventListener("click", () => { + el.tabIndex = 0; + const selectEl = () => { this.selectedPath = el.dataset.path; fireEvent(this, "value-changed", { value: el.dataset.path }); + }; + el.addEventListener("click", selectEl); + el.addEventListener("keydown", (ev: KeyboardEvent) => { + if (ev.key === "Enter" || ev.key === " ") { + selectEl(); + } }); el.addEventListener("mouseover", () => { el.raised = true; @@ -572,6 +575,13 @@ export class HaAutomationTracer extends LitElement { ha-timeline[data-path] { cursor: pointer; } + ha-timeline[selected] { + --timeline-ball-color: var(--primary-color); + } + ha-timeline:focus { + outline: none; + --timeline-ball-color: var(--accent-color); + } .error { --timeline-ball-color: var(--error-color); color: var(--error-color); diff --git a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts index c9efd51048..aa893efc49 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts @@ -57,13 +57,13 @@ export class HaAutomationTracePathDetails extends LitElement { ["logbook", "Related logbook entries"], ].map( ([view, label]) => html` -
${label} -
+ ` )} diff --git a/src/panels/config/automation/trace/ha-automation-trace.ts b/src/panels/config/automation/trace/ha-automation-trace.ts index 0d712fb5f7..940c7fc97f 100644 --- a/src/panels/config/automation/trace/ha-automation-trace.ts +++ b/src/panels/config/automation/trace/ha-automation-trace.ts @@ -122,7 +122,7 @@ export class HaAutomationTrace extends LitElement { class="linkButton" href="/config/automation/edit/${this.automationId}" > - + @@ -190,18 +190,20 @@ export class HaAutomationTrace extends LitElement { ["config", "Automation Config"], ].map( ([view, label]) => html` -
${label} -
+ ` )} ${this._trace.blueprint_inputs ? html` -
*.active {