Skip to content

Change prompt cell position for the NumPy REPL (do not merge) #872

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agriyakhetarpal
Copy link
Contributor

Brief description of what is fixed or changed

This PR changes the prompt cell position for the NumPy REPL from the default (bottom) to left. This is, at the moment, not intended to be merged, as it is solely for trying out the new feature that was introduced the recent JupyterLite 0.6 release. Here is a visual diff:

Scenario Before After
With the default import numpy as np snippet numpy org_ numpy org_ (1)
The example snippet is executed numpy org_ (2) numpy org_ (3)

This might currently remain blocked until jupyterlab/jupyterlab#17597 is resolved (I previously attempted to fix this in JupyterLite, but I was later prompted to the fact that the fix lies in JupyterLab instead). I would be on the fence here personally, as both of the layouts look fine to me. However, if the line length in a code snippet is long, say, >70 characters, some of them might get hidden until the layout is expanded manually.

A follow-up item could be to introduce a width/ratio element (for the left or the right positions) which could control the initial state of the prompt cell panel's and the output side panel's widths – it's currently split 50-50 between both but I could see a use case for a 40-60 or 30-70 split (or vice versa).

cc: @jtpio

Closes gh-869

Copy link

netlify bot commented Jun 23, 2025

Deploy Preview for numpy-org ready!

Name Link
🔨 Latest commit 3d7e765
🔍 Latest deploy log https://app.netlify.com/projects/numpy-org/deploys/68598121f350b80008008005
😎 Deploy Preview https://deploy-preview-872--numpy-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jtpio
Copy link
Contributor

jtpio commented Jun 23, 2025

Thanks @agriyakhetarpal!

Wondering if the example code could even be directly part of the input cell directly, using the left prompt cell position:

image

That way the dedicated code panel could even be removed.

Not sure if this would be better for users wanting to try numpy, since copy pasting may be a good way to better understand what each line does. But sharing this just as another option to consider.

@agriyakhetarpal
Copy link
Contributor Author

I agree! The instructions in the dedicated code panel could also be moved above the REPL and below the "Use the interactive shell [...]" text, instead of being in that code snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Change the position of the prompt cell for the JupyterLite REPL?
2 participants