-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: add headless workspace comment class #7916
feat: add headless workspace comment class #7916
Conversation
2f65abf
to
e6ac429
Compare
e6ac429
to
dbac646
Compare
@cpcallen Since Maribeth seems to be maybe OOO would you be interested in taking this? |
* workspace is read-only. | ||
*/ | ||
isEditable(): boolean { | ||
return this.isOwnEditable() && !this.workspace.options.readOnly; |
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.
swapping these two is slightly better in case the workspace is readonly and the user decides to compute the traveling salesman problem in the ownEditable
function, but i'll acknowledge this is minute :P
the equivalent in Block
also checks if the block has been disposed. do we need to do that here?
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 don't think we need to do that. Looks like in Block
it was originally (this.workspace && !this.workspace.options.readonly)
which turned into !this.disposed && !this.workspace.options.readonly
which turned into !this.isDeadOrDying() && !this.workspace.options.readonly
.
So I think it was originally just a type safety thing, and as we migrated code the logic got slightly confused :P
Theoretically something that is being disposed probably isn't editable? But it probably doesn't have a size or text either. I think it's fine to ignore this.
core/comments/workspace_comment.ts
Outdated
protected readonly workspace: Workspace, | ||
id?: string, | ||
) { | ||
// TODO: Before merging, file issue to update getCommentById. |
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.
you have some todos here fyi
The basics
The details
Resolves
Fixes #7906
Proposed Changes + reasons
Adds a headless workspace comment class (just holds data, doesn't refer to any view elements) to support headless mode.
Test Coverage
No testing, because this is just a bunch of data storage methods. These methods will be covered by later serialization tests.
Documentation
N/A
Additional Information
N/A