Skip to content

SD-1760 - feat: allow custom accept/reject handlers for TC bubbles#1921

Open
mattConnHarbour wants to merge 1 commit intomainfrom
SD-1760
Open

SD-1760 - feat: allow custom accept/reject handlers for TC bubbles#1921
mattConnHarbour wants to merge 1 commit intomainfrom
SD-1760

Conversation

@mattConnHarbour
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Feb 3, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6410f8173b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a cool idea and looks like a clean implementation. @mattConnHarbour please add unit tests to this covering the new api, as well as documentation

Copy link
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean implementation - just address the comments (incld Codex's) and feel free to merge after that

};

const handleReject = () => {
// Check for custom handler that replaces default behavior entirely
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add tests for the custom handler paths? the existing tests at only cover default behavior

we could add a case where config.onTrackedChangeBubbleAccept is set and verify it's called instead of the default

onFontsResolved: null,

// Tracked change bubble handlers - replace default accept/reject behavior
// Only fires from bubble buttons, not toolbar or context menu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we document that the default behavior includes resolving the comment and clearing active state?

users might not realize they need to handle these themselves - maybe add an example showing the full flow?


const handleReject = () => {
// Check for custom handler that replaces default behavior entirely
const customHandler = proxy.$superdoc.config.onTrackedChangeBubbleReject;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new handlers should be added to apps/docs/core/superdoc/configuration.mdx, e.g.

 <ParamField path="onTrackedChangeBubbleAccept" type="function">
   Custom handler for accepting tracked changes from comment bubbles.
   Replaces default behavior entirely when provided.

   ```javascript
   onTrackedChangeBubbleAccept: (comment, editor) => {
     // Your custom logic here
     editor.commands.acceptTrackedChangeById(comment.commentId);
     await saveDocument(); // e.g., custom save after accept
   }

   Only fires from bubble buttons, not toolbar or context menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants