Skip to content

Build your personal knowledge base with Trilium Notes

fix(attachments): clarify 'Copy link to clipboard' as 'Copy reference to clipboard', closes #5118

Elian Dorana71a7297df00
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 075e5a9ca4..fe28db1ef4 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -718,7 +718,7 @@
"download": "Download",
"rename_attachment": "Rename attachment",
"upload_new_revision": "Upload new revision",
- "copy_link_to_clipboard": "Copy link to clipboard",
+ "copy_link_to_clipboard": "Copy reference to clipboard",
"convert_attachment_into_note": "Convert attachment into note",
"delete_attachment": "Delete attachment",
"upload_success": "New attachment revision has been uploaded.",
@@ -1887,7 +1887,7 @@
"will_be_deleted_soon": "This attachment will be automatically deleted soon",
"deletion_reason": ", because the attachment is not linked in the note's content. To prevent deletion, add the attachment link back into the content or convert the attachment into note.",
"role_and_size": "Role: {{role}}, size: {{size}}, MIME: {{- mimeType}}",
- "link_copied": "Attachment link copied to clipboard.",
+ "link_copied": "Attachment reference copied to clipboard.",
"unrecognized_role": "Unrecognized attachment role '{{role}}'."
},
"bookmark_switch": {
diff --git a/apps/client/src/widgets/type_widgets/Attachment.tsx b/apps/client/src/widgets/type_widgets/Attachment.tsx
index c6e24185b6..1c3a0fb924 100644
--- a/apps/client/src/widgets/type_widgets/Attachment.tsx
+++ b/apps/client/src/widgets/type_widgets/Attachment.tsx
@@ -190,7 +190,7 @@ function AttachmentInfo({ attachment, isFullDetail, ownerNote, noteContext, view
}
}, [ isZoomableImage ]);
- async function copyAttachmentLinkToClipboard() {
+ async function copyAttachmentReferenceToClipboard() {
if (attachment.role === "image") {
const $img = refToJQuerySelector(isZoomableImage ? imageViewerWrapper : contentWrapper).find("img");
if ($img.length) image.copyImageReferenceToClipboard($img.parent());
@@ -217,7 +217,7 @@ function AttachmentInfo({ attachment, isFullDetail, ownerNote, noteContext, view
<div className="attachment-title-line">
<AttachmentActions
attachment={attachment}
- copyAttachmentLinkToClipboard={copyAttachmentLinkToClipboard}
+ copyAttachmentReferenceToClipboard={copyAttachmentReferenceToClipboard}
onShowOcr={supportsOcr ? () => appContext.triggerCommand("showOcrTextDialog", {
textUrl: `ocr/attachments/${attachment.attachmentId}/text`,
processUrl: `ocr/process-attachment/${attachment.attachmentId}`
@@ -286,7 +286,7 @@ function DeletionAlert({ utcDateScheduledForErasureSince }: { utcDateScheduledFo
);
}
-function AttachmentActions({ attachment, copyAttachmentLinkToClipboard, onShowOcr }: { attachment: FAttachment, copyAttachmentLinkToClipboard: () => void, onShowOcr?: () => void }) {
+function AttachmentActions({ attachment, copyAttachmentReferenceToClipboard, onShowOcr }: { attachment: FAttachment, copyAttachmentReferenceToClipboard: () => void, onShowOcr?: () => void }) {
const isElectron = utils.isElectron();
const fileUploadRef = useRef<HTMLInputElement>(null);
@@ -317,8 +317,8 @@ function AttachmentActions({ attachment, copyAttachmentLinkToClipboard, onShowOc
onClick={() => open.downloadAttachment(attachment.attachmentId)}
>{t("attachments_actions.download")}</FormListItem>
<FormListItem
- icon="bx bx-link"
- onClick={copyAttachmentLinkToClipboard}
+ icon="bx bx-directions"
+ onClick={copyAttachmentReferenceToClipboard}
>{t("attachments_actions.copy_link_to_clipboard")}</FormListItem>
{onShowOcr && (
<FormListItem