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

Add-on store: Add connection and country filter #2582

Merged
merged 5 commits into from
May 31, 2024

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented May 20, 2024

Closes #2050

This implements filtering for connection type and country (related to region/country setting) in the addon store.

By default, it will filter for all connection types and filter out addons not supported for a specific country if info on countries is available.

Here is how this looks like on an Android mobile phone (Galaxy S22).

Filters dropdown:
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340

Change connection type to 'No cloud allowed':
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340 (1)

Search for 'amazon' (only one found):
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340 (2)

Switch to 'Cloud allowed' again, search result updated to 2 add-ons:
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340 (3)

Clear search and filter on country 'Specific for country':
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340 (4)

Select bindings tab, only one binding shown:
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340 (5)

Detail of binding shows connection and country detail when available:
bs_realdroid_Mobile_Samsung Galaxy S22-12 0-1080x2340 (6)

I tried this same procedure on Chrome and Firefox (Windows), iPhone 14 (iOS 16) and iPad 9th Gen (iOS 15) and it looks OK on all these.

@mherwege mherwege requested a review from a team as a code owner May 20, 2024 21:40
Copy link

relativeci bot commented May 20, 2024

#1986 Bundle Size — 10.62MiB (+0.03%).

ec75fc2(current) vs 3999dea main#1985(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#1986
     Baseline
#1985
Regression  Initial JS 1.86MiB(+0.02%) 1.86MiB
No change  Initial CSS 607.87KiB 607.87KiB
Change  Cache Invalidation 17.8% 17.72%
No change  Chunks 223 223
No change  Assets 246 246
No change  Modules 2880 2880
No change  Duplicate Modules 149 149
No change  Duplicate Code 1.85% 1.85%
No change  Packages 97 97
No change  Duplicate Packages 2 2
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#1986
     Baseline
#1985
Regression  JS 8.8MiB (+0.03%) 8.8MiB
No change  CSS 890.94KiB 890.94KiB
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 mherwege:addon_filterProject dashboard

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege
Copy link
Contributor Author

@ghys I did some testing on a few devices and browsers, screenshots for a Galaxy S22 above.

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.

Codewise LGTM, thanks!
Just two comments about the type of the smart select and the wording, I really like @ghys and @jlaur suggestions/proposals.

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels May 30, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone May 30, 2024
@florian-h05 florian-h05 changed the title Addon store connection and country filter Addon store: Add connection and country filter May 30, 2024
@florian-h05 florian-h05 changed the title Addon store: Add connection and country filter Add-on store: Add connection and country filter May 30, 2024
@jlaur
Copy link
Contributor

jlaur commented May 31, 2024

Just for completeness, I can think of two queries that will currently not be possible. You probably already thought about it and decided to keep it simple, because they are not common use-cases, but nevertheless:

  • I cannot (out of curiosity) see which add-ons are available specifically for Germany (I'm in Denmark).
  • I cannot (again, out of curiosity) see which add-ons runs purely local, i.e. not even requiring LAN access.

@mherwege
Copy link
Contributor Author

mherwege commented May 31, 2024

  • I cannot (out of curiosity) see which add-ons are available specifically for Germany (I'm in Denmark).

I think ideally that should be something for the website, rather than in the software. It would make filtering in the software more complex. I thought about it, but decided against it.

  • I cannot (again, out of curiosity) see which add-ons runs purely local, i.e. not even requiring LAN access.

Again, thought about it but considered add-ons that require no network access typically of limited use. LAN access would be accepted. However, this is easy enough to add and doesn't make the filtering more complex (4 instead of 3 options for the filter). So I added it.
A binding like ZWave may actually be in this case, where the external devices are not accessed through the LAN but another protocol.

@mherwege
Copy link
Contributor Author

@ghys @florian-h05 @jlaur Thank you all for the feedback. I incorporated it in my last commit.

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.

LGTM now, thanks!

I agree that any "advanced" filtering should be implemented on the website.

@florian-h05 florian-h05 merged commit 5ae3e37 into openhab:main May 31, 2024
8 checks passed
@mherwege mherwege deleted the addon_filter branch May 31, 2024 15:24
florian-h05 pushed a commit that referenced this pull request Jun 2, 2024
Fixes openhab/openhab-core#4266.

Error was introduced by #2582 and manifests itself
when no country was set in the setup wizard or the locale settings.

---------

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
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.

Improve binding selection by filtering (including usage of binding metadata)
4 participants