Skip to content

Conversation

@codehakase
Copy link
Owner

Summary

Replaces the HTML5 drag API with native file-based drag using tauri-plugin-drag. Screenshots are written to temp files and dragged as file:// URLs, enabling proper image paste into Slack, browsers, and other applications.

Fixes #7

Changes

  • Add @crabnebula/tauri-plugin-drag dependency for native drag support
  • Implement prepare_drag_file and cleanup_drag_file Rust commands
  • Update ScreenshotPreview to use pointer-based drag initiation
  • Write temp file on popup mount, cleanup on unmount
  • Cancel auto-dismiss timer when user interacts with popup
  • Resize popup from 280x200 to 320x220 for better preview
  • Disable drag-drop handler on popup window to prevent conflicts

Test plan

  1. Capture a screenshot
  2. Drag the preview to Slack, browser, or file manager
  3. Verify the actual image is transferred (not base64 text)
  4. Verify auto-dismiss cancels on interaction
  5. Verify temp files are cleaned up on popup close

Replace HTML5 drag API with native file-based drag using tauri-plugin-drag.
Screenshots are now written to temp files and dragged as file:// URLs,
allowing proper image paste into Slack, browsers, and other apps.

Key changes:
- Update ScreenshotPreview to use pointer-based drag initiation
- Write temp file on popup mount, cleanup on unmount
- Cancel auto-dismiss timer when user interacts with popup
- Resize popup from 280x200 to 320x220 for better preview
- Disable drag-drop handler on popup window to prevent conflicts

Fixes #7
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.

popup/ScreenshotPreview: drag-and-drop pastes raw base64 data URI instead of image

1 participant