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

Better Addon details #719

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

archef2000
Copy link
Contributor

Hide Addon size if it is "0.0 B".
And hide "v" if it is alphabetic like "dev" or "alpha".

Hide Addon size if it is "0.0 B".
And hide "v" if it is alphabetic like "dev" or "alpha".
Copy link
Contributor Author

@archef2000 archef2000 left a comment

Choose a reason for hiding this comment

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

Correction of space

@sabeechen
Copy link
Owner

I think the UI should till say something if the addon is 0 bytes, if it doesn't say anything users will be confused or assume the size is unknown. Though I agree that "0.0 B" isn't very pretty, I think it might be better to have this method return "0 bytes" just to make it clear. That method is where the size gets formatted for the UI.
<sidenote>
Its a little misleading because Home Assistant reports the size of an addon in MB to two significant digits, so if an addon is less than 0.01 MB then it reports its size as "0.00" even if its something like 9 kb. Thats always bothered me but there is no getting around it, c'est la vie
</sidenote>

I suspect the handling with NaN in your javascript doesn't produce the behavior you're aiming for. size is always a string like "0.0 B" or "1.7 GB", so isNaN(size) is always false because of the SI identifier at the end. Version is often a multi-decimal point number string like "0.100.3", so isNaN would return true for that as well. It would probably be best just to not include "v" in front of the version string at all. Context should make it clear enough that its the version number/identifier without it. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants