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

Jupyter notebook cell code folding and output view expanding request #1629

Closed
matthewgson opened this issue Mar 21, 2020 · 16 comments
Closed

Comments

@matthewgson
Copy link

Feature: Notebook Editor, Interactive Window, Python Editor cells

Description

This feature request is similar to microsoft/vscode-python#10503. I hope vscode jupyter notebook may allow the code cell to be folded as in .py code editor in VScode, and fold the output panel as in Jupyterlab (this is done when a user clicks left margin of the cell). It would be great if it adds an option to show code line number within the cell, but maybe it is not crucial.
image

On the other hand, output panel is forced to be viewed through scrolling if it is too big. I hoping that there's an option (possibly by right-click) to expand the output so that users can view the whole output handy.

image

Also a minor fix:
Please replace file icon on the tab to Jupyter icon.
(Edit : I'm currently using vscode-icons package from vscode teams. The icon disappears when it renders .ipynb)
image

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

@DavidKutu
Copy link

Thanks for the feedback @matthewgson . We'll discuss this on our next triage.

@deepaksood619
Copy link

Along with Code Folding can we have scroll for large number of rows i.e. Output Folding.
If required I can create a new issue for the same, if it doesn't fit here.

Ex - When pd.options.display.max_rows = None is enabled, there is large number of rows as output printed. The rows should be inside a bound box and a separate scroll for them would be helpful.

Current behavior:
Screenshot 2020-04-13 at 12 53 54 AM

Desired behavior - All output inside a box/window with separate scroll
Screenshot 2020-04-13 at 12 56 23 AM

@dusty-phillips
Copy link

dusty-phillips commented May 15, 2020

@deepaksood619 this feature theoretically already exists (see vscode settings Data Science: Enable Scrolling For Cel Outputs and Data Science: Max Output Size but it doesn't seem to be working. See also https://github.com/microsoft/vscode-python/issues/8010 which claims it is fixed.

@3rock618
Copy link

'VSCode Great Icons' has a .ipynb icon for the explorer. The ico they are using is https://jupyter.org/favicon.ico. But for some reason it doesn't work in the editor tab.

@williamcaicedo
Copy link

Hi, any new developments on the expandable outputs issue? IMO that is one of the most useful features of Jupyter Notebooks/ Jupyter Lab, especially when showing plots.

@DavidKutu
Copy link

Hey everyone, this feature is available on our revamped notebooks preview. You can try it out here: https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@peter-ch
Copy link

That page says nothing about code folding. How do I use it?

@IanMatthewHuff
Copy link
Member

@peter-ch in the new notebook interface there are commands and keybindings to collapse both the input and output sections of any cells. Is that what you are looking for? Example of a collapsed code section (with expand icon) shown below.
image

@peter-ch
Copy link

I'm looking for the functionality to collapse code blocks. I can see on this page that it is present https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/
but when I open a notebook I don't see those little buttons to collapse anything, they're just not there. Is there an option to turn this on? Do I use the "old" notebook interface for some reason and how do I turn the new on? Thanks.

@IanMatthewHuff
Copy link
Member

@peter-ch If you are using VS Code - Insiders you should get the now notebook interface by default. In that interface I don't believe that there are actually buttons to do the collapse. There is instead a keybinding and a vscode command to collapse them. The button to expand back out only shows up after collapsing them.

@peter-ch
Copy link

Yes, thanks, I just realized I wasn't using the insiders build. It works.

@Bakerbakura
Copy link

Is there any info on when the new notebook interface will be pushed to the main VS Code build?

@jiajia20
Copy link

jiajia20 commented Apr 9, 2021

This is amazing! Thanks for making JupyterNotebook cell and their input/output Collapseable.

@pbower
Copy link

pbower commented Apr 29, 2021

This is awesome. When is it being added to the main build?
It would be great if there were a 'expand/collapse all cells' option up the top to keep things neat and tidy.

@DavidKutu
Copy link

We're working hard on that right now!

Unfortunately we don't have an exact date. I'll add that we are keeping up with this API. When that releases on stable, we'll follow suit as soon as possible.

@IanMatthewHuff
Copy link
Member

Closed as the new Notebook UI is fully released now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests