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

[JLab v4a17] CodeMirror width is not limited when text overflow #11696

Closed
fcollonval opened this issue Dec 15, 2021 · 10 comments · Fixed by #11814
Closed

[JLab v4a17] CodeMirror width is not limited when text overflow #11696

fcollonval opened this issue Dec 15, 2021 · 10 comments · Fixed by #11814
Labels
bug good first issue tag:CSS For general CSS related issues and pecadilloes
Milestone

Comments

@fcollonval
Copy link
Member

fcollonval commented Dec 15, 2021

Description

As can displayed in the screenshot below, codemirror editor is expanding outside the notebook panel when it contains a long line.
The horizontal scrollbar is displayed on the notebook panel. It used to be a fix width with a local (= at editor level) horizontal scrollbar when text overflow.

image

Reproduce

  1. Open a notebook
  2. Type a very long line (longer that the notebook panel width)
  3. The horizontal scrollbar appears at the bottom of the notebook panel not in the editor.

Expected behavior

Codemirror width is identical and the scrollbar appears at its bottom. Like in 3.2:

image

The changes made in #11508 could be the source of this bug.

Context

  • Operating System and version: Debian 11
  • Browser and version: Firefox 95
  • JupyterLab version: v4 alpha 17
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@fcollonval fcollonval added bug tag:CSS For general CSS related issues and pecadilloes labels Dec 15, 2021
@fcollonval fcollonval added this to the 4.0 milestone Dec 15, 2021
@rfox12
Copy link
Contributor

rfox12 commented Dec 17, 2021

I think Frederic is correct about changes made in #11508. I can't see an easy fix to this; but when I toggle off "display: table" from .jp-InputArea then the cell looks to be the correct width.

@pree-T
Copy link
Contributor

pree-T commented Dec 29, 2021

I want to work on this. Can someone help me a bit with this?

@fcollonval
Copy link
Member Author

Hey @pree-T

I think the change that breaks the style is the following:

image

You could try to set some constrain on the width or max-width to see if you can prevent the cell input growth.

@rfox12
Copy link
Contributor

rfox12 commented Dec 29, 2021

Just a side question here... is there a particular reason JupyterLab is avoiding flex layouts? Seems to be widely supported and working fine for my other front end code...

@fcollonval
Copy link
Member Author

As mentioned in the blamed PR, the reason is to be able to control the break occurring when rendering the notebook for printing.

@pree-T
Copy link
Contributor

pree-T commented Dec 31, 2021

Hey @pree-T

I think the change that breaks the style is the following:

image

You could try to set some constrain on the width or max-width to see if you can prevent the cell input growth.

Thank you ! I just want to ask which ide you all are using for the purpose of development of this as vscode is showing several errors.
ss1

@krassowski
Copy link
Member

@pree-T you need to install dependencies locally if to avoid this error messages (and get more accurate suggestions); this is a shared requirement among all IDE/editors suitable to work with JupyterLab codebase I know of. Please see Setting up a local development environment in contributor documentation.

I will be preparing a Binder hosting an environment ready for JupyterLab development using JupyterLab itself soon.

@pree-T
Copy link
Contributor

pree-T commented Jan 4, 2022

Hey @fcollonval I tried what you suggested but that does not seem to fix this issue. Is there any other fix for this?

@fcollonval
Copy link
Member Author

@pree-T I played a bit with the CSS, and the trick we need is to set table-layout to fixed.

I achieved something that looks not too bad adding:

.jp-InputArea {
  /* ... */
  table-layout: fixed;
  width: 100%;
}

.jp-InputPrompt {
  /* ... */
  width: var(--jp-cell-prompt-width);
}

.jp-InputArea-editor {
  /* ... */
  /* remove width: 100% */
}

if you want to open a PR.

image

The drawback is that for very large execution count, the input prompt may look ugly (but is it sane to have more than thousands cells)

@pree-T
Copy link
Contributor

pree-T commented Jan 8, 2022

I have made a PR for the same. Kindly see to it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug good first issue tag:CSS For general CSS related issues and pecadilloes
Projects
None yet
4 participants