Skip to content

feat(ai): add ai text generation and rewriting using insights endpoint#444

Merged
harbournick merged 37 commits intomainfrom
feat/ai/insights-writer-and-rewriter
Apr 28, 2025
Merged

feat(ai): add ai text generation and rewriting using insights endpoint#444
harbournick merged 37 commits intomainfrom
feat/ai/insights-writer-and-rewriter

Conversation

@palmer-cl
Copy link
Copy Markdown
Collaborator

@palmer-cl palmer-cl commented Apr 3, 2025

Adds the v1 functionality for AI Writing and Re-writing

  • Adds AI button to the toolbar
  • Adds custom popout styled menu when button is hit
  • Adds AI layer component to handle highlighting (similar to comments layer)
  • When suggesting, generated text are inserted as tracked changes
  • Adds AI button to side tools menu

Requesting eyes on

  • Emitting and Listening for events (specifically emitting from toolbar vs superdoc or if we could optimize this)
  • AIWriter component is built in SuperEditor and then exported to SuperDoc. It is consumed by both. Is there a better pattern for this? Do we have a place we store shared components?

Caveats

  • The processStream function will change when the insights endpoint update the data structure returned. This is in progress by @falsaadehh

Screenshot 2025-04-02 at 7 27 30 PM

Comment thread packages/superdoc/src/core/SuperDoc.js
Comment thread packages/superdoc/src/core/SuperDoc.js Outdated
Comment thread packages/superdoc/src/components/AiLayer/AiLayer.vue Outdated
Comment thread packages/superdoc/src/components/AiLayer/AiLayer.vue Outdated
Comment thread packages/superdoc/src/components/AiLayer/AiLayer.vue Outdated
Comment thread packages/superdoc/src/SuperDoc.vue Outdated
Comment thread packages/superdoc/src/SuperDoc.vue Outdated
Comment thread packages/superdoc/src/SuperDoc.vue Outdated
Comment thread packages/superdoc/src/SuperDoc.vue Outdated
Copy link
Copy Markdown
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.

See my comments below. We currently try to keep a separation between what is Editor.js and what is SuperDoc which is not necessarily obvious.

Comment thread packages/super-editor/vite.config.js
Comment thread packages/super-editor/vite.config.js
Comment thread packages/superdoc/src/SuperDoc.vue Outdated
@harbournick
Copy link
Copy Markdown
Collaborator

@palmer-cl and I discussed my comments, and we will move forward after @artem-harbour's review without architectural changes, and I will make the necessary changes in an additional PR.

@palmer-cl
Copy link
Copy Markdown
Collaborator Author

@harbournick it looks like c6db2d3 caused the e2e tests to fail. The reactivity chain may have been altered slightly when moving the state variables and refs into a composable pattern. Would you mind confirming if we should update the test, or change the code.

Comment thread packages/super-editor/src/components/toolbar/AIWriter.vue
Copy link
Copy Markdown
Contributor

@artem-harbour artem-harbour left a comment

Choose a reason for hiding this comment

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

LGTM

@harbournick, approved from my side, please double check everything from your side.

@harbournick harbournick marked this pull request as ready for review April 28, 2025 17:26
Copy link
Copy Markdown
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.

LGTM

@harbournick harbournick merged commit a75e228 into main Apr 28, 2025
5 of 6 checks passed
@harbournick harbournick deleted the feat/ai/insights-writer-and-rewriter branch April 28, 2025 17:39
@harbournick
Copy link
Copy Markdown
Collaborator

Thanks for all the hard work on this one @palmer-cl !

@palmer-cl
Copy link
Copy Markdown
Collaborator Author

Thanks @harbournick and @artem-harbour ! Credit to the complete team effort!

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