feat(core): remove attachment tooltip (#12467)

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

## Summary by CodeRabbit

- **New Features**
  - Added a tooltip to the delete icon for attachments, displaying a localized description when hovered.
- **Documentation**
  - Updated English localization to include a tooltip label for deleting attachments.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
yoyoyohamapi
2025-05-23 02:50:43 +00:00
parent 119cf9442b
commit 8e8e4032c7
3 changed files with 17 additions and 6 deletions

View File

@@ -131,12 +131,18 @@ const AttachmentItem: React.FC<AttachmentItemProps> = ({
<PersistedItem attachment={attachment} />
) : null}
<div className={attachmentOperation}>
<CloseIcon
data-testid="workspace-embedding-setting-attachment-delete-button"
onClick={handleDelete}
color={cssVarV2('icon/primary')}
style={{ cursor: 'pointer' }}
/>
<Tooltip
content={t[
'com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.remove-attachment.tooltip'
]()}
>
<CloseIcon
data-testid="workspace-embedding-setting-attachment-delete-button"
onClick={handleDelete}
color={cssVarV2('icon/primary')}
style={{ cursor: 'pointer' }}
/>
</Tooltip>
</div>
</div>
);

View File

@@ -6263,6 +6263,10 @@ export function useAFFiNEI18N(): {
* `Attachment will be removed. AI will not continue to extract content from this attachment.`
*/
["com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.remove-attachment.description"](): string;
/**
* `Delete File`
*/
["com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.remove-attachment.tooltip"](): string;
/**
* `Sharing doc requires AFFiNE Cloud.`
*/

View File

@@ -1565,6 +1565,7 @@
"com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.description": "The uploaded file will be embedded in the current workspace.",
"com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.remove-attachment.title": "Remove the attachment from embedding?",
"com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.remove-attachment.description": "Attachment will be removed. AI will not continue to extract content from this attachment.",
"com.affine.settings.workspace.indexer-embedding.embedding.additional-attachments.remove-attachment.tooltip": "Delete File",
"com.affine.share-menu.EnableCloudDescription": "Sharing doc requires AFFiNE Cloud.",
"com.affine.share-menu.ShareMode": "Share mode",
"com.affine.share-menu.SharePage": "Share doc",