-
-
Notifications
You must be signed in to change notification settings - Fork 459
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: AI block UI #980
base: main
Are you sure you want to change the base?
feat: AI block UI #980
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
In general looks good, I only looked at the overall architecture for now (not line-by-line). So far I have a few main comments:
Extracting package
Just realizing this now, I think we should try to ship this as a separate package. Two reasons for this: (a) it's likely this may be licensed differently (i.e.: GPL / Pro only) and (b) it would be a good "proof of the pudding" to see whether we can externalize larger plugins / extensions in a way that still makes sense
Duplicated toolbar code?
I think we're starting to see a lot of similar code with the AI Toolbar and plugin that we already have for FilePanel and LinkToolbar, right? If so, it might be a sign that we need to generalize this code and reduce the duplicate code
AI specific
- We need a way to pass in the
mockAIModelCall
function - The AI Model call might need access to the rest of the document / blocks above / below the block
- I think the current mockup is some good first steps but the Notion AI Block is definitely more polished. Specifically, I like their "Generated by AI x minutes ago" context and don't really like our "show prompt" button.
wdyt?
This PR adds all the UX/UI for AI integration in BlockNote according to the Notion doc. The UI is not yet plugged into an API for querying AI models, so it uses a mock function which accepts a string prompt and returns a string AI response.
There are a few differences in the implementation vs the spec listed in the doc:
Updating...
string but can easily be changed.TODOs:
Updating...
on click.mockAIReplaceSelection
ormockAIInsertAfterSelection
inAIInlineToolbar
while React strict mode is enabled. Everything works fine for the user though.