Repository navigation
Attachments - #318
Merged
Merged
Attachments#318
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This branch had an error being deployed
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.
This pull request refactors the handling and display of attachments and referenced sources in the Elements package. The main change is the extraction and consolidation of all attachment-related components into a new, dedicated
attachment.tsxmodule, improving code organization and reusability. It also updates documentation and test files to reflect these changes, and removes redundant or duplicate code from the message and prompt input components.Attachment component extraction and consolidation:
All attachment-related components (
Attachment,Attachments,AttachmentPreview,AttachmentInfo,AttachmentRemove, etc.) have been moved fromprompt-input.tsxandmessage.tsxinto a new, centralized module (attachment.tsx). This eliminates duplication and ensures a single source of truth for attachment UI and logic. [1] [2]The
PromptInputAttachment,PromptInputAttachments,PromptInputReferencedSource, andPromptInputReferencedSourcescomponents are now simple wrappers or aliases for the new attachment components, ensuring backward compatibility for existing tests and usages.Code cleanup and simplification:
Redundant attachment and referenced source display logic has been removed from both
message.tsxandprompt-input.tsx, reducing code duplication and potential for inconsistencies. [1] [2]Unused imports and code related to attachments have been cleaned up in affected files. [1] [2] [3]
Documentation and developer experience:
attachment.mdx) has been added, detailing the usage, features, props, and utility functions of the newAttachmentcomponent suite. This improves discoverability and onboarding for developers using the component.Minor improvements and bug fixes:
item.url, have been made for robustness and clarity. [1] [2]Testing:
Overall, these changes make the codebase more maintainable, modular, and easier to extend with new attachment features in the future.