openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
914 stars 422 forks source link

Allow configuration of popups #4308

Open mueller-ma opened 2 months ago

mueller-ma commented 2 months ago

Is your feature request related to a problem? Please describe.

Sometimes I want a subpage in a Sitemap that only contains a few elements. In that case I'd like to be able to configure this subpage as popup as popups can be closed faster, e.g. by clicking anywhere outside the popup.

Example: In the page "Living Room" there's one one-line entry "TV" that opens a subpage with a Buttongrid containing a remote control. I don't want to add the remote control to the Living room page directly as it requires some space and is rarely used.

Describe the solution you'd like

Add a new property subpage that controls the type of the subpage: subpage (default) or popup. It can be added to all widgets that have subpages:

Text label="TV" subpage="popup" {
  Buttongrid buttons=[...]
}
Group item=MyLightsGroup subpage="popup" 

Clients are free to implement this popup as popup or use bottom sheets as I would do on Android (https://m3.material.io/components/bottom-sheets/overview).

I'm not sure about the best name for that property.

Coordination between maintainers

Notify maintainers of other UIs: @openhab/webui-maintainers @openhab/android-maintainers @openhab/ios-maintainers

Checklist for implementation:

lolodomo commented 2 months ago

If I think for WEB clients, one question is: what size for the popup ? And what if the page in the popup has itself sub-pages ?

mueller-ma commented 2 months ago

what size for the popup ?

It should be smaller than the display width, so maybe one column less than the remain UI (but at least one, of course)?

And what if the page in the popup has itself sub-pages ?

Popups must not have any other popups or subpages. IMO that wouldn't be a good user experience.

lolodomo commented 2 months ago

Popups must not have any other popups or subpages. IMO that wouldn't be a good user experience.

I agree with you but how do you garantee that ? By adding a complex control when loading the sitemap ?

mueller-ma commented 2 months ago

Can this checked by the Sitemap validator? The thing that refuses loading Sitemap files with invalid syntax.

lolodomo commented 2 months ago

Can this checked by the Sitemap validator?

Yes, very probably but I am not sure that the check is easy to implement.

mueller-ma commented 2 months ago

Naming suggestion for the property: Group item=MyLightsGroup layout="popup"