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

OH 4.0 UI changes the sort order of channels #3442

Closed
andrewfg opened this issue Mar 10, 2023 · 5 comments · Fixed by #3448
Closed

OH 4.0 UI changes the sort order of channels #3442

andrewfg opened this issue Mar 10, 2023 · 5 comments · Fixed by #3448
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@andrewfg
Copy link
Contributor

andrewfg commented Mar 10, 2023

Is it just me, or does OH v4.0 now change the sort order of channels in the UI? Previously they would sort according to the order in the thing.xml but now they seem to display in a random order..

<channels>
    <channel id="position" typeId="shade-position"/>
    <channel id="secondary" typeId="shade-position"/>
    <channel id="vane" typeId="shade-vane"/>
    <channel id="lowBattery" typeId="system.low-battery"/>
    <channel id="batteryLevel" typeId="system.battery-level"/>
    <channel id="signalStrength" typeId="system.signal-strength"/>
</channels>

image

@J-N-K
Copy link
Member

J-N-K commented Mar 10, 2023

Yes, that‘s possible. We switched from a List<Channel> to a Map<ChannelUID, Channel> which does not necessarily preserve the order.

@wborn
Copy link
Member

wborn commented Mar 11, 2023

Perhaps the implementation can be switched to a LinkedHashMap to preserve the order?

@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Mar 11, 2023
@andrewfg
Copy link
Contributor Author

Perhaps the implementation can be switched to a LinkedHashMap to preserve the order?

It looks like a one liner change in ThingImpl.java. But maybe there are knock on implications? Shall I open a PR for this?

@wborn
Copy link
Member

wborn commented Mar 11, 2023

I think it would be nice when the original order as intended by maintainers keeps being used. 👍

@andrewfg
Copy link
Contributor Author

Shall I open a PR for this?
I think it would be nice ..

@wborn I will take that as a “yes” :) .. I will open the PR tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants