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

feat: add headless workspace comment class #7916

Merged
merged 7 commits into from
Mar 15, 2024

Conversation

BeksOmega
Copy link
Collaborator

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

@github-actions github-actions bot added the PR: feature Adds a feature label Mar 8, 2024
@BeksOmega BeksOmega force-pushed the feat/workspace-comment branch 2 times, most recently from 2f65abf to e6ac429 Compare March 8, 2024 22:49
@BeksOmega BeksOmega marked this pull request as ready for review March 11, 2024 21:36
@BeksOmega BeksOmega requested a review from a team as a code owner March 11, 2024 21:36
@BeksOmega
Copy link
Collaborator Author

@cpcallen Since Maribeth seems to be maybe OOO would you be interested in taking this?

core/comments/workspace_comment.ts Outdated Show resolved Hide resolved
* workspace is read-only.
*/
isEditable(): boolean {
return this.isOwnEditable() && !this.workspace.options.readOnly;
Copy link
Contributor

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?

Copy link
Collaborator Author

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 Show resolved Hide resolved
protected readonly workspace: Workspace,
id?: string,
) {
// TODO: Before merging, file issue to update getCommentById.
Copy link
Contributor

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

@BeksOmega BeksOmega merged commit 8fc439f into google:rc/v11.0.0 Mar 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants