From 46580376dd9c8a91e9c5d8cd9ed89a095e1b6988 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 30 Mar 2021 01:59:31 +0200 Subject: [PATCH] Make trace somewhat useable on mobile (#8752) --- .../trace/ha-automation-trace-path-details.ts | 4 +- .../automation/trace/ha-automation-trace.ts | 62 +++++++++++++------ 2 files changed, 45 insertions(+), 21 deletions(-) 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 1a69affc34..23ad06a379 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 @@ -31,6 +31,8 @@ import { classMap } from "lit-html/directives/class-map"; export class HaAutomationTracePathDetails extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; + @property({ type: Boolean, reflect: true }) public narrow!: boolean; + @property() private selected!: NodeInfo; @property() public trace!: AutomationTraceExtended; @@ -239,7 +241,7 @@ ${safeDump(trace.changed_variables).trimRight()} this._loadTraces()} + > + `; + return html` this._backTapped()} .tabs=${configSections.automation} > + ${this.narrow + ? html` + ${title} + +
+ ${actionButtons} +
` + : ""}
-
- ${stateObj?.attributes.friendly_name || this._entityId} -
+ ${!this.narrow + ? html`
+ ${title} +
` + : ""} ${this._traces && this._traces.length > 0 ? html`
@@ -116,19 +140,7 @@ export class HaAutomationTrace extends LitElement {
` : ""} -
- this._loadTraces()} - > - -
+ ${!this.narrow ? html`
${actionButtons}
` : ""}
${this._traces === undefined @@ -173,6 +185,7 @@ export class HaAutomationTrace extends LitElement { ? html` * { + display: contents; + } + .main { height: calc(100% - 56px); display: flex; background-color: var(--card-background-color); } + :host([narrow]) .main { + height: auto; + flex-direction: column; + } + .graph { border-right: 1px solid var(--divider-color); }