Skip to content

🐛 Fix image file clipboard transfer to web applications #2638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

guiyanakuang
Copy link
Member

close #2637

@guiyanakuang guiyanakuang added this to the CrossPaste 1.1.2 milestone Apr 18, 2025
@guiyanakuang guiyanakuang self-assigned this Apr 18, 2025
@guiyanakuang guiyanakuang requested a review from Copilot April 18, 2025 14:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the image file clipboard transfer issue for web applications by adding a new fallback branch that maps the URL_FLAVOR to the file's URL.

  • Added import and handling for URL_FLAVOR in DesktopImageTypePlugin.kt.
  • Added similar handling for URL_FLAVOR in DesktopFilesTypePlugin.kt.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/src/desktopMain/kotlin/com/crosspaste/paste/plugin/type/DesktopImageTypePlugin.kt Added URL_FLAVOR branch for image file URL conversion.
app/src/desktopMain/kotlin/com/crosspaste/paste/plugin/type/DesktopFilesTypePlugin.kt Added URL_FLAVOR branch for file URL conversion.

@guiyanakuang guiyanakuang requested a review from Copilot April 18, 2025 14:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #2637 by ensuring that when exactly one file is selected for copying, its URL is properly transferred to web applications via the URL flavor.

  • In DesktopImageTypePlugin, import URL_FLAVOR and add URL mapping when there is a single image file.
  • In DesktopFilesTypePlugin, add a similar URL mapping for single file selection.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
DesktopImageTypePlugin.kt Adds URL flavor mapping for a single image file clipboard transfer.
DesktopFilesTypePlugin.kt Adds URL flavor mapping for a single file clipboard transfer.

@guiyanakuang guiyanakuang merged commit 2b28063 into main Apr 18, 2025
2 checks passed
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.

Fix image file clipboard transfer to web applications
1 participant