-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Implement resizing for the file browser #16646
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! |
This change: - reduces visual diff - allows more space for the name/modified/size columns when checkboxes are shown as there is less space taken up by the resize handle for a column which always presents a very narrow checkbox and thus does not really benefit from resizing
but all columns have sizes even they are not resizable.
d65bb9f to
829bc59
Compare
2ea1d74 to
7748235
Compare
| } else if (showFileCheckboxes && !checkboxWrapper) { | ||
| const checkboxWrapper = this.createCheckboxWrapperNode(); | ||
| node.insertBefore(checkboxWrapper, iconContainer); | ||
| nameColumn.insertAdjacentElement('beforebegin', checkboxWrapper); |
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.
Switching to insertAdjacentElement is nice.
afshin
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, @krassowski! I made one minor comment.
Co-authored-by: Afshin Taylor Darian <git@darian.link>
80f9eee to
8c2db7c
Compare
* Implement resizing for file browser * Fine tune pixels, expand docs * Do not add a resize handle for checkboxes column This change: - reduces visual diff - allows more space for the name/modified/size columns when checkboxes are shown as there is less space taken up by the resize handle for a column which always presents a very narrow checkbox and thus does not really benefit from resizing * Fix column sorting * Fix typing on sizing: `is_selected` is no resizable, but all columns have sizes even they are not resizable. * Add missing freeze filter for custom css snapshot test * Update snapshots * Remove prefix underscore from protected attribute Co-authored-by: Afshin Taylor Darian <git@darian.link> --------- Co-authored-by: Afshin Taylor Darian <git@darian.link>


References
Code changes
FileBrowserandDirListingwidgets now accept optionalstate?: IStateDBoption which allows the listing to restore the size of columns; this follows the pattern already used in theFileBrowserModelDirListing.IRenderergets a new optionalupdateItemSize?(...): voidmethod which is a fast path to refresh the widths in the listing without updating other elementsDirListing.IRenderer.updateItemModified()will now check if there is any work to be done to avoid costlyformat()callsUser-facing changes
Backwards-incompatible changes
None