KipK
December 9, 2024, 12:07pm
1
Back button still not behaving ok for a while now: Back Button doesn't work · Issue #17820 · home-assistant/frontend · GitHub
I think it shouldn’t be linked to browser history ( browser back button is already here for that ) but just always jump to parent section
petro
(Petro)
December 9, 2024, 12:09pm
2
That’s not considered a bug, so the behavior is considered “correct”. So that issue will never be acted on.
As for your WTH, Yes, it would be nice if it just went back to the parent.
KipK
December 9, 2024, 1:02pm
3
Having to click on it sometime dozen of times to get back can’t be an intentional feature
There’s many report on this github Issue that should be considered as a bug.
petro
(Petro)
December 9, 2024, 1:03pm
4
Yes it is. It’s a normal browser back button it has no extra logic. Each action you do in the ui is essentially a new page in the back button sequence.
Keep in mind I’m just passing the information to you. You don’t need to argue me that the behavior isn’t great. I already know it isn’t great. I’m telling you how it works currently and what was chosen to perform the back functionality.
Simply put, its the same as you clicking the back button on a web browser, which was the original intended behavior.
KipK
December 10, 2024, 1:46pm
5
Most efficient WTH ever, a fix has been merged today, for what I could test, problem solved.
home-assistant:dev
← home-assistant:fix_back_btn
opened 02:08PM - 09 Dec 24 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue or discussion
in the additional information section.
-->
Removed `replaceDialog` and all related logic as it is not used anywhere. @bramkragten correct me if this is wrong but I couldn't find anything using it.
This allowed me to simplify the history management logic for dialogs and fix back button issues.
Multiple modals on top of each other work well now. `Esc` closes all dialogs but this is managed by the dialogs themselves via the `escapeKeyAction` attribute. An example of this is a siren with advanced options in the `more-info` dialog.
Browser history was too limiting to do what we wanted. Only access to current state, no callbacks in the state, etc. So the dialog states are now managed in a stack inside `make-dialog-manager.ts` and only a single state is pushed to the browser history.
Going forward in history will not open a dialog anymore as it made no sense in most cases.
## Type of change
<!--
What type of change does your PR introduce to the Home Assistant frontend?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] 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
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR.
-->
```yaml
```
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #17820 fixes #14571
- This PR is related to issue or discussion:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] 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:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
<!--
Thank you for contributing <3
-->
[docs-repository]: https://github.com/home-assistant/home-assistant.io
Thanks to @MindFreeze
2 Likes