-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Notebook minimap in the virtual scrollbar #16432
Notebook minimap in the virtual scrollbar #16432
Conversation
Thanks for making a pull request to jupyterlab! |
Ohh, very cool! Some minor feedback:
If it isn't too much trouble, could you generate some alternate screenshots to help us explore and weight the different visual options. |
Thank you for leaving feedback @ellisonbg!
I agree that it should be smaller than the actual prompt. There is of course a limit as to how small we can make it to keep it legible. Currently the prompt in the notebook cells are 13px and in the the minimap they are 80% of that which works out to 10.4px. Visually they may seem more similar because the former are grey and the latter are black (left - minimap as of now, right - cell in a notebook)
To clarify, this PR is not adding the hamburger icon button to the toolbar. For context, that button (and the initial virtual scrollbar implementation) was added 6 months ago in #15533 by @afshin after previous discussion in #15109 (and discussing this on multiple JupyterLab calls). Discussing it in a dedicated issue rather than here would give it more prominence and allow users who only monitor the issues by screening the titles to participate so I opened #16478 for it. Also, if we were to make this change here, this PR would grow to touch dozens of snapshot files and toolbar tests, so I would really prefer not to do that. |
a9c0881
to
6381c41
Compare
I tested this and it works well for me (Ubuntu 20.04.6 LTS, firefox 114.0.2). Scrolling works well, execution indicator, ect. all work smoothly and as expected on the |
Thanks @krassowski for adding this feature, it's really nice. In my opinion, we should make it configurable, with this display as default.
We could have an option to fully render the cells, which would remove the
In the case of a simple rendering (rectangle with cell index), would it be easy (and necessary) to fallback to a simple |
I agree. My original intent was to add settings in this PR but I realised that we will probably want the minimap to be an extension point and therefore we should not be adding settings to the Notebook package because then it would be a breaking change to remove them (which would be needed to move then to a new plugin providing the default implementation so that extensions can provide their own settings schema), so let's settle on the extension API for minimap first and implement settings second. I opened #16528 to track this. |
This could be implemented as a separate plugin (disabled by default) which could be swapped by the user if they wanted the other implementation once we implement an extension point for the minimap (#16528); that said I am not sure how much value there would be in it. |
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 for the changes and details @krassowski, this looks good.
Should we add #16528 in 4.3 release plan ?
* Notebook minimap in the virtual scrollbar * Remove `updateOutput` in favour of making `updatePrompt` an arrow func * Improve line breaks behaviour in markdown cell previews * Adjust prompt positioning after c26de19
References
For now this PR includes two PRs on which it depends:
ICodeCellModel.executionState
, deprecatesetPrompt()
#16431Code changes
Creates a private (non-exported)
ScrollbarItem
class which implements reactive scrollbar item allowing for high-performance rendering of minimap even in very large notebooks.User-facing changes
The virtual scrollbar now exposes information on whether the cell:
[*]
), idle ([ ]
) or was already run (e.g.[1]
)[X]
for code, nothing for markdown)Plan
Depending on feedback:
Ideas for future improvements:
Backwards-incompatible changes
None