Skip to content

Attachments - #318

Merged
haydenbleasel merged 2 commits into
mainfrom
attachments
Jan 15, 2026
Merged

haydenbleasel merged 2 commits into
mainfrom
attachments

Conversation

@haydenbleasel

Copy link
Copy Markdown
Contributor

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.tsx module, 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 from prompt-input.tsx and message.tsx into 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, and PromptInputReferencedSources components 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.tsx and prompt-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:

  • A comprehensive new documentation page (attachment.mdx) has been added, detailing the usage, features, props, and utility functions of the new Attachment component suite. This improves discoverability and onboarding for developers using the component.

Minor improvements and bug fixes:

  • Minor code quality improvements, such as fixing a comment typo and a null check on item.url, have been made for robustness and clarity. [1] [2]

Testing:

  • The test suite has been updated to use the new attachment components and their compatibility wrappers, ensuring continued coverage and correctness after the refactor. [1] [2]

Overall, these changes make the codebase more maintainable, modular, and easier to extend with new attachment features in the future.

@vercel

vercel Bot commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ai-elements-registry Error Error Jan 14, 2026 11:56pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
ai-elements-docs Ignored Ignored Jan 14, 2026 11:56pm

@haydenbleasel
haydenbleasel marked this pull request as ready for review January 15, 2026 18:45
@haydenbleasel
haydenbleasel merged commit 2dd23cf into main Jan 15, 2026
5 of 8 checks passed
@haydenbleasel
haydenbleasel deleted the attachments branch January 15, 2026 18:45
@HarrisonJackson HarrisonJackson mentioned this pull request Jan 16, 2026

This branch had an error being deployed

1 failed deployment
Preview – ai-elements-registry — b23b351f Deployed Jan 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant