-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
feature(provider): allow thread tombstoning and restoration #885
Conversation
@@ -17,6 +19,15 @@ const defaultDeleteCommentOptions: DeleteCommentOptions = { | |||
deleteThread: false, | |||
} | |||
|
|||
const defaultGetThreadsOptions: GetThreadsOptions = { | |||
types: ['undeleted'], |
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.
undeleted isn't a word and doesn't sound right.
How about archived & not archived. Don't need two states, when people get, it should only ever be not archived. And asking for archived means you want archived too.
Like includeArchived?: true
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 includeDeleted if you wanna stick to that naming
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'd like to use the types as you can control what you want to get this way, but I'm totally okay with renaming the types.
I used an enum + called them archived and unarchived for now.
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.
Other than the naming, the change looks good.
This pull request to
packages/provider
introduces several enhancements and new features related to thread management in theTiptapCollabProvider
class. The changes include the addition of new options for handling threads, improvements to thread deletion and restoration, and updates to the type definitions.Enhancements to thread management:
packages/provider/src/TiptapCollabProvider.ts
: Added new optionsDeleteThreadOptions
andGetThreadsOptions
to control the output and deletion of threads. ThegetThreads
method now accepts anoptions
parameter to filter threads based on their deletion status. [1] [2]packages/provider/src/TiptapCollabProvider.ts
: Introduced therestoreThread
method to restore deleted threads by setting thedeletedAt
property tonull
.packages/provider/src/TiptapCollabProvider.ts
: Updated thedeleteThread
method to support soft deletion (marking as deleted) and forceful deletion of threads and their comments based on the provided options.Type definition updates:
packages/provider/src/types.ts
: AddeddeletedAt
property to theTCollabThread
type to indicate the deletion status of a thread.packages/provider/src/types.ts
: Defined new typesDeleteThreadOptions
andGetThreadsOptions
to support the new options in thread management methods.