From cbe7e8967c50d6e40d31fabef7e9c78158f6ca0e Mon Sep 17 00:00:00 2001 From: ComfyUI Wiki Date: Wed, 12 Nov 2025 07:16:41 +0800 Subject: [PATCH] Add the copy URL button for the missing models dialog to Desktop (#4472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Terry only add the Copy url to Portable, so I bring this feature to Desktop in order to solved this [issue](https://github.com/comfyanonymous/ComfyUI/issues/8958) image https://github.com/user-attachments/assets/53d4ae33-4229-41c0-8379-0a864b68d37b ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4472-Add-the-copy-url-button-for-Desktop-2346d73d3650816889e2e227f9d797b0) by [Unito](https://www.unito.io) --------- Co-authored-by: Terry Jia --- browser_tests/tests/dialog.spec.ts | 8 ++++++++ src/components/common/ElectronFileDownload.vue | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/browser_tests/tests/dialog.spec.ts b/browser_tests/tests/dialog.spec.ts index 9ccd4cd67..269df3387 100644 --- a/browser_tests/tests/dialog.spec.ts +++ b/browser_tests/tests/dialog.spec.ts @@ -88,6 +88,10 @@ test.describe('Missing models warning', () => { const downloadButton = missingModelsWarning.getByLabel('Download') await expect(downloadButton).toBeVisible() + + // Check that the copy URL button is also visible for Desktop environment + const copyUrlButton = missingModelsWarning.getByLabel('Copy URL') + await expect(copyUrlButton).toBeVisible() }) test('Should display a warning when missing models are found in node properties', async ({ @@ -101,6 +105,10 @@ test.describe('Missing models warning', () => { const downloadButton = missingModelsWarning.getByLabel('Download') await expect(downloadButton).toBeVisible() + + // Check that the copy URL button is also visible for Desktop environment + const copyUrlButton = missingModelsWarning.getByLabel('Copy URL') + await expect(copyUrlButton).toBeVisible() }) test('Should not display a warning when no missing models are found', async ({ diff --git a/src/components/common/ElectronFileDownload.vue b/src/components/common/ElectronFileDownload.vue index e09dce0d0..6a8ab11cb 100644 --- a/src/components/common/ElectronFileDownload.vue +++ b/src/components/common/ElectronFileDownload.vue @@ -12,7 +12,7 @@ -
+
(null) const fileSize = computed(() => download.fileSize.value ? formatSize(download.fileSize.value) : '?' ) +const { copyToClipboard } = useCopyToClipboard() const electronDownloadStore = useElectronDownloadStore() // @ts-expect-error fixme ts strict error const [savePath, filename] = props.label.split('/') @@ -126,4 +135,8 @@ const triggerDownload = async () => { const triggerCancelDownload = () => electronDownloadStore.cancel(props.url) const triggerPauseDownload = () => electronDownloadStore.pause(props.url) const triggerResumeDownload = () => electronDownloadStore.resume(props.url) + +const copyURL = async () => { + await copyToClipboard(props.url) +}