-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: display response size with a bigger unit in tooltip #2425
Conversation
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.
@nicognaW please look into the given remarks and correct accordingly please.
Also, won't it be better if we flip the logic then ? (Show the KB/MB size data first and show bytes on hover) (cc: @liyasthomas)
Thank you for your effort by the way! ❤️
@AndrewBastin Huge thanks for the review and suggestions. I fixed the code mentioned in the remarks and marked them resolved. And actually, the flip logic idea also came to me the moment after I posted the PR, so I am working on it. Please give me some time🙏. |
I changed the logic. Now I'm seeing the result, and I think it'd be better to add another line with KB when MB is presented (the size is larger than 1000). In order to do that, I could only think of using |
…t in the tooltip. In this case, responseSizeHint doesn't represent a hint text but a readable text, so I changed the name.
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.
lgtm 💯
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.
there was a minor typo I just patched. now should be fine. lgtm 💯
Thank you for the PR @nicognaW
OK, thanks for your comment. I'm glad I could help.😆 |
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
Description
The response size is always displayed using larger units like KB or MB in other API testing tools I've used. But hoppscotch shows them up with only a B. I added a tooltip to display the response size in reasonable units.
For responses with a size of 0b to 1000b, the tooltip won't show up. For those with a size of 1000b to 1000000b, kB will be shown. For those larger than 1000000b, mb will be shown.
I am no expert on the front-end technologies, so I just imitated the current codes. If you don't like these codes, please keep the idea even if you close the pr.