feat(core): support normal attachments (#13112)

fix AF-2722


![image](https://github.com/user-attachments/assets/376a0119-ae8e-4cb4-a31c-2eb6bb56c868)


#### PR Dependency Tree


* **PR #13112** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Expanded comment editor attachment support to include any file type,
not just images.
* Added file preview and download functionality for non-image
attachments.
* Introduced notifications for attachment upload failures and downloads.
* Added a new AI artifact tool component for enhanced AI tool
integrations.

* **Style**
* Added new styles for generic file previews, including icons, file
info, and delete button.

* **Bug Fixes**
  * Improved error handling and user feedback for attachment uploads.

* **Refactor**
* Unified attachment UI rendering and handling for both images and other
file types.

* **Chores**
* Removed obsolete editor state attribute from comment preview sidebar.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


#### PR Dependency Tree


* **PR #13112** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
Peng Xiao
2025-07-09 19:22:04 +08:00
committed by GitHub
parent f839e5c136
commit d4c905600b
6 changed files with 382 additions and 60 deletions
@@ -351,6 +351,7 @@ export class DocCommentEntity extends Entity<{
url,
filename: file.name,
mimeType: file.type,
size: file.size,
});
if (isPendingComment) {
@@ -13,6 +13,7 @@ export type CommentAttachment = {
url?: string; // attachment may not be uploaded yet
filename?: string;
mimeType?: string;
size?: number; // in bytes
};
export interface BaseComment {