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

Remove the overflow rule on widgets #715

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

fcollonval
Copy link
Member

This removes the overflow: hidden CSS rule on widget.

The rationale behind this change is that

  • this is highly unexpected in the web
  • it is very hard to work around as widget are nested within widgets that a app plugin does not control

It breaks the ability to have sub items overflow for example one having custom list picker or context menus in cell outputs.

@fcollonval fcollonval added the bug Something isn't working label Aug 1, 2024
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Applying this leads to a couple of subtle visual regressions in JupyterLab (these are just things I noticed immediately, there are probably more)

Before After
Screenshot from 2024-08-02 10-35-04 Screenshot from 2024-08-02 10-35-09

Resizing the sidebar panels with accordion gets jumpy:

jitter-on-resize-down
jitter

Would it still work if we made the change here but restored this rule in JupyterLab codebase?

@fcollonval
Copy link
Member Author

Thanks for the review @krassowski
This is highly surprising. I definitely need to look at that.

Would it still work if we made the change here but restored this rule in JupyterLab codebase?

Do you mean restoring it where we see changes or overall?

@krassowski
Copy link
Member

Do you mean restoring it where we see changes or overall?

I was thinking about something more general like .jp-ThemedContainer .lm-Widget { overflow: hidden } but I do not quite follow what use case you are trying to solve here so not sure if that PR would be still useful for you then

@fcollonval
Copy link
Member Author

I do not quite follow what use case you are trying to solve here so not sure if that PR would be still useful for you then

Unfortunately that will indeed make this PR not useful. The main issue is when integrating a library that does not support mechanism like react portal to attach out of the flow elements outside of the local dom tree.

@fcollonval
Copy link
Member Author

That can be fixed by removing the following rule in JupyterLab:

.jp-SidePanel {
    /* overflow-y: auto; */
}

I saw also it will require some changes in the filebrowser styling:

.jp-FileBrowser .jp-SidePanel-content {
    overflow: hidden;
}

.jp-FileBrowser-Panel {
    overflow: hidden;
}

.jp-DirListing {
    overflow: hidden;
}

Do you think this would be acceptable?

@krassowski
Copy link
Member

These would be good, but I guess we should also test with as many extensions as possible to see what else might be affected.

What about more granular scoping .jp-MainAreaWidget .lm-Widget { overflow: hidden } and similar? I do not insist that we need this in the future, just trying to think of ways to make this change as non-breaking for extension authors as possible.

@fcollonval
Copy link
Member Author

These would be good, but I guess we should also test with as many extensions as possible to see what else might be affected.

👍

What about more granular scoping .jp-MainAreaWidget .lm-Widget { overflow: hidden } and similar? I do not insist that we need this in the future, just trying to think of ways to make this change as non-breaking for extension authors as possible.

We could add something like that - it could indeed mitigate issues.

@fcollonval
Copy link
Member Author

fcollonval commented Aug 13, 2024

@krassowski

I tried a couple of extensions1 and did not see regressions:

image

Footnotes

  1. ipywidgets jupyterlab-git jupyterlab-lsp jupyterlab-geojson jupyterlab-kernelspy jupyterlab-github lckr_jupyterlab_variableinspector jupyterlab-unfold jupyterlab-spreadsheet-editor jupyterlab-search-replace

@fcollonval
Copy link
Member Author

if it is ok for you - I can merge and release lumino to open a PR on Lab

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

LGTM with the caveat that this needs more testing downstream and if we find any breakages which cannot be fixed before 4.3 is out we would want to (temporarily) revert this (possibly on lab side).

@fcollonval
Copy link
Member Author

this needs more testing downstream and if we find any breakages which cannot be fixed before 4.3 is out we would want to (temporarily) revert this (possibly on lab side).

I agree with you - and yes it will be better to revert it only on lab if required.

@fcollonval fcollonval merged commit dc34a33 into jupyterlab:main Aug 13, 2024
19 checks passed
@fcollonval fcollonval deleted the fix/default-widget-style branch August 13, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants