-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add support for showing the file size in the File Browser #14044
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
Conversation
|
Thanks for making a pull request to jupyterlab! |
| node.appendChild(name); | ||
| node.appendChild(narrow); | ||
| node.appendChild(modified); | ||
| node.appendChild(fileSize); |
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.
🤔 performance-wise the approach taken by checkboxes seems better, maintenance-wise the simpler the better. Any benefit of not rendering these will only slightly increase the maximal bearable size of the directory before it starts lagging and we could save much more by lazy-rendering and using content-visibility CSS - so I think it is fine to proceed as is.
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.
Right, while working on this it looked like the file browser could benefit from some refactoring especially in how the hidden columns are handled.
Since I'm not sure we will want to add more columns in the near future I would also say it's fine to leave it as is for now to not delay the merge before the 4.0 feature freeze.
We can open an issue to track further improvements, which could happen during the beta and rc cycles if time permits.
|
CI is now passing, marking as ready for review. |
a313bf9 to
3603574
Compare
|
Rebasing so it can be tested in Binder now that #14038 is merged. |
fcollonval
left a comment
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.
Thanks
Benchmark reportThe execution time (in milliseconds) are grouped by test file, test type and browser. The mean relative comparison is computed with 95% confidence. Results table
Changes are computed with expected as reference.
Waiting for localhost:8888 Cell memory leaksCreate a code cellMemory change: +145 kB Leak detected: YesLeaking objects:
Leaking collections:
Create a markdown cellMemory change: +179 kB Leak detected: YesLeaking objects:
Leaking collections:
Create a raw cellMemory change: +141 kB Leak detected: YesLeaking objects:
Leaking collections:
File editor memory leaksCreate a fileMemory change: -81.1 kB Leak detected: NoLeaking objects:
Leaking collections:
Notebook memory leaksCreate a notebookMemory change: +25.7 kB Leak detected: YesLeaking objects:
Leaking collections:
3 passing (6m) |
krassowski
left a comment
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.
One minor small style suggestion.
Is it worth adding a galata test with chekboxes and file sizes shown? I am not 100% sure but I think we do not have it under test. It could reuse this snippet
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
I am also not sure, because this PR adds a couple of styling rules for the file size column.
Maybe we can try adding a click on "Show File Size Column" in the same test. |
Pushed 49d2257, maybe it's enough for now if the UI tests pass. We could also track adding a visual regression test (but that could be done separately). |
|
OK CI is now passing. |
krassowski
left a comment
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.
Thank you!

References
Fixes #14042
Code changes
Follow the same logic as for the last modified column.
A follow-up would be to make the handling of hidden columns more generic but that might require extra refactoring work and delay delivering this feature before 4.0.
Binstead ofBytesfor consistencyUser-facing changes
Users will be able to show the file size column (opt-in):
file-size-column.mp4
Downstream applications like Notebook 7 can then enable the column by default: jupyter/notebook#6397
Backwards-incompatible changes
None