feat(prompt-input): Add PromptInputRichtext with Lexical-powered markdown editing#403
Open
omaroubari wants to merge 5 commits intovercel:mainfrom
Open
feat(prompt-input): Add PromptInputRichtext with Lexical-powered markdown editing#403omaroubari wants to merge 5 commits intovercel:mainfrom
omaroubari wants to merge 5 commits intovercel:mainfrom
Conversation
Contributor
|
@omaroubari is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
e8e08ec to
dd7ee1d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PromptInputRichtextas a composer-style alternative toPromptInputTextareaPromptInputProvider, submit it as markdown, and support links, markdown shortcuts, paste/attachments, and Enter-to-submit behaviorScreenshot
Why Lexical
I chose Lexical because it gives us a lightweight, React-friendly editor with a solid plugin model and the exact primitives we needed for markdown shortcuts, autolinking, history, and controlled state sync without overhauling the existing
PromptInputAPI.Alternatives considered
I considered extending the existing
PromptInputTextareawith more custom markdown behavior, and using the ProseMirror editor stack. Lexical felt like the best fit because it hits a good balance of flexibility, integration simplicity, and runtime weight for this composer use case. I haven't previously worked with ProseMirror, but I'll be happy to refactor if someone more experienced deems it a better fit. I think at some point this library will have aDocumentEditorcomponent for editing artifacts like the ChatGPT canvas, which will require thinking well about the editor we will adopt.