-
Notifications
You must be signed in to change notification settings - Fork 26
Add more REPL customisation features for JupyterLite 0.6.0 (DO NOT MERGE) #290
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
base: main
Are you sure you want to change the base?
Add more REPL customisation features for JupyterLite 0.6.0 (DO NOT MERGE) #290
Conversation
While this PR is titled as such because JupyterLite 0.6.0 isn't ready yet, the PR is ready for review as it can help catch upstream issues before the stable release, as directed in #275 (comment). |
So, I think there is a bug with the REPL when it is accessed in fullscreen mode and with the code execution disabled, and when the inserted code snippet is longer than a one-liner. For example, the following REPL: The code execution works well here as expected, but the code snippet seeps into the bottom of the page and then out of it, as the code prompt does not fit within the screen. Here is a video recording if this helps: Screen.Recording.2025-05-07.at.18.55.24.movHowever, this isn't the case with the same code snippet on the stable documentation: I investigated the CSS, and what I understand is the elements The bug occurs on all prompt positions, but is primarily noticeable when the prompt position would be set to bottom/top, as a long code snippet won't overflow if the prompt is positioned at the left/right unless the code snippet is super long (i.e., even for the left/right positions). The bug's effect is amplified when the REPL is in an iframe, where the code snippet may be very long and the REPL might be only on a limited portion of a page, which makes things a little awkward. I think the ideal solution would be for the code prompt to expand to the length of the code snippet every time, or to never go out of the screen. I guess we need a Please let me know if you'd like me to open a new upstream issue for this, @jtpio, thanks! Happy to move it around to https://github.com/jupyterlite/jupyterlite if you want and I can perhaps try to fix this if it's not too difficult 😅 |
Right this is likely a side-effect of the switch to using a JupyterLite reuses the code console from JupyterLab almost as-is, and these new changes were added in JupyterLab 4.4: https://jupyterlab.readthedocs.io/en/latest/getting_started/changelog.html#code-console-improvements So maybe we should look into a fix in JupyterLab so the |
Thanks for your quick response!
Ah, I see. I think both options would be fine here. Given that JupyterLite is reusing most of the code, someone is bound to run into this in JupyterLab as well, so it makes sense to fix there. We could also override this on the JupyterLite side to fix it temporarily, as you've mentioned that the first beta is coming in jupyterlite/jupyterlite#1554 (as I'm not sure what the usual release schedule is and if there are any timelines to keep in mind)
Right, I imagine that if someone adds more code, the scrollbar should return – the |
The option for populating the code cell with code is provided by the JupyterLite plugin in https://github.com/jupyterlite/jupyterlite/blob/main/packages/repl-extension/src/index.ts. So maybe we could first try to look into it there?
There isn't a strict timeline, but it would be great to move forward with the 0.6.0 final release this month, once the remaining PRs that add new features have been merged. And changes like this one can be done at any time if they are considered as bug fixes. |
Okay, I've been doing this for a decent amount of time (more than a couple of hours) and haven't gotten far. I think one problem that makes things tricky is also that the code added by the I'll set this aside for now, as this should not be a big blocker against merging! |
Description
This PR closes #275; it adds the new REPL configuration options for the Replite directive from jupyterlite/jupyterlite#1573 and associated documentation for these options. Like the previous addition via #245, these options are also configured via URL parameters and can be configured either globally or via a per-directive basis. Many of these options are in camelCase, and are converted to snake_case accordingly.