MainUI - action:options & back button

Hi,

OH3.2
If I add an action “command options” to an ui element a pop-up at the bottom of the page will appear showing the available options and a cancel button.

If I don’t select any option nor cancel but just pressing back in the browser or at my phone, then I would expect that the options pop-up will close, however the options pop-up will stay open and the “backwards” operation is executed on the page where I have clicked before.

E.g.
Page A will include a link to navigate to page B
Page B will include the options
If I navigate from page A to page B, open the options within page B and then press the back button, I will see page A and the options from page B are still visible, while I would expect that the options will close and I will stay at page B.

Hope it’s clear enough what I mean.

Is this something that’s related to openhab or based on any framework or browser and out of control for openhab?

I think this is pretty much the expected behavior. The back button on the browser very specifically goes to the previous web-page request, but the options popup is a script action on a page and not a web-page request. The browser’s list of web requests simply can’t know about the script action, so it doesn’t interact with that at all. This is why there is automatically a cancel link added to the options on the popup. That is the proper way to close the options popup and will not alter the web-request so that you stay on the correct page.

The browser could know about the popup, if the ui will put a record into browsers history.

I really don’t think this is a workable idea. So much of the UI is script actions, how do you decide which warrant pushing the script state into the history and which don’t. Personally, if I hit the back button I want to go back to the previous page, I don’t want to iterate through all the popups, popovers, and cell expansions that have occurred on the current page. And implementing it for only some of these things is just more confusing than useful.

There are already two perfectly instinctive and functional ways to close the options popup, the cancel link and clicking anywhere on the background.

I am, as always, just one voice. Maybe others feel differently. You are certainly welcome to put in a feature request or even better a PR on github and see if this gets any traction.

how do you decide which warrant pushing the script state into the history and which don’t.

Everytime the UI screen will show a different page / component you should be able to go back to previous view

Personally, if I hit the back button I want to go back to the previous page

What you want is currently not working:
Currently if you hit the back button, the popover will stay and only the page in the background will go back. That’s leading into a situation where you move back from page B to page A but the popover from page B is still visible on page A. From my point of view totally confusion for the enduser

There are already two perfectly instinctive and functional ways to close the options popup, the cancel link and clicking anywhere on the background.

That’s maybe working fine if you have a short list of options.
If you use the popover e.g. for changing TV channel and you have more options then what will fit to the screen you have A) no free space on the screen to click somewhere else and B) the cancel link is not visible and you need to scroll to the end of the list to find it

I am, as always, just one voice.

Yes, even we have different point of view I do appreciate your feedback and your input

That’s a very good point. I don’t have any popups that are that long. The f7 popups do have a way to enable swipe-to-close as well, I don’t think this is on by default for the OH popups, but you might be able to find a way to enable it for the long ones (or build your own options popup that includes this feature). There may also be a way to make the cancel link sticky so that it’s always on the bottom of the popup.