Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve backwards navigation #4956

Closed
LinqLover opened this issue Jan 5, 2025 · 6 comments
Closed

Improve backwards navigation #4956

LinqLover opened this issue Jan 5, 2025 · 6 comments
Labels
bug Something isn't working question Further information is requested webview

Comments

@LinqLover
Copy link

Home Assistant Android app version(s):

Android version(s): 14

Device model(s): Google Pixel 5 5G

Home Assistant version: 2024.12.5

Last working Home Assistant release (if known): -

Description of problem, include YAML if issue is related to notifications:

There are some issues with backwards navigation (by swiping from the left/right edge of the screen into the app):

1. App closes when going back from every after visiting device info

  1. Open an entity (from a dashboard or from Settings > Devices and services > Entities
  2. Choose Device Info from the ellipsis menu
  3. Swipe back to Device Info (works)
  4. Swipe back again

Expected: see previous dashboard/list of entities again

Actual: App quits

2. Going back from first page terminates, not minimizes app

  1. Open the app (after killing it)
  2. Optional: Perform n navigation steps, then swipe back n times
  3. Swipe back one more time -> you land on home screen/in previous app as expected
  4. Reopen app

Expected: App is still loaded, you see the last page instantly

Actual: The app has apparently terminated, this causes a load time of 3 seconds on my device. This is quite annoying because I very often navigate forth and back like this. For comparison, most other apps do not terminate if I only go back from the first page but stay "hot" in the background until Android decides to stop them (or they have faster loading times so I don't notice).

Companion App Logs:

(will be provided on demand)

Screenshot or video of problem:

Additional information:

Thanks for the great work!

@LinqLover LinqLover added the bug Something isn't working label Jan 5, 2025
@dshokouhi
Copy link
Member

For the first point the entity pop-up does not have a URL and therefore it's not part of the browser history so going back will close the app as expected.

The second part is common app behavior especially for WebView apps.

What happens if you try all these steps in chrome for Android on the same device? I'm guessing you see the same issue?

@dshokouhi dshokouhi added question Further information is requested webview labels Jan 5, 2025
@LinqLover
Copy link
Author

LinqLover commented Jan 5, 2025

Thanks! I can reproduce both behaviors in the browser. However, reopening Home Assistant is faster there when using the forward button, and because it is "just" a website, I do not expect the same level of fluidity there.

I understand your arguments from a technical side but the current behavior still leaves me as a user puzzled. 😅 I'm nowhere familiar with this stack, but give the entity card a (fragment?) URL in the frontend (at least on mobile?) and prevent the default WebView navigation behavior when the navigation history is empty?

@dshokouhi
Copy link
Member

The app will behave like the browser for the most part. The app does not handle anything from the HA frontend so it cannot give the pop-up a URL. We do have some handling of the back button but it behaves like any other Android app. The app will exit if you press back on the first screen when there's is no more history. That's intentional and expected.

@jpelgrom
Copy link
Member

jpelgrom commented Jan 5, 2025

You can actually report 1 as an unexpected navigation issue for the frontend, if it doesn't already exist: https://github.com/home-assistant/frontend/issues.

Re. 2 this actually depends on the system, not the app. If going back will send you to the home screen it will not quit. There is no way for an app to "minimize" itself without quitting the activity. Most likely other apps are just a bit faster to load the initial screen.

@dshokouhi
Copy link
Member

Closing as this is working as intended

@dshokouhi dshokouhi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2025
@LinqLover
Copy link
Author

Will create an issue in the frontend for 1.

Re 2, would you welcome an issue about the starting time? I'm not sure whether this is caused by the app or by the frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested webview
Projects
None yet
Development

No branches or pull requests

3 participants