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

Allow model cards and model tabs outside of homepage #2584

Merged

Conversation

wuschi
Copy link
Contributor

@wuschi wuschi commented May 23, 2024

Fixes #2583. Fixes #1591.

This moves model loading code to a new Vuex store module named model.
Model loading is now done by app.vue on init and when an Item change event is received through SSE.

home.vue and home-edit.vue now get the model from the Vuex store instead of loading it.
Add tab components for locations-tab, equipment-tab and properties-tab for easy usage in tabbed pages.
Add card components for oh-.location-card, oh-equipment-card and oh-property-card to standard widget list.

@wuschi wuschi requested a review from a team as a code owner May 23, 2024 11:51
Copy link

relativeci bot commented May 23, 2024

#2175 Bundle Size — 10.79MiB (~-0.01%).

3159c18(current) vs 3afef19 main#2172(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 8 changes Regression 2 regressions Improvement 1 improvement
                 Current
#2175
     Baseline
#2172
Regression  Initial JS 1.89MiB(+0.53%) 1.88MiB
Regression  Initial CSS 608.01KiB(+0.02%) 607.91KiB
Change  Cache Invalidation 24.49% 18.1%
Change  Chunks 226(+1.35%) 223
Change  Assets 249(+1.22%) 246
Change  Modules 2907(+0.62%) 2889
Improvement  Duplicate Modules 149(-0.67%) 150
Change  Duplicate Code 1.81%(-2.16%) 1.85%
No change  Packages 97 97
No change  Duplicate Packages 2 2
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#2175
     Baseline
#2172
Improvement  JS 8.97MiB (~-0.01%) 8.97MiB
Regression  CSS 892.57KiB (+0.01%) 892.47KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 140.74KiB 140.74KiB
No change  HTML 1.24KiB 1.24KiB
No change  Other 871B 871B

Bundle analysis reportBranch wuschi:2583-allow-model-cards-ou...Project dashboard


Generated by RelativeCIDocumentationReport issue

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels May 31, 2024
wuschi added 4 commits August 12, 2024 12:04
- Move model code from homecards-mixin.vue into model.js.
- Modify model loading / buildPathInModel to avoid circular references in parent and modelPath
- call loadSemanticModel after loadSemantics in app.vue
- replace calls to loadModel() with calls to loadSemanticModel in home.vue and home-edit.vue

Signed-off-by: Thomas Wunschel <4302898+wuschi@users.noreply.github.com>
- do not pass model as property anymore in home.vue / home-edit.vue
- add tab components for locations-tab / equipment-tab / properties-tab to avoid having to pass type parameter directly to model-tab
- allow oh-locations-tab / oh-equipment-tab / oh-properties-tab in yaml of page-vuew.vue

Signed-off-by: Thomas Wunschel <4302898+wuschi@users.noreply.github.com>
…dard widget list

- Add "scoped" to location-card / equipment-card / property-card style definition
- Add item parameter to widget definitions of oh-location-card / oh-equipment-card / oh-property-card

Signed-off-by: Thomas Wunschel <4302898+wuschi@users.noreply.github.com>
Signed-off-by: Thomas Wunschel <4302898+wuschi@users.noreply.github.com>
@florian-h05 florian-h05 force-pushed the 2583-allow-model-cards-outside-homepage branch from 05768a6 to c3f33aa Compare August 12, 2024 10:04
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
…definitions

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

In general LGTM, thanks you very much for this nice enhancement!

I have a few comments that I have taken care of myself, nothing functional but only technical stuff.

@florian-h05 florian-h05 added this to the 4.3 milestone Aug 12, 2024
…m event

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 merged commit 94aa16a into openhab:main Aug 12, 2024
8 checks passed
florian-h05 added a commit that referenced this pull request Dec 28, 2024
Related to #2584 and
openhab/openhab-core#4466.

This avoids that the global SSE connection is always established, and
therefore reduces problems with the max parallel HTTP connections
limitation. The global SSE connection is now only established if the web
audio sink or the command Item are enabled.

Whilst this change potentially makes the UI not reload the model
automatically on change, practically the now removed mechanism might
haven't been really useful at all because the model is already reloaded
on Main UI start, and if SSE was not connected the moment an Item
changed the mechanism did not trigger.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
florian-h05 added a commit that referenced this pull request Dec 28, 2024
Related to #2584 and
openhab/openhab-core#4466.

This avoids that the global SSE connection is always established, and
therefore reduces problems with the max parallel HTTP connections
limitation. The global SSE connection is now only established if the web
audio sink or the command Item are enabled.

Whilst this change potentially makes the UI not reload the model
automatically on change, practically the now removed mechanism might
haven't been really useful at all because the model is already reloaded
on Main UI start, and if SSE was not connected the moment an Item
changed the mechanism did not trigger.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
(cherry picked from commit 5d7f35a)
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.

Allow usage of model cards and model tabs outside of home page Allow navigation to location cards
2 participants