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

Items icons not displayed in all pages #1839

Closed
lolodomo opened this issue Apr 12, 2023 · 5 comments · Fixed by #1849
Closed

Items icons not displayed in all pages #1839

lolodomo opened this issue Apr 12, 2023 · 5 comments · Fixed by #1849
Assignees
Labels
bug Something isn't working main ui Main UI

Comments

@lolodomo
Copy link
Contributor

lolodomo commented Apr 12, 2023

The problem

The syntax for item icon has been extended in core framework with PR openhab/openhab-core#3539.

The icon value can now contain until 3 segments separated by a colon (":").
First segment is the icon source. Example: oh, if, iconify, material, f7, ...
Second segment is the icon set. Example: classic
Third segment is the icon name (and can contain hyphen). Example: temperature
In case only two segments are provided, the first segment is the icon source and the second the icon name. "classic" icon set is assumed.
In case only one segment is provided, the icon source is assumed to be the openHAB server and its classic icon set and the value is then the icon name.

MainUI already supports this new syntax in certain pages but not all.

Here are examples of item icon values that should work everywhere in MainUI:

  1. temperature
  2. oh:humidity
  3. oh:classic:pressure
  4. material:arrow_drop_down
  5. material:favorite
  6. iconify:wi:day-sunny-overcast
  7. if:wi:day-thunderstorm

Only "temperature" icon is displayed in the equipment tab of MainUI (opening the "Web services" pop-up). The others should be displayed too.
image

Icon "oh:classic:pressure" is shown nowhere, neither in the items page, nor the item page, nor the edit item page and nor the model page.

Icon "material:favorite" is not shown in the item page (but OK in the items page, the edit item page and the model page):
image

Icons "iconify:wi:day-sunny-overcast" and "if:wi:day-thunderstorm" are not shown in the item page (but OK in the items page, the edit item page and the model page):
image

Expected behavior

MainUI should support the new icon syntax with 3 possible segments in all places.
It includes:

  1. the support of "oh:classic:value" as icon value
  2. the display of the icon in the item page for iconify and material icons
  3. the display of the icon in the equipment tab when an icon source is part of the icon value

Steps to reproduce

Here are example items I used for my tests:

Group GTest2 "Test items group 2" [ "WebService" ]

Number:Temperature CurrentTemp2 "Current Temp [%.1f °C]" <temperature> (GTest2) [ "Measurement", "Temperature" ]
Number CurrentHumidity2 "Humidity [%.0f %%]" <oh:humidity> (GTest2) [ "Measurement", "Humidity" ]
Number CurrentPressure2 "Pressure [%.0f hPa]" <oh:classic:pressure> (GTest2) [ "Measurement", "Pressure" ]
String CurrentPressureTrend2 "Pressure Trend [%s]" <material:arrow_drop_down> (GTest2) [ "Measurement", "Pressure" ]
Number:Temperature SetpointTemp2 "Setpoint Temp [%.1f °C]" <iconify:wi:day-sunny-overcast> (GTest2) [ "Setpoint", "Temperature" ]
Number:Temperature SetpointTemp3 "Setpoint Temp [%.1f °C]" <if:wi:day-thunderstorm> (GTest2) [ "Setpoint", "Temperature" ]
String TestString2 "Test string [%s]" <material:favorite> (GTest2) [ "Status" ]

Browser console

Browser network traffic

@lolodomo lolodomo added bug Something isn't working main ui Main UI labels Apr 12, 2023
@lolodomo lolodomo changed the title Items icons not dispàlayed in all pages Items icons not displayed in all pages Apr 12, 2023
@lolodomo
Copy link
Contributor Author

lolodomo commented Apr 15, 2023

Here is a capture of network traffic when opening the equipment tab containing my items.
We can see that there is no particular handling of icon values, they are passed to the OH icon server directly without considering the icon source and without considering the icon set:
image

It is apparently just not yet implemented at this place.

@lolodomo
Copy link
Contributor Author

lolodomo commented Apr 15, 2023

In the admin pages (list of items, item page or edit item page), the problem is different, it is the icon set that it is not handled at all. Here is when the icon is "oh:classic:pressure":
image

The icon source ("oh") is correctly removed but the icon set is not extracted and not provided to the request through the iconset parameter.

@lolodomo
Copy link
Contributor Author

Regarding the item page when the icon source is material or iconify, I don't see any call to the OH icon server so I guess that it is properly detected a non OH icon source but the icon is not displayed. Probably something not properly handled in that specific page.

@lolodomo
Copy link
Contributor Author

This is a little my fault, I was convinced that icon source was already fully supported by Main UI, I now understand it is probably only partially supported, meaning only at certain places.
I hope it can be easily enhanced to get a full support.

@lolodomo
Copy link
Contributor Author

I can also mention the problems are the same in the property tab as in the equipment tab.
Not tested the Location tab but I guess it should be the same.

@florian-h05 florian-h05 self-assigned this Apr 18, 2023
@ghys ghys closed this as completed in #1849 May 2, 2023
ghys pushed a commit that referenced this issue May 2, 2023
Fixes #1839.
Fixes #574.
Closes #1860.

* Fixes Item icon styling on the Item detail page.
* Add support for openHAB iconsets.
* Fix `oh:` icons not properly displayed in `default-list-item.vue`.
* Refactor `oh-icon` config & style binding.
* Enable real-time state on the semantic model page.
* Enable state for the channel link edit page.
* Enable dynamic icons in the settings where missing and possible
(semantic model page, channel link edit page, Item edit page when
setting category, Items list page).
* Enable dynamic icons in the default list widget for most Items except
some and update the docs accordingly.
* Add a refresh button to the Item list page.

--
Signed-off-by: Florian Hotze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants