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
Attempt removing use of flexbox in the notebook DOM #11508
Conversation
Thanks for making a pull request to jupyterlab! |
1e3f104
to
7170a9a
Compare
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.
please run benchmark
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. |
Thanks @SylvainCorlay for opening the PR. Some of the failing UI tests look relevant (caret not vertically centered): |
This impact the mobile styles. It would be good to add UI tests for that to check we are doing ok. |
Yes, it seems there is already an issue with 3.2.4 and the mobile styling: #11516 |
The test failure is due to the fact that I use the "inline-block" display to mimick the horizontal flex box instead of an horizontal table, and then a zero font size. I think this is not the right approach. Using |
I made the following diagrams of the DOM structure (happy to contribute them to the docs). Currently, horizontal flexboxes are use for
However, in the nbconvert case, there is not collapser, so the only flexboxes are inputArea and outputArea-child, so we could start there. Here with the flexboxes in yellow: |
7170a9a
to
04ae106
Compare
04ae106
to
91011ba
Compare
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.
please run benchmark
91011ba
to
dcd60fe
Compare
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.
please run benchmark
dcd60fe
to
f635108
Compare
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.
please run benchmark
Visual regression tests are passing. |
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 @SylvainCorlay
It could be interesting to have that diagram in this section of the docs for example: https://jupyterlab.readthedocs.io/en/stable/extension/notebook.html Although it might become outdated at some point. In that case we could mention "as of JupyterLab 3.2.x" or "4.0.0" depending on where this lands. |
Hi, hope you don't mind me dropping in on this thread out of the blue. I leave the following remarks only in a spirit of spreading knowledge, raising awareness, and asking questions; I am not requesting any changes or making recommendations. I heard about this PR in today's JupyterLab team meeting, and it raised a red flag in my mind, because as a general rule of thumb, the CSS tl;dr-- display:table is probably not an accessibility issue in this PR but please be careful when applying display properties in a non-standard way. That said, I can't help but wonder if display:table is an anti-pattern, though perhaps a desirable and/or necessary one for the :) |
Quite the contrary. Many thanks for your feedback.
I have the exact same thought. There is a companion PR in nbconvert jupyter/nbconvert#1679 that overrides the CSS but I would rather have as little as possible in the |
This PR has introduced two significant regressions: |
This will also make it possible to make use of
break-inside: avoid
CSS media properties for nbconvert webpdf exports.Besides, it may also improce rendering performances of notebooks.