Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
78caf28
dialogs: apply safe-area insets (content padding, header mobile inset…
timmo001 Sep 1, 2025
9ed8b33
Set default (40px prio if not set)
timmo001 Sep 1, 2025
f3a9a46
Set default (default padding prio if not set)
timmo001 Sep 1, 2025
83f60dd
Set default to avoid issues
timmo001 Sep 2, 2025
142d96f
Set on container
timmo001 Sep 2, 2025
9cdbab2
Sort
timmo001 Sep 2, 2025
81fdc1b
No longer needed
timmo001 Sep 2, 2025
4f86d50
No longer needed
timmo001 Sep 2, 2025
a27fcb6
No longer needed
timmo001 Sep 2, 2025
bb77927
Remove
timmo001 Sep 2, 2025
a361eae
Restore
timmo001 Sep 2, 2025
b2a39c4
Restore
timmo001 Sep 2, 2025
9156c20
Move to padding
timmo001 Sep 2, 2025
28d198b
Switch to margins, set min and max height
timmo001 Sep 2, 2025
0676c89
Set default
timmo001 Sep 2, 2025
30bbf59
Account for insets to remove extra scrollbars
timmo001 Sep 2, 2025
ab1b56b
Fix content for filter dialog
timmo001 Sep 2, 2025
1cc433f
Move margins outside of media check
timmo001 Sep 3, 2025
d9f2344
Use padding instead
timmo001 Sep 3, 2025
e2f02dd
use min-width instead
timmo001 Sep 3, 2025
300600e
Use padding for just top and bottom
timmo001 Sep 3, 2025
30271f8
Calculate lit-virtualizer to include safe areas
timmo001 Sep 3, 2025
412b198
Calculate lit-virtualizer to include safe areas
timmo001 Sep 3, 2025
eb7d15b
Fix double scrollbar from previous
timmo001 Sep 3, 2025
fe31df1
Remove calculation
timmo001 Sep 3, 2025
3d5d45a
Default
timmo001 Sep 3, 2025
1039334
Remove double calculation
timmo001 Sep 3, 2025
341ecb6
Remove double calculation
timmo001 Sep 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions src/components/ha-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class HaDialog extends DialogBase {
}
.mdc-dialog__actions {
justify-content: var(--justify-action-buttons, flex-end);
padding: 12px 16px max(var(--safe-area-inset-bottom), 16px) 16px;
padding: 12px 16px 16px 16px;
}
.mdc-dialog__actions span:nth-child(1) {
flex: var(--secondary-action-button-flex, unset);
Expand All @@ -100,6 +100,8 @@ export class HaDialog extends DialogBase {
}
.mdc-dialog__container {
align-items: var(--vertical-align-dialog, center);
padding-top: var(--safe-area-inset-top);
padding-bottom: var(--safe-area-inset-bottom);
}
.mdc-dialog__title {
padding: 16px 16px 0 16px;
Expand All @@ -115,15 +117,17 @@ export class HaDialog extends DialogBase {
padding: var(--dialog-content-padding, 24px);
}
:host([hideactions]) .mdc-dialog .mdc-dialog__content {
padding-bottom: max(
var(--dialog-content-padding, 24px),
var(--safe-area-inset-bottom)
);
padding-bottom: var(--dialog-content-padding, 24px);
}
.mdc-dialog .mdc-dialog__surface {
position: var(--dialog-surface-position, relative);
top: var(--dialog-surface-top);
margin-top: var(--dialog-surface-margin-top);
min-width: calc(
var(--mdc-dialog-min-width, 100vw) - var(
--safe-area-inset-left
) - var(--safe-area-inset-right)
);
min-height: var(--mdc-dialog-min-height, auto);
border-radius: var(--ha-dialog-border-radius, 24px);
-webkit-backdrop-filter: var(--ha-dialog-surface-backdrop-filter, none);
Expand All @@ -137,6 +141,24 @@ export class HaDialog extends DialogBase {
display: flex;
flex-direction: column;
}

@media all and (max-width: 450px), all and (max-height: 500px) {
.mdc-dialog .mdc-dialog__surface {
min-height: calc(
100vh - var(--safe-area-inset-top, 0px) - var(
--safe-area-inset-bottom,
0px
)
);
max-height: calc(
100vh - var(--safe-area-inset-top, 0px) - var(
--safe-area-inset-bottom,
0px
)
);
}
}

.header_title {
display: flex;
align-items: center;
Expand Down
1 change: 0 additions & 1 deletion src/dialogs/more-info/controls/more-info-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ class MoreInfoUpdate extends LitElement {
bottom: 0;
margin: 0 -24px 0 -24px;
margin-bottom: calc(-1 * max(var(--safe-area-inset-bottom), 24px));
padding-bottom: var(--safe-area-inset-bottom);
box-sizing: border-box;
display: flex;
flex-direction: column;
Expand Down
5 changes: 4 additions & 1 deletion src/dialogs/more-info/ha-more-info-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,10 @@ export class MoreInfoDialog extends LitElement {
ha-dialog {
/* Set the top top of the dialog to a fixed position, so it doesnt jump when the content changes size */
--vertical-align-dialog: flex-start;
--dialog-surface-margin-top: 40px;
--dialog-surface-margin-top: max(
40px,
var(--safe-area-inset-top, 0px)
);
--dialog-content-padding: 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/dialogs/quick-bar/ha-quick-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ export class QuickBar extends LitElement {
class="ha-scrollbar"
style=${styleMap({
height: this._narrow
? "calc(100vh - 56px)"
: `${Math.min(
? "calc(100vh - 56px - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px))"
: `calc(${Math.min(
items.length * (commandMode ? 56 : 72) + 26,
500
)}px`,
)}px - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px))`,
})}
.items=${items}
.renderItem=${this._renderItem}
Expand Down
8 changes: 7 additions & 1 deletion src/layouts/hass-tabs-subpage-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,13 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
}

.filter-dialog-content {
height: calc(100vh - 1px - 61px - var(--header-height));
height: calc(
100vh -
70px - var(--header-height, 0px) - var(
--safe-area-inset-top,
0px
) - var(--safe-area-inset-bottom, 0px)
);
display: flex;
flex-direction: column;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,8 @@ class DialogMQTTDeviceDebugInfo extends LitElement {
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-dialog {
--mdc-dialog-min-width: calc(
100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left)
);
--mdc-dialog-max-width: calc(
100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left)
);
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
}
}
ha-switch {
Expand Down
8 changes: 7 additions & 1 deletion src/panels/config/helpers/dialog-helper-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,13 @@ export class DialogHelperDetail extends LitElement {
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-list {
height: calc(100vh - 184px);
height: calc(
100vh -
184px - var(--safe-area-inset-top, 0px) - var(
--safe-area-inset-bottom,
0px
)
);
}
}
`,
Expand Down
4 changes: 3 additions & 1 deletion src/panels/config/integrations/dialog-add-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,9 @@ class AddIntegrationDialog extends LitElement {
class="ha-scrollbar"
style=${styleMap({
width: `${this._width}px`,
height: this._narrow ? "calc(100vh - 184px)" : "500px",
height: this._narrow
? "calc(100vh - 184px - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px))"
: "500px",
})}
@click=${this._integrationPicked}
@keypress=${this._handleKeyPress}
Expand Down
16 changes: 9 additions & 7 deletions src/panels/config/voice-assistants/dialog-expose-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,21 @@ class DialogExposeEntity extends LitElement {
}
@media all and (max-width: 500px), all and (max-height: 500px) {
ha-dialog {
--mdc-dialog-min-width: calc(
100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left)
);
--mdc-dialog-max-width: calc(
100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left)
);
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--mdc-dialog-max-height: 100%;
--vertical-align-dialog: flex-end;
--ha-dialog-border-radius: 0px;
}
lit-virtualizer {
height: calc(100vh - 198px);
height: calc(
100vh -
210px - var(--safe-area-inset-top, 0px) - var(
--safe-area-inset-bottom,
0px
)
);
}
search-input {
--text-field-suffix-padding-left: unset;
Expand Down
5 changes: 2 additions & 3 deletions src/panels/config/zone/dialog-home-zone-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ class DialogHomeZoneDetail extends LitElement {
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-dialog {
--mdc-dialog-min-width: calc(
100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left)
);
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
}
}
`,
Expand Down
5 changes: 2 additions & 3 deletions src/panels/config/zone/dialog-zone-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ class DialogZoneDetail extends LitElement {
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-dialog {
--mdc-dialog-min-width: calc(
100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left)
);
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
}
}
ha-form.passive {
Expand Down
Loading