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

Addons store: Use swiper for addon cards on mobile & Reduce size of addon card on desktop #2216

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Dec 12, 2023

Fixes #2205 and fixes #1668.

This slighly reduces the addon card size on desktop and uses a swiper (like in many app stores) instead of a flex on mobile.

Copy link

relativeci bot commented Dec 12, 2023

#2416 Bundle Size — 10.85MiB (+0.01%).

919f65c(current) vs 331f794 main#2413(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes
                 Current
#2416
     Baseline
#2413
No change  Initial JS 1.9MiB 1.9MiB
No change  Initial CSS 577.21KiB 577.21KiB
Change  Cache Invalidation 17.74% 22.69%
No change  Chunks 226 226
No change  Assets 249 249
Change  Modules 2930(+0.1%) 2927
No change  Duplicate Modules 151 151
No change  Duplicate Code 1.88% 1.88%
No change  Packages 96 96
No change  Duplicate Packages 2 2
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#2416
     Baseline
#2413
Regression  JS 9.06MiB (+0.02%) 9.06MiB
Regression  CSS 864.19KiB (+0.02%) 864.03KiB
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.38KiB 1.38KiB
No change  Other 871B 871B

Bundle analysis reportBranch florian-h05:addon-logo-sizeProject dashboard


Generated by RelativeCIDocumentationReport issue

@florian-h05
Copy link
Contributor Author

This is how it looks (Click me to expand):

image
image
image
image
image

@ghys
Copy link
Member

ghys commented Dec 13, 2023

Thanks, good attempt. Maybe a few remarks here:

image

  • Could you just fix the horizontal gap between cards so that it matches the vertical one?

  • My concerns were firstly that most titles would be truncated (word-wrapping didn't look well), in the above screenshot that's okay because you can guess the truncated word, but in other cases (in the UI tab for instance) it's more difficult. I'm not opposed to a 2-column view for bindings etc. and a single-column view for UI widgets in those cards (with a parameter on the component). But in any case, in the end, the title truncating, well we can live with it. Another idea would be to just not display the "install/remove" button at least when space is too tight, as you can always go to the details and install from there.

  • Lastly I considered the fact that having 3 cards on 2 rows doesn't look too good (you have an empty space), but if we're not limiting the amount of "featured" add-ons to 3 in sections in the future then we can have what you find in "app store"-like UIs - a single line of horizontally-scrollable list of cards/ icons.

image

@florian-h05
Copy link
Contributor Author

Could you just fix the horizontal gap between cards so that it matches the vertical one?

I tried to fix that, while doing that, I noticed that the vertical gap actually was not to large, but there was no horizontal gap left.

My concerns were firstly that most titles would be truncated (word-wrapping didn't look well), in the above screenshot that's okay because you can guess the truncated word, but in other cases (in the UI tab for instance) it's more difficult.

Yes, that's not nice, but I don't have a better idea ...

I'm not opposed to a 2-column view for bindings etc. and a single-column view for UI widgets in those cards (with a parameter on the component).

The problem is, that this is controlled by CSS, so it is not that easy to control it from JS.

Another idea would be to just not display the "install/remove" button at least when space is too tight, as you can always go to the details and install from there.

I have had a look at this, it feels a bit weird to not have the install/remove button for those, but for the list.

Lastly I considered the fact that having 3 cards on 2 rows doesn't look too good (you have an empty space), but if we're not limiting the amount of "featured" add-ons to 3 in sections in the future then we can have what you find in "app store"-like UIs - a single line of horizontally-scrollable list of cards/ icons.

That is a really nice proposal.

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Dec 26, 2023
@florian-h05
Copy link
Contributor Author

@ghys

Could you just fix the horizontal gap between cards so that it matches the vertical one?

Done 👍

Lastly I considered the fact that having 3 cards on 2 rows doesn't look too good (you have an empty space), but if we're not limiting the amount of "featured" add-ons to 3 in sections in the future then we can have what you find in "app store"-like UIs - a single line of horizontally-scrollable list of cards/ icons.

Implemented:

image

@florian-h05 florian-h05 changed the title Addons store: Reduce size of addon card Addons store: Use swiper for addon card on mobile & Reduce size of addon card on desktop Oct 25, 2024
@florian-h05 florian-h05 changed the title Addons store: Use swiper for addon card on mobile & Reduce size of addon card on desktop Addons store: Use swiper for addon card on mobile & Reduce size of addon card on desktop Oct 25, 2024
@florian-h05 florian-h05 added this to the 4.3 milestone Oct 25, 2024
@florian-h05 florian-h05 changed the title Addons store: Use swiper for addon card on mobile & Reduce size of addon card on desktop Addons store: Use swiper for addon cards on mobile & Reduce size of addon card on desktop Oct 25, 2024
@florian-h05 florian-h05 marked this pull request as ready for review October 25, 2024 11:55
@florian-h05
Copy link
Contributor Author

Let’s give it a try 👍
We can always adjust later on — I will merge now.

@florian-h05 florian-h05 merged commit 574c313 into openhab:main Oct 25, 2024
8 checks passed
@florian-h05 florian-h05 deleted the addon-logo-size branch October 25, 2024 11:56
florian-h05 added a commit to florian-h05/openhab-webui that referenced this pull request Oct 25, 2024
florian-h05 added a commit that referenced this pull request Oct 25, 2024
Follow-up for #2216.

- Do not use addon swiper on iPad.
- Revert addon card size changes.
- Show more addon cards in swiper in landscape mode.

---------

Signed-off-by: Florian Hotze <[email protected]>
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.

UI rendering/scaling of logos for suggested add-ons Why so big logo for addons and why different sizes ?
2 participants