Open msanchezst opened 5 months ago
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Quick look: I think that the file manager in jupyter-server
by default returns size in bytes, based on this code referencing st_size
which normally is in bytes.
Then on frontend this is formatted here
Using this function:
Does it make more sense to show MiB vs MB? What do most file browsers show? Real-estate-wise MB is shorter. Should it be configurable?
@krassowski thank you for your quick response! Based on this:
it looks to me that because of the value of 1024
set in the formatFileSize
, the formatted file size is converted to Bi Units (KiB,MiB,GiB), but the labels here are incorrect:
As for what units to display, that's a good question. Mac and Windows file browsers typically use MB. Some Linux file browsers let you change the units. Technically, MiB might be more accurate, but I don't think there is a established standard here. Perhaps making this configurable would be the best approach?
Problem
We have noticed that the file size displayed in the Jupyterlab file browser appears to be using an incorrect unit. The file sizes are reported in MiB but the displayed units are MB,GB, and so on. This is confusing as the actual size is not accurately represented.
Proposed Solution
I would recommend updating the file browser to display the file sizes using the correct units (MiB) to match the actual file sizes reported by the OS.
In the screenshot above, the units displayed in the File Explorer should be MiB
Additional context
Has this issue been evaluated in the past and decided to report the file sizes in this way? If so, I'm curious to understand the reasoning behind that decision.