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 support for SVG add-on logos #2402

Merged
merged 1 commit into from Feb 24, 2024
Merged

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Feb 23, 2024

Currently, Main UI attempts to load all add-on logos as PNG (the add-on logo url is generated using the add-on name and expecting a PNG).

This PR adds support for SVG add-on logos, which means:
The UI will now attempt to load a SVG logo,
if that fails, it will attempt to load a PNG,
and if that fails, fall back to the add-on‘s default logo (which is dependent on the add-on type).

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

relativeci bot commented Feb 23, 2024

Job #1653: Bundle Size — 11.01MiB (-0.01%).

aa74637(current) vs def6eff main#1652(baseline)

Warning

Bundle contains 19 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes
                 Current
Job #1653
     Baseline
Job #1652
No change  Initial JS 1.85MiB 1.85MiB
No change  Initial CSS 607.89KiB 607.89KiB
Change  Cache Invalidation 17.01% 17.59%
No change  Chunks 220 220
No change  Assets 242 242
Change  Modules 3091(+0.1%) 3088
No change  Duplicate Modules 164 164
No change  Duplicate Code 1.77% 1.77%
No change  Packages 150 150
No change  Duplicate Packages 18 18
Bundle size by type  Change 2 changes Improvement 2 improvements
                 Current
Job #1653
     Baseline
Job #1652
Improvement  JS 9.2MiB (-0.01%) 9.2MiB
Improvement  CSS 889.35KiB (-0.01%) 889.44KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.24KiB 1.24KiB
Not changed  Other 871B 871B

View job #1653 reportView florian-h05:addon-logo branch activityView project dashboard

@florian-h05
Copy link
Contributor Author

@stefan-hoehn I have added a description.
BTW I have taken this PR as a chance to refactor the add-on logo to its own component.

Copy link
Contributor

@stefan-hoehn stefan-hoehn left a comment

Choose a reason for hiding this comment

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

I have tested it on final and it retrieves the svgs nicely. Styling looks good and I see nothing that breaks.

@florian-h05 florian-h05 marked this pull request as ready for review February 24, 2024 14:03
@florian-h05 florian-h05 requested a review from a team as a code owner February 24, 2024 14:03
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Feb 24, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone Feb 24, 2024
@florian-h05 florian-h05 merged commit 69f4876 into openhab:main Feb 24, 2024
6 checks passed
@florian-h05 florian-h05 deleted the addon-logo branch February 24, 2024 14:04
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.

None yet

2 participants