home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.11k stars 2.81k forks source link

Back Button doesn't work #17820

Open parkkralle opened 1 year ago

parkkralle commented 1 year ago

Checklist

Describe the issue you are experiencing

The back button does not work correctly (yout have to click it 5 times) after opening the more info dialog by clicking the value in an entities card. If you click on the name or icon, it works.

image image

Describe the behavior you expected

The Back Button should work correctly.

Steps to reproduce the issue

  1. Open a page with a back button
  2. Click on an Value in a entities card
  3. Click on the back button

What version of Home Assistant Core has the issue?

2023.8.4

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Edge, Chrome, iOS App, Android App

Which operating system are you using to run this browser?

Win 11, iOS, Android

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

ildar170975 commented 1 year ago

Cannot confirm. Win10+Chrome HA2023.8.0

Steps:

  1. Subview with Entities card is displayed.
  2. Do not tap on the "Back" button.
  3. Tap on a state of some entity.
  4. more-info is displayed.
  5. Instead of closing the more-info popup, tap on the "Back" button.
  6. The more-info popup is closed, the "back" surf is not performed (as it is expected).
  7. Tap on the "Back" button.
  8. The "back" surf is performed.

m

Xitee1 commented 1 year ago

Duplicate of #14571

parkkralle commented 1 year ago

I'll do a screen capture later.

parkkralle commented 1 year ago

Back button works correctly (More Info dialog opened by icon):

https://github.com/home-assistant/frontend/assets/59173472/293337b9-08b6-47cf-aeb5-cfd04a00de89

Back button does not work correctly (More Info dialog opened by value):

https://github.com/home-assistant/frontend/assets/59173472/ea673442-33a0-4e3b-90ac-e4ce492d7d34

Xitee1 commented 1 year ago

Oh so that's why it sometimes works and sometimes not. It's exactly the same for me. When opening by pressing on the name, it works. When opening by pressing the value I need to press the back button multiple times.

github-actions[bot] commented 11 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Xitee1 commented 11 months ago

Still an issue.

KmanOz commented 11 months ago

Yes an issue for me as well. What funny is I installed DuckDuck go browser on my Mac. Back button worked fine a few times and then just stopped working. Definitely an issue.

abarange commented 10 months ago

Still an issue Updated to the latest version

KmanOz commented 10 months ago

So I can add this. For anyone who is having this issue, please check this and see if the same happens on your system. First confirm the back button doesn't work. Then log out of HASS and log back in. As soon as I log back in the button works a few times and then reverts back to not working. Log out again and it will repeat. Strange indeed.

pepisgo commented 9 months ago

@KmanOz I tried that, it looks like it works only one time after logout/login.

ildar170975 commented 8 months ago

Managed to reproduce it in different setups. It is very simple:

  1. Select a view with an action: navigate defined:

    title: view_0
    path: view_0
    cards:
    - type: entities
    entities:
      - entity: sun.sun
        tap_action:
          action: navigate
          navigation_path: /lovelace-yaml/view_1

    image

  2. Go to a subview:

    title: view_1
    path: view_1
    subview: true
    cards:
    - type: entity
    entity: zone.home

    image

  3. Tap on an entity to get a more-info popup:

image

Note that so far you can close more info & press a back button -> you will leave the subview.

  1. Tap on "show more" - now you are on a History view:

image

  1. Go back to more-info.
  2. Close more-info -> you are on a subview.
  3. Press the back button.

Congratulations: you are not going back.

In case exactly that sequence you will need TWO tapping the back button to go back. But if you opening more-info & a history several times - then number of these tappings may be rather big.

Earlier I said that I was not able to reproduce the glitch. But I did not open a History in that test - and seems that opening the History view is a reason of the glitch.

ildar170975 commented 8 months ago

And the glitch is also for a "Device" view:

  1. Select any device with at least 1 entity. Assume this is a "mobile_app" device. Then a "Device" view is displayed:

image

  1. Tap on any entity. A "more-info" popup is displayed:

image

  1. Tap on "Show more" to show a History view:

image

  1. Tap on "Back" to return to "more-info". Close "more-info" by pressing "X".
  2. Repeat steps 2..4.
  3. Tap on "Back" ("arrow left") - you need to press it several times to go back.

So, the glitch occurs if a user opened a History view.

RonaldRegister commented 7 months ago

can confirm this issue is stil present in 2024.3.1 on multiple browsers.

UplandJacob commented 6 months ago

This happens to me ALL the time. IOS app

Flappiee commented 6 months ago

Can confirm this issue still exists. See it many times when i open a device and look at the history of different sensors. Have to press the "back" button up to 5 times before it is realy going back.

I'm running this versions: Core 2024.5.4 Supervisor 2024.05.1 Operating System 12.3 Frontend 20240501.1

tomas-dorda commented 6 months ago

Me too

UplandJacob commented 6 months ago

https://github.com/home-assistant/frontend/assets/123428589/8bac1a12-b839-426d-81f0-33a70afee29a

The more entities you click on the worse it gets.

Also, if you have a subview with a web card, navigating around on it will another click the the back arrow.

Xitee1 commented 6 months ago

Not exactly the same problem but related: For a while now the Android back button in the App also no longer works properly. When opening an entity in the dashboard and clicking show more, then pressing the back button brings you back to the entity overview as expected but pressing it again to close the dialog, it closes the whole App instead going back to the dashboard.

RonaldRegister commented 3 months ago

Issue still present in 2024.7.3

magdogg commented 3 months ago

Same issue here in 2024.8. Please fix it Nabu Casa...

UplandJacob commented 2 months ago

Also is really a problem in a subview with a single webpage card. The back button controls the webpage card until it gets through all the history (like the back button in a normal browser).

Suggested fixes for this particular problem: If the currently shown page is the same as the page the card is programmed to, skip the rest of the history. AND/OR: separate back button for the webpage card.

This bug seems to be caused by so many different things. It seems like the back button goes through every single page that you were on, it needs to be simplified.

armantaherian commented 2 months ago

Same issue.

@UplandJacob It also doesn't work with the browser back button at least in Chrome. It seems that when a modal is triggered to be shown, it pushes something (extra) into the browser history but is forgotten to be removed after closing the modal.

Just adding some photo

  1. In devices page:

    Screenshot 2024-09-03 at 12 26 58
  2. In the device page, when clicking on name of entity:

    Screenshot 2024-09-03 at 12 29 06
  3. In the device page, when clicking on value of entity:

    Screenshot 2024-09-03 at 12 27 52

I'm trying to understand the frontend code, but if anyone has any clue, it might be helpful.

tbrasser commented 2 months ago

Same here, it seems we cycle through any history paths / url params instead of actually going to the previous page (in the hierarchy)

You can keep tapping the back button, at some point it will work.

UplandJacob commented 2 months ago

at some point it will work

I’ve had it get stuck before. When a page automatically redirects you (like for a sign in), you hit back, then it redirects you again. Then you’re stuck.

The only way to get out is to clear the frontend cache. You can’t get to the normal menu in a subview, so In this case on mobile that means you have to spam the bottom right corner when you open the app to click the settings icon. Then go to debugging -> reset frontend cache.

neilv commented 2 months ago

can confirm this issue is stil present in 2024.9.1 on multiple browsers / Android App

ddanielww commented 1 month ago

New to home assistant, very powerful software, really like it, but a working back button shouldn’t be to much to ask for.

Logout and back in and it works for a little while .

create automation , select back, save, nothing, just stuck on the page.

This bug is making the application nearly impossible to use for me, please fix.

philbert commented 1 month ago

Ha, I never noticed it was clicking on the value that was problem. I just observed it sometimes happened, and other times it didn't but it usually got worse the more stuff you clicked on. Since it works fine when you click on the name it must be a relatively straight forward fix to make it work the same when you click on the value.

armantaherian commented 1 month ago

@philbert It's somewhat straightforward, somewhat not. I figured out the problem in my local system: the open-modal trigger occurs multiple times when you click on a value. This happens at least once on the row and another time on the value. Each has its own event listener, and both open the modal. So, there's one modal but dozens of history.push.

philbert commented 1 month ago

@armantaherian Could you point out where in the code this is happening? I don't have much javascript experience, but I might have a shot at trying to fix it.

armantaherian commented 1 month ago

@philbert if you comment these line, fix some aspect of the problem, but I think it's not safe.

https://github.com/home-assistant/frontend/blob/e32b15ede2c3795a298896c0aae832834d8a71a4/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts#L65-L69

A more effective approach might be to verify the modal's status. If it's already visible, we should not add new state to the history.push.

KipK commented 1 month ago

Quick question to those having this issue ? Do you all have Broswer Mod extension activated ? Removing browser mod solve the back button problem here.

elupus commented 1 month ago

Nope.

ddanielww commented 1 month ago

Do not have browser mod installed and back but never works, so frustrating

tomas-dorda commented 1 month ago

did not help

ildar170975 commented 1 month ago

Removing browser mod solve the back button problem here.

Not using browser-mod. It is super-easy to reproduce the issue - https://github.com/home-assistant/frontend/issues/17820#issuecomment-1975766026

neilv commented 1 month ago

Remove browser_mod, no effect. 😥

ddanielww commented 1 month ago

Every part of the system is affected, create an automation, back doesn’t work. It’s literally bugged all over the system, hope this gets fixed soon.

magdogg commented 1 month ago

It's a very real bug that is making using the HA UI very irritating.

KipK commented 1 month ago

You're right I still have the bug. I got it worse with BrowserMod, so gave me the illusion it was solved.. :)

magdogg commented 1 month ago

Yea the back button should perform the action: Go back one page. Nothing else.

ddanielww commented 1 month ago

https://github.com/user-attachments/assets/ffcf1b00-022b-4295-96b1-e193433199eb

So this is by design?

The back button does not function correctly all over.

@magdogg

There is clearly an issue, it's everywhere, it is making it unusable.

Can this be fixed please?

KipK commented 1 month ago

Also the back button from the interface shouldn't be linked to browser history like it is.

If you get to home assistant ui from a direct link to settings as example, there's no way to get back to the home.

wociscz commented 1 month ago

Bug still present in Core & Supervisor 2024.10.2, OS 13.2

ddanielww commented 1 month ago

Is anyone reviewing this bug? It’s making my time with home assistant unusable

backslashV commented 1 month ago

Same problem since forever. Are HA folks even aware of this thread? I didn't see any acknowledgements here.

Rihan9 commented 1 month ago

There are few duplicates about this issue. I guess they are working on one of them. I Hope so. The front-end is pretty frustrating to use right now due to this issue. From mobile (Android) is even worse because the navigation just broke completely and you are forced to close the app and reopen It.

ddanielww commented 1 month ago

I find out it mad how the basics of the application don’t work like the back button.

The notification system doesn’t work, shows 1 new notification but doesn’t show until you close and full reload the application.

sorry going of topic , a working back button / a way to navigate is essential please fix.

mousemat86 commented 1 month ago

Nabu, please can we get a fix for this.

zulu64 commented 1 month ago

@frenck, kindly give this bug some TLC.

It makes subview "back button" functionality useless if we use any modal windows within that subview, e.g. more info windows, bubble card et al.

My 2 cents: The problem isn't with the "back button" - it retraces the history as expected. It looks like each modal window pushes itself onto the tab history, but doesn't pop it on exit, essentially corrupting the history.

If correct, 2 solutions come to mind for core modal windows e.g. more info:

  1. Do not push onto the tab history on entry, or...
  2. Pop from tab history on exit

Hope this helps.