-
Notifications
You must be signed in to change notification settings - Fork 953
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
feat(web): unify unit formatting #6978
feat(web): unify unit formatting #6978
Conversation
I would like to hear your thoughts on the number of digits we should use and if we want to do it this way or if you can think of a better way to do it? |
Hmm, that's a lot of decimals in some places. Which might be fine information wise but have we checked that it won't break the UI on smaller devices in particular? And I'm wondering if it won't be harder to understand for most if there is a bunch of zeros in there? If the plan is to unify all the units it doesn't make much sense if part of the tooltip is in GW and the other parts are in MW. I'm also just curious why you decided that the function should take an object as the argument. Nothing against it just curious about the reasoning here 🙂 |
I did that so that both the |
Yes, we should check this. I haven't done that yet.
I guess that based on the feedback that we have gotten, the assumption is that it easier to compare two numbers if they are using the same unit, than comparing two numbers that use different units. And if there is a bunch of zeros then it is also easier to see that this number is really small compared to the total, which might be fine I think |
I think that is fine. I don't think the plan is to unify all the units, just to compare apples with apples, if that makes sense:) |
I would say that for this edge case it's not really worth it to invest more effort for custom logic. Where I do see some value though is, in case the capacity is not reported (I assume that's why it's 0) we should somehow explain why, but this is more of a UX task and unrelated to this PR. 😅 Same thing in case the reported capacity is lower than production. |
@VIKTORVAV99 and @tonypls, I just want to make sure that you did not forget about this PR 😄 |
We already discussed this further up ☝️ and decided that this edge case wasn't worth the extra logic that it would require. Do you think it is worth it? |
@tonypls Can I get this reviewed 🙏 |
/review |
PR Reviewer Guide 🔍
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! While reviewing and I had context I decided to add in the check to show a "?" if the tooltip capacity is missing. Please review my code, merge if you're happy or @ me if I need to improve it!
Your changes looked good to me. I made some small changes based on Githubs review:) |
Issue
AVO-255
Description
This PR unifies the unit formatting so that it uses the same unit when displaying a value and the total value.
Preview
Old:
New:
Old:
New:
Double check
poetry run test_parser "zone_key"
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.