Skip to content

Conversation

@TimoPtr
Copy link
Member

@TimoPtr TimoPtr commented May 22, 2025

Proposed change

With Android edge to edge feature we found out multiple issues in the usage of the safe area. This PR adds missing safe area usage for the toolbar, drawer and dialogs. It misses other places and I've added todo on the parts that I don't know how to handle properly.

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

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.

margin-top: calc(
var(--dialog-surface-margin-top) + var(--safe-area-inset-top)
);
// TODO support left, right and bottom safe area
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be done in content probably, this is only on mobile/narrow I guess?

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 guess we could ignore the fact that it's mobile or not we just look at the safe areas no?

#ha-launch-screen .ha-launch-screen-spacer-top {
flex: 1;
margin-top: calc( 2 * max(var(--safe-area-inset-bottom), 48px) + 46px );
margin-top: calc( 2 * max(var(--safe-area-inset-top), 48px) + 46px );
Copy link
Member Author

Choose a reason for hiding this comment

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

@Madelena was it on purpose to use the bottom inset? If yes I will revert it. In any case the safe-area on the index is broken on Android and should be fully hidden with this #25563 (reply in thread) same for iOS.

color: var(--secondary-text-color);
}
header {
padding-top: var(--safe-area-inset-top);
Copy link
Contributor

@Gregman-js Gregman-js May 22, 2025

Choose a reason for hiding this comment

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

I see doubled insets on entity details. (insets already applied to blue top bar) (Tested on chrome dev tools)
Screenshot 2025-05-22 at 21 22 40

Copy link
Contributor

@Gregman-js Gregman-js May 22, 2025

Choose a reason for hiding this comment

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

Confirmed on mobile

Photos Screenshot 2025-05-22 at 21 39 14 Screenshot 2025-05-22 at 21 39 04

Copy link
Contributor

@Gregman-js Gregman-js left a comment

Choose a reason for hiding this comment

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

Entity details look good.
Others screens that need adjustment now or later:

  • Assistant - missing bottom insets near input area
  • quick-bar e.g. search entity - missing all insets
  • ha-dialog - missing left, right insets which can be problematic in landscape mode
  • logbook,history - missing left,right,bottom insets

@TimoPtr
Copy link
Member Author

TimoPtr commented Jun 26, 2025

@bramkragten Could we add in the manifest.json a flag that tells us that the frontend supports edge-to-edge ?

CC @Gregman-js it would make it possible to know if the server supports it even without being logged in.

@TimoPtr TimoPtr changed the title Add missing safe areas and todos Support missing safe areas Jul 8, 2025
@LeoCal
Copy link

LeoCal commented Sep 1, 2025

This PR would help several people running HA app on Android tablets to get back the full-screen mode on the latest version. For the time being, because of this, I was forced to switch back to 2025.7.1.

@bramkragten
Copy link
Member

@bramkragten Could we add in the manifest.json a flag that tells us that the frontend supports edge-to-edge ?

CC @Gregman-js it would make it possible to know if the server supports it even without being logged in.

I think you can know the version of HA already, It is in the mdns discovery data. Or is that not easy to get?

@TimoPtr
Copy link
Member Author

TimoPtr commented Sep 1, 2025

@bramkragten Could we add in the manifest.json a flag that tells us that the frontend supports edge-to-edge ?
CC @Gregman-js it would make it possible to know if the server supports it even without being logged in.

I think you can know the version of HA already, It is in the mdns discovery data. Or is that not easy to get?

We do also need to handle the case without mDNS. And I don't think we should expose the HA version in the manifest, that's why I proposed a flag that just say if it support edge to edge or not :)

@timmo001
Copy link
Member

timmo001 commented Sep 8, 2025

Will close and keep as reference for #26818 now that some of the changes have been merged

@timmo001 timmo001 closed this Sep 8, 2025
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.

5 participants