Run search filter on item list page reinit, fixes #861 #954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Analyzing this I found out that the searchbar search gets overriden by virtual list's
replaceAllItems
and has to be rerun. So, the only required change here actually is:https://github.com/hubsif/openhab-webui/blob/085bc59f5d99b875135c35c60cff04bf1bd61d9f/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue#L151-L154
While analyzing I stumbled across
initSearchbar
and alike, and this:https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue#L168-L175
To me that looked like you were struggling with rendering and loading race conditions.
So, again I did more than required and tried to clean that up. I think the main issue was in the list to be conditionally rendered and thus not available for the searchbar on init:
openhab-webui/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue
Line 54 in f601eb2
I changed that to
v-show
instead and was then able to tidy up quite some.Additionally, I discovered a "flicker" when going back from an item detail to the list: Due to the list only loading at "pageAfterIn", the transition would still show the filtered list and when finished switch to the loading components.
I wondered why you actually only load the page at "page:afterin" instead of e.g. "page:beforeIn"?
Anyways, I found it to be best situated in "page:init" and "page:reinit", I hope I didn't miss anything.