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 canvas overflows out of the file tab and into the sidebar. #129120
Comments
(Experimental duplicate detection) |
Hi Guys, I'm ready to help, If any one could give a little push on where exactly can find the relevant code and any other recommendations, I'm ready to gooo. Best of luck ! |
This is a really good catch. |
I can reproduce this issue with both notebook and custom editor. After toggling the position of the sidebar, a |
Apparently |
A proper fix would be we pass the |
This seems like a general grid layout issue to me unrelated to editors specifically. Thus assigning @joaomoreno and @sbatten (who are on vacation though). |
Both notebooks and normal webviews suffer from this problem. I believe the root cause is the same although the two have different implementations After debugging, I believe that the root cause is that we get a call to The important bit is that
Here you can also see how we are calling layout before main the editor dom node has shifted to the left to replace the activity bar: I believe this could be fixed by calling |
I think the sidebar location change code is here: vscode/src/vs/workbench/browser/layout.ts Lines 417 to 451 in 9aab65c
I resort to Steven for a fix who authored this. |
After digging into this, I believe 0449a18 is the reason we hit this issue. @joaomoreno Essentially, if a grid gets the same dimensions and position info it will not call layout again on the contained view (in this case the webview or notebook). At the workbench level, after moving the activity bar (the 2nd action in moving the sidebar, we can see that the editor part layout is correctly called.) however, the editor part has several nested grids, one of which does not use top/left info. Since the size and position are the same on the 2nd call, the cache check is hit and we bail before the webview or notebook can get the correct offset info. It seems this shouldn't work on the first call either but moving the sidebar triggers a size and position change on the top level grid and the activity bar does not. |
Does reverting this commit fix this issue? |
@joaomoreno yes reverting fixes the issue. I did not, however, because I was not sure of the repercussions. |
@joaomoreno there was a lot of discussion in the issue that led to the caching you introduced with 0449a18 . Unless you say so I will not revert that change for this fix since a simple reload resolves this issue. The crux of the issue with caching however is that the notebook layout code does not treat 2 layout calls with the same dimensions as the same since they can be in a different position overall and that impacts the layout. You could say this is a bug with notebook layout, but I am not sure where we draw that line. |
0449a18 was pushed as a way to force all views to think about layout, since that's such a core part of performance. I don't think we should revert it and should rather fix the notebook layout.
Grid view layout calls do not only take dimension into account but positioning as well. Even 0449a18 shows it clearly. So the reason above can't be the problem, right? |
Hmmm just read this again. I see. Let me see what I can do about that. |
I've connected both grids such that views on the inner grid get absolute offsets, in respect to the outter grid. |
@mjbvz @rebornix This also means that this The hard part of doing the above is making sure positional data gets passed around the composite world, ideally abstract layout(width: number, height: number, top: number, left: number): void; So maybe @sbatten would give you this. 😉 Handing it over to you all. ❤️ |
Thanks @joaomoreno! I confirmed the issue is fixed now for notebooks and webviews |
I changed my sidebar location while having a jupyter notebook open.
It resulted in the notebook canvas overflowing onto the sidebar.
Gets fixed once I switch to some other file then come back.
This glitch appears only when there is a switch of side bar position from left to right.
Environment data
Actual behaviour
Initial state:
Just after I changed the layout (Move Side Bar Right)
Expected behaviour
After switching to a different file and coming back.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Not sure if this is relevant for this issue
The text was updated successfully, but these errors were encountered: