Closed sandy081 closed 4 years ago
wait... cannot reproduce. @sandy081 are you on lastest of the GH issue extension?
Yeah I am on latest.. I think the step I missed to add is to have ### Performance
cell in edit mode. Updated.
Edit - I am on v0.0.27
Thanks. The cell (markdown) needs to be in edit mode and must be outside the viewport for this to happens. For some reason the wrong editor is then picked up.
@rebornix It seems like something goes wrong in the editor (and this might actually the same as https://github.com/microsoft/vscode/issues/98172).
When I adding below 👇 log lines here
console.log('CELL:', cell.uri.toString(), cell.getText().substr(0, 100));
console.log('EDITOR:', editor.getModel()!.uri.toString(), editor.getModel()!.getValue().substr(0, 100));
it will print this, which makes me believe that initially the right editor is selected but somehow the models must change or so...
CELL: vscode-notebook-cell:/Users/jrieken/Code/_samples/devfest/foo/my-work.github-issues#0000006 $vscode $milestone is:closed assignee:@me label:feature-request -label:on-testplan -label:verificati
notebookEditorWidget.js:302 EDITOR: vscode-notebook-cell:/Users/jrieken/Code/_samples/devfest/foo/my-work.github-issues#0000006 $vscode $milestone is:closed assignee:@me label:feature-request -label:on-testplan -label:verificati
notebookEditorWidget.js:301 CELL: vscode-notebook-cell:/Users/jrieken/Code/_samples/devfest/foo/my-work.github-issues#0000008 $vscode $milestone is:closed assignee:@me label:feature-request -label:on-release-notes -label:*dupl
notebookEditorWidget.js:302 EDITOR: vscode-notebook-cell:/Users/jrieken/Code/_samples/devfest/foo/my-work.github-issues#0000008 $vscode $milestone is:closed assignee:@me label:feature-request -label:on-release-notes -label:*dupl
Digging a little deeper, it seems to be coming from here (revealInCenterIfOutsideViewport
) but somehow async, e.g first the cell code editor is selected and focused and after that the post scroll logic kicks in which makes the MD cell render, which in return realises that it is editable and questionably focuses itself.
Thanks for the investigation! Found simpler repro steps -
I see the issue
looking into it and the root cause is the markdown cell in editing mode always steals focus, it focuses the monaco editor when it's in edit mode, which triggers the cell to be focused then. Adding a guard fixes this issue.
reavel*
can be async indeed as the editor takes time to initialize, without the editor being fully initialized, we can reveal a specific line or position to the right position in the viewport. Will improve this in debt week. https://github.com/microsoft/vscode/issues/99385
I'm seeing more usage with notebook, together with more bug reports, thanks for it!
@misolori are you verifying in master? This isn't in a build yet
@roblourens doh, my bad. I started testing this and saw this persisted so was writing up an issue. I assumed that because this didn't have the unreleased
label that it was released (need to look for released
label instead). Didn't even look at the commit time, my mistake.
Pushed a different fix, but also filed https://github.com/microsoft/vscode/issues/99390 for some related issues. Right now if you scroll the focused element out of view, list keyboard shortcuts will not work and it may or may not get refocused properly when scrolling back in.
\closedWith 0b18106
### Performance
cell in edit mode$vscode
🐛 Markdown cell that does not has reference is revealed