Skip to content

Conversation

@timmo001
Copy link
Member

@timmo001 timmo001 commented Nov 27, 2025

Breaking change

Proposed change

Alert dialogs are no longer fullscreen, safe area bounds are set with max-height/width and transformation

Screenshots using safe areas of:

Android (Pixel 10) - Landscape (left)
    --app-safe-area-inset-bottom: 36px;
    --app-safe-area-inset-left: 68px;

Standard wa dialogs:
image

image image
All safe areas set
    --app-safe-area-inset-top: 64px;
    --app-safe-area-inset-bottom: 36px;
    --app-safe-area-inset-left: 48px;
    --app-safe-area-inset-right: 24px;
image image image image image image image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@timmo001 timmo001 changed the title Set minimum safe areas in ha-wa-dialog Set minimum dialog safe areas, fix generic alert size Nov 27, 2025
@bramkragten bramkragten added this to the 2025.12 milestone Nov 27, 2025
@timmo001 timmo001 changed the title Set minimum dialog safe areas, fix generic alert size Set minimum dialog safe areas, add generic alert type Nov 27, 2025
@timmo001 timmo001 changed the title Set minimum dialog safe areas, add generic alert type Set 0px min safe areas, add generic alert type Nov 27, 2025
@timmo001 timmo001 changed the title Set 0px min safe areas, add generic alert type Set 0px min safe areas, add generic alert type to ha-wa-dialog Nov 27, 2025
@bramkragten bramkragten self-assigned this Nov 27, 2025
--safe-area-inset-bottom: var(--app-safe-area-inset-bottom, env(safe-area-inset-bottom, 0));
--safe-area-inset-left: var(--app-safe-area-inset-left, env(safe-area-inset-left, 0));
--safe-area-inset-right: var(--app-safe-area-inset-right, env(safe-area-inset-right, 0));
--safe-area-inset-top: max(var(--app-safe-area-inset-top, env(safe-area-inset-top, 0)), 0px);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the max? safe area can never be negative right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think this either, this is the main potential fix for iOS (will need testing as I only have android or desktop)

From @piitaya :
image
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not because of negative margin, Looks like the dialog is push from the bottom (there is a grey bar)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah this makes more sense

Copy link
Member Author

@timmo001 timmo001 Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK reverted.

Reproduced this in android too, it has the same effect on the fullscreen dialog of pushing the header/dialog up with the nav bar

Screenshot_20251127-155433.png

min-height: var(--ha-dialog-min-height);
position: var(--dialog-surface-position, relative);
margin-top: var(--dialog-surface-margin-top, auto);
transform: translateX(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to translate the dialog? What are we trying to fix here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The offset of the dialog, say the safe area is this:

    --app-safe-area-inset-bottom: 36px;
    --app-safe-area-inset-left: 68px;

(this is a pixel 10 in landscape, which is the nav bar + camera bump)

Without the transform, the position will stay centered to the screen and not the safe area. This is fine until the space is limited. This is only the case for alert/confirmation boxes, as the standard dialog will fall into fullscreen with padding

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But since the position is relative we can simply use top and left to position it? We don't need translate then?

@piitaya
Copy link
Member

piitaya commented Nov 27, 2025

Also for generic dialog, I feel like this should be aligned :

CleanShot 2025-11-27 at 16 30 46

@timmo001 timmo001 changed the title Set 0px min safe areas, add generic alert type to ha-wa-dialog Fix ha-wa-dialog fullscreen and make alerts not fullscreen Nov 27, 2025
@timmo001 timmo001 marked this pull request as ready for review November 27, 2025 16:14
width: 100%;
}
.title.alert {
margin-left: var(--ha-space-2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use margin inline start

@piitaya piitaya merged commit 539d0e4 into dev Nov 27, 2025
15 checks passed
@piitaya piitaya deleted the fix-safe-areas-ios-wa-dialog branch November 27, 2025 21:01
@Mariusthvdb
Copy link
Contributor

seems not fixed, and still opening full screen in iOS Companion

C15FB75D-672A-43C0-9380-6BFDBB156433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ha-wa-dialog safe areas on iOS

5 participants