Skip to content
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

Code review comments on one notebook cell leak into other notebook cells as the Browser renderer reuses DOM which is not properly cleaned up #214585

Closed
rehmsen opened this issue Jun 7, 2024 · 0 comments · Fixed by #214589
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders notebook-commenting Commenting support for notebooks
Milestone

Comments

@rehmsen
Copy link
Contributor

rehmsen commented Jun 7, 2024

  • VS Code Version: vscode.dev/ (Browser code)
  • OS Version: Irrelevant

This is an issue with the browser code, which happens for code review comments on notebook cells. I do not have a public repro, but I can describe line by line why this happens, and am happy to send a PR to fix it:

I think we need to do the following to fix this issue:

  • CommentThreadWidget and its children (CommentThreadHeader) should remove the DOM elements they added to container when they are disposed(). That seems like good practice in general, and seems to be done at least in some other places in VSCode, e.g.
    container.appendChild(this.elements.root);
    this._register(toDisposable(() => this.elements.root.remove()));
  • CellComments should, instead of initializing only once, check if the ICellViewModel has changed in on didRender, and if so, run the same logic it runs onDidUpdateCommentThreads, which will remove, created, or update the comment thread.

I'll send a pull request to make this more concrete, happy to talk about other solutions to the problem, too.

@alexr00 @rebornix

@rebornix rebornix added the notebook-commenting Commenting support for notebooks label Jun 13, 2024
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jun 24, 2024
@vscodenpa vscodenpa added this to the June 2024 milestone Jun 24, 2024
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jun 25, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders notebook-commenting Commenting support for notebooks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants