Fix testing condition in iOS (#26879)

This commit is contained in:
Paul Bottein
2025-09-04 15:50:39 +02:00
committed by GitHub
parent ce74946706
commit 5abb7d0286
4 changed files with 46 additions and 30 deletions

View File

@@ -232,7 +232,6 @@ export class HaBottomSheet extends LitElement {
box-shadow: var(--wa-shadow-l); box-shadow: var(--wa-shadow-l);
padding: 0; padding: 0;
margin: 0; margin: 0;
top: auto; top: auto;
inset-inline-end: auto; inset-inline-end: auto;
bottom: 0; bottom: 0;

View File

@@ -171,7 +171,6 @@ export default class HaAutomationSidebarCard extends LitElement {
transition: box-shadow 180ms ease-in-out; transition: box-shadow 180ms ease-in-out;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
z-index: 6;
position: relative; position: relative;
background-color: var( background-color: var(
--ha-dialog-surface-background, --ha-dialog-surface-background,
@@ -201,6 +200,7 @@ export default class HaAutomationSidebarCard extends LitElement {
.card-content { .card-content {
max-height: calc(100% - 80px); max-height: calc(100% - 80px);
overflow: auto; overflow: auto;
margin-top: 0;
} }
@media (min-width: 450px) and (min-height: 500px) { @media (min-width: 450px) and (min-height: 500px) {

View File

@@ -65,6 +65,10 @@ export default class HaAutomationSidebarCondition extends LitElement {
} }
} }
} }
// Reset testing state when condition changes
if (changedProperties.has("sidebarKey")) {
this._testing = false;
}
} }
protected render() { protected render() {
@@ -283,20 +287,23 @@ export default class HaAutomationSidebarCondition extends LitElement {
sidebar sidebar
></ha-automation-condition-editor>` ></ha-automation-condition-editor>`
)} )}
<div <div class="testing-wrapper">
class="testing ${classMap({ <div
active: this._testing, class="testing ${classMap({
pass: this._testingResult === true, active: this._testing,
error: this._testingResult === false, pass: this._testingResult === true,
})}" error: this._testingResult === false,
> narrow: this.narrow,
${this._testingResult })}"
? this.hass.localize( >
"ui.panel.config.automation.editor.conditions.testing_pass" ${this._testingResult
) ? this.hass.localize(
: this.hass.localize( "ui.panel.config.automation.editor.conditions.testing_pass"
"ui.panel.config.automation.editor.conditions.testing_error" )
)} : this.hass.localize(
"ui.panel.config.automation.editor.conditions.testing_error"
)}
</div>
</div> </div>
</ha-automation-sidebar-card>`; </ha-automation-sidebar-card>`;
} }
@@ -396,21 +403,13 @@ export default class HaAutomationSidebarCondition extends LitElement {
ha-automation-sidebar-card { ha-automation-sidebar-card {
position: relative; position: relative;
} }
.testing { .testing-wrapper {
position: absolute; position: absolute;
z-index: 6;
top: 0px; top: 0px;
right: 0px; right: 0px;
left: 0px; left: 0px;
text-transform: uppercase; margin: -1px;
font-size: var(--ha-font-size-m);
font-weight: var(--ha-font-weight-bold);
background-color: var(--divider-color, #e0e0e0);
color: var(--text-primary-color);
max-height: 0px;
overflow: hidden; overflow: hidden;
transition: max-height 0.3s;
text-align: center;
border-top-right-radius: var( border-top-right-radius: var(
--ha-card-border-radius, --ha-card-border-radius,
var(--ha-border-radius-lg) var(--ha-border-radius-lg)
@@ -419,15 +418,33 @@ export default class HaAutomationSidebarCondition extends LitElement {
--ha-card-border-radius, --ha-card-border-radius,
var(--ha-border-radius-lg) var(--ha-border-radius-lg)
); );
pointer-events: none;
height: 100px;
}
.testing {
--testing-color: var(--divider-color, #e0e0e0);
text-transform: uppercase;
font-size: var(--ha-font-size-m);
font-weight: var(--ha-font-weight-bold);
background-color: var(--testing-color);
color: var(--text-primary-color);
max-height: 0px;
transition:
max-height 0.3s ease-in-out,
padding-top 0.3s ease-in-out;
text-align: center;
}
.testing.active.narrow {
padding-top: 16px;
} }
.testing.active { .testing.active {
max-height: 100px; max-height: 100%;
} }
.testing.error { .testing.error {
background-color: var(--accent-color); --testing-color: var(--accent-color);
} }
.testing.pass { .testing.pass {
background-color: var(--success-color); --testing-color: var(--success-color);
} }
`, `,
]; ];

View File

@@ -217,7 +217,7 @@ export const automationRowsStyles = css`
export const sidebarEditorStyles = css` export const sidebarEditorStyles = css`
.sidebar-editor { .sidebar-editor {
display: block; display: block;
padding-top: 16px; padding-top: 8px;
} }
.description { .description {
padding-top: 16px; padding-top: 16px;