-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Encoding more information in the virtual scroll bar #16332
Comments
Related to:
We do not want to render a mini version of the cell in the scrollbar as this would take away the performance benefits of virtualization.
We could also have a different icon for ipywidgets too. There are different tradeoff depending on which information we decide to display. For example encoding both the execution count/cell type and the cell editor content seems to leave no space for output unless we break with the "each cell occupies equal height in the scrollbar" convention (or make the cell box very wide). Showing just the editor content and output seems like a better use of space but then there is no execution counter to show:
In the |
Implementation-wise we would need to modify the virtual renderer for the notebook: jupyterlab/packages/notebook/src/widget.ts Lines 1317 to 1335 in d86e3cd
it looks like it already can access cells so rendering it should be easy (set aside cross-browser CSS issues we encountered during the initial implementation). We may need to ensure that rendering is selectively updated when cell editor content, execution status or outputs change. Currently the entire scrollbar is redrawn on every update request, but as we start making the nodes more complex and need to synchronise state more frequently we need more granular rendering updates. |
I like that they are all the same size now. It's a good mental model for me
I'm on the fence here, but I see the argument to go to execution number.
How would we define these amount of code? I also find the icons proposed a bit large
This is similar to the line I proposed above - but mine was more of a hint.
I like the idea of showing a spinner and an alert for failed cells. I agree - success should not show anything in your face (I could see executed vs. not having a very subtle indication)
I personally think this gets too cluttered.
I think we should really keep these as minimal hints and shy away from anything too in your face. How about:
|
I agree that this is advantageous, especially because very long cells can be skipped easily. If we wanted to go for the squiggle lines representing the actual number of code lines in the editor, we could cap it at showing at most say 20 lines + a gradient or symbol to indicate that there is more lines.
My screenshots of the MDI icons were possibly a bit large, and we may simplify them slightly, but there is only so much we can do here.
Using color would conflict with using color for cell selection status. Currently we use light blue for selection and dark blue for active cell: A frequent feature of minimap is to overlay both selection, and the boundary of the viewport, as done by https://github.com/replit/codemirror-minimap (blue - selection, grey - viewport): If we use colors for cell types (and execution status), then this becomes tricky, especially when we get to the details of making it meet AA accessibility standards. We could:
I feel like (b) could be more intuitive to users, although the size of the scrollbar would increase. |
For reference this was previously included in a mockup of virtual scrollbar by @GabrielaVives here: #13343 (comment) but by using background of the cell: I think we could have some kind of outline box with high transparency, like in the codemirror-minimap: this still allows to see the colors underneath. |
#16392 makes a first steps by implementing the viewport indicator and refactoring code so that we can add more information to the scrollbar without performance penalty: |
The next step is adding more information. From quick experimentation I found out that it is feasible to just add the source code of the cell (without syntax highlighting/rendering markdown/math - anything) to the scrollbar and it works very smooth even with very large notebooks - unfortunately the recording does not do it justice (it skips many frames each time I try to use the browser scrollbar - might be a Wayland compositor issue on my side): It is currently trimmed to a few lines but we can adjust this further. I will now implement running status indicator and open a draft PR to allow for testing. |
Problem
The virtual scroll bar is nice, but now that its a custom scrollbar, it seems like we can use it to encode more information.
Proposed Solution
For example, maybe code and markdown cells should look slightly different. We could also imagine encoding something about which are the big code cells with some sort of very slim sparkline. I'm not sure of any exact idea - but it seems navigation could be greatly enhanced by hinting at what is in the cell. Other ideas including showing which cells have an error etc.
Above cell 3 is markdown (gray) and cell 2 has more than 2x the code than cell 4.
Additional context
The text was updated successfully, but these errors were encountered: