-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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 comment support #145090
notebook comment support #145090
Conversation
@alexr00 FYI, to support comments in notebook editor, I decoupled the comment widget from the |
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.
I took a quick look, but it's a large change so I couldn't be super thorough.
@@ -212,8 +218,8 @@ export class MainThreadCommentController { | |||
return this._features.options; | |||
} | |||
|
|||
private readonly _threads: Map<number, MainThreadCommentThread> = new Map<number, MainThreadCommentThread>(); | |||
public activeCommentThread?: MainThreadCommentThread; | |||
private readonly _threads: Map<number, MainThreadCommentThread<IRange | ICellRange>> = new Map<number, MainThreadCommentThread<IRange | ICellRange>>(); |
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.
Should MainThreadCommentController
also be templated so that IRange | ICellRange
can be a T
?
if (matchedZones.length) { | ||
let matchedZone = matchedZones[0]; | ||
matchedZone.update(thread); | ||
if (thread.isDocumentCommentThread()) { |
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.
We now need to have these checks in various places. Would it make more sense to have a separate notebook comments service?
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.
or, at the very least, separate onDidUpdateCommentThreads
events for documents and notebooks?
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.
💯 for filtering through onDidUpdateCommentThreads
.
This PR fixes #144850. The changes included:
CommentThreadWidget
fromZoneWidget
and make it reuseable for Notebook.CommentThread
toCommentThread<T>
whereT
is eitherIRange
orICellRange
.CellComments
cell part in notebookOriginally I thought we should at least introduce a new API to allow contributing comments to notebook cells but at the end I took a shortcut: extensions contribute comments to notebook cells and we render comments in notebook cells instead of inside the cell editor.