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

Adding file size to File browser hover #7485

Merged
merged 3 commits into from Nov 10, 2019

Conversation

macwoj
Copy link

@macwoj macwoj commented Nov 6, 2019

References

Fixes #7352

Code changes

added size field to the Contents.IModel
added more file context to title in updateItemNode (filebrowser/src/listing.ts)

User-facing changes

Hover in file vrowser will now show.

Name:
Size: If available the human readable file size with a single decimal.
Path: only the directory limited to 50
Created: YYYY-MM-DD HH:mm:ss
Modified: YYYY-MM-DD HH:mm:ss

Backwards-incompatible changes

added new field which is optional so no backwards compatibility issues.

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@@ -1833,8 +1833,13 @@ export namespace DirListing {
// clean up the svg icon annotation, if any
delete icon.dataset.icon;
}
// add file size to pop up if its available
if (model.size !== null && model.size !== undefined) {
node.title = model.name + ' - ' + Private.formatFileSize(model.size, 1);
Copy link
Member

@blink1073 blink1073 Nov 7, 2019

Choose a reason for hiding this comment

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

Thanks for adding this! I think it looks too sparse without adding more info. I think we should show the following:

Name: foo.bar
Size: as you have it
Path: path limited to 50 chars with an ellipsis if longer
Created: Formatted using Time.format.
Modified: Same as above

Similar to what Finder shows on MacOS about a file:

image

Copy link
Member

Choose a reason for hiding this comment

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

And just not show the size part if we don't have it.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah that looks better. Let me fix it.

@blink1073
Copy link
Member

Perfect, thanks again @macwoj!

@blink1073 blink1073 merged commit 2eca1c6 into jupyterlab:master Nov 10, 2019
@macwoj macwoj deleted the feature/addfilesize branch November 11, 2019 02:26
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Dec 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement pkg:filebrowser status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show file-size in File browser
2 participants