Feature/prompt input pasted content preview#352
Feature/prompt input pasted content preview#352unclebay143 wants to merge 6 commits intovercel:mainfrom
Conversation
|
@unclebay143 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
| <div | ||
| className={cn( | ||
| "flex items-start", | ||
| "flex items-start w-full p-3", |
| <DropdownMenuItem | ||
| {...props} | ||
| onSelect={(e) => { | ||
| onSelect={(e: Event) => { |
| onRemove: () => void; | ||
| } | ||
|
|
||
| export const PromptInputPastedContentCard = ({ |
| // Attachments display (files + pasted content cards) | ||
| // ============================================================================ | ||
|
|
||
| export const PromptInputAttachmentsDisplay = ({ |
There was a problem hiding this comment.
consolidate the existing attachment and the pasted content card attachment to benefit from the existing controls and context
|
The code doesn't just display pasted text as a file card - it actually converts the pasted text into a real file attachment that gets submitted with the message. Is this actually better than just displaying it as a card? Converting to a real file has some effects on prompting and file handling. |
|
@unclebay143 this is awesome! curious your thoughts on @shloimy-wiesel's comment. Also, |
this approach is following the same pattern as Claude and v0 (pasted long text as an attachment, see screenshot for whether that’s “better” depends on how the backend handles attachments vs inline text, so I don't think we should be changing that by default. however, to support both options, we can keep it composable via a but with |
thanks @haydenbleasel, shared my thought here: #352 (comment)
yes, I'm looking at making it composable by splitting it into 5 subcomponents so users can assemble their own layout and actions:
|
…asted-content-preview Compose/feature/prompt input pasted content preview
| </Suggestions> | ||
| <div className="w-full px-4 pb-4"> | ||
| <PromptInput globalDrop multiple onSubmit={handleSubmit}> | ||
| <PromptInputHeader> |
| <div | ||
| className={cn( | ||
| "flex items-start", | ||
| "flex items-start w-full", |
| ); | ||
| }; | ||
|
|
||
| const AttachmentsHeader = () => { |








Closes: #333
1. Convert pasted text content into file attachment
Before:
After:
Preview on click with copy and download options
2. Fix existing attachment alignment
Before:
After