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

Location sensitive model tab pages sorting #1281

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

tarag
Copy link
Contributor

@tarag tarag commented Jan 17, 2022

This PR performs the following changes when sorting items displayed in the model tab pages:

  • When sorting 2 locations (Locations tab), sorting is first performed according to the ancestors widgetOrder, so that locations within the same parent appear grouped according to the choice of the administrator, then use the widgetOrder among all locations of the same parent, before finally using lexicographical comparison.

  • When sorting 2 equipment (Equipment tab) or 2 properties (Properties tab), sorting is performed according to the widgetOrder. If undefined (or equal), sorting is performed according to the location (taking into account all ancestors). then only if undefined/equal does lexicographical comparison takes place.

In this situation, location-sensitive sorting is performed before label, this is a change of design but makes more sense IMHO: Let's say you have 12 OpenState properties, 10 "Doors" in various rooms and 1 "Main Door" and 1 "Back Door" in the same room, the status of the 2 doors of the same room will still appear next to each other in the properties page rather than completely spread apart with current design.

Performance measurement on sample installation with 600 items in model yields no measurable difference (using performance.now(), 2.3GHz intel Core i9: average model data processing ~150ms).

- When sorting 2 locations (Locations tab), sorting is first performed according to the ancestors widgetOrder, so that locations within the same parent appear grouped according to the choice of the administrator, then use the widgetOrder among all locations of the same parent, before finally using lexicographical comparison.

- When sorting 2 equipment (Equipment tab) or 2 properties (Properties tab), sorting is performed according to the widgetOrder. If undefined (or equal), sorting is performed according to the location (taking into account all ancestors). then only if undefined does lexicographical comparison takes place.

Signed-off-by: Gautier Taravella <tarag@mailbox.org>
@tarag tarag requested a review from a team as a code owner January 17, 2022 17:38
@relativeci
Copy link

relativeci bot commented Jan 17, 2022

Job #337: Bundle Size — 10.67MB (~+0.01%).

02892d7 vs 651b3c5

Changed metrics (2/8)
Metric Current Baseline
Initial JS 1.67MB(+0.05%) 1.67MB
Cache Invalidation 15.78% 24.06%
Changed assets by type (1/7)
            Current     Baseline
JS 8.62MB (~+0.01%) 8.62MB

View Job #337 report on app.relative-ci.com

Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, a few minor comments below:

Signed-off-by: Gautier Taravella <tarag@mailbox.org>
@ghys ghys merged commit 79d0a8a into openhab:main Jan 21, 2022
@ghys ghys added enhancement New feature or request main ui Main UI labels Jan 21, 2022
@ghys ghys added this to the 3.3 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants