Skip to content

Feature/1090 native drag and drop for file and folder#3203

Merged
leaanthony merged 20 commits into
wailsapp:feature/1090_native_drag_and_drop_for_file_and_folderfrom
lyimmi:feature/1090_native_drag_and_drop_for_file_and_folder
Feb 6, 2024
Merged

Feature/1090 native drag and drop for file and folder#3203
leaanthony merged 20 commits into
wailsapp:feature/1090_native_drag_and_drop_for_file_and_folderfrom
lyimmi:feature/1090_native_drag_and_drop_for_file_and_folder

Conversation

@lyimmi

@lyimmi lyimmi commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Description

This PR implement Drag & Drop for files and folders on Windows and Linux.

On both systems the whole window is a drop target and the developer can either use the JS runtime method to handle the drops as described below, or implement the handling them self.

I tried to test all of the cases I can think of but and extensive test by multiple people would be a good idea. Or maybe somehow make it experimental for a while. I don't really know how it wold be possible with the JavaScript code/files.

Fixes #1090

Windows

The windows implementation is based on ayatkyo's work in #2774, with minor changes to align the API with the linux imlementation.

The drop event sends the coordinates and the files to the go side to resolve the file paths and after that a wails:file-drop event is fired to notify the listeners in GO and Javascript.

Linux

On Linux I have overridden the WebKitGTK signals for drag & drop and the C code sends the coordinates and the file paths via processMessage() to GO and than the same wails:file-drop event is fired.

macOS

No solution for macOS.

Runtime

GO

OnFileDrop(ctx context.Context, callback func(x, y int, paths []string))

This can be used to handle the wails:file-drop event with a callback that handles the casting and checking the event's interface{} data.

OnFileDropOff(ctx context.Context) 

Remove the listener.

Javascript

OnFileDrop(callback: (x: number, y: number, paths: string[]) => void, useDropTarget: boolean) :void

Calls the callback function with the coordinates inside the window where the drag was released and a slice of absolute file paths.

When the useDropTarget is true in addition to calling the callback when the drop happens, it registers event listeners on
the window that are listening for the drag coordinates and checks if the mouse is over an element that has the
CSSDropProperty style. If the element has the required property
it adds the wails-drop-target-active class to the element's class list and removes it when the mouse moves off of it.

OnFileDropOff(): void

This method removes all registered listeners and handlers for drag and drop events.

Without runtime methods

You can simply listen to the wails:file-drop and handle it as you like.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Windows 10
  • Windows 11
  • Linux Ubuntu 20.04 - X
  • Linux Ubuntu 23.10 - X
  • Linux Ubuntu 23.10 - Wayland

I tested it on multiple machines. On all systems I tested dropping in files and folders a combination of them slowly and fast, in-and-out. Sorry cannot describe my "method" better.

Test Configuration

Windows:

# Wails
Version  | v2.7.1
Revision | e49e8894edd298dcffcfa4523f7a5ed469d75c33
Modified | true

# System
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                                    |
| Version      | 2009 (Build: 22631)                                                               |
| ID           | 23H2                                                                              |
| Go Version   | go1.21.5                                                                          |
| Platform     | windows                                                                           |
| Architecture | amd64                                                                             |
| CPU          | AMD Ryzen 5 6600H with Radeon Graphics                                            |
| GPU 1        | AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.) - Driver: 31.0.12046.13002 |
| GPU 2        | NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA) - Driver: 31.0.15.4633                |
| Memory       | 16GB                                                                              |
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version        |
| WebView2   | N/A          | Installed | 120.0.2210.133 |
| Nodejs     | N/A          | Installed | 18.18.0        |
| npm        | N/A          | Installed | 10.1.0         |
| *upx       | N/A          | Installed | upx 4.2.2      |
| *nsis      | N/A          | Available |                |
└─────────────── * - Optional Dependency ────────────────┘

# Diagnosis
Optional package(s) installation details:
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Linux:

# Wails
Version         | v2.7.1                                  
Revision        | 66f82e9cdb894486f6df1de4cbf55c465c8912bf
Modified        | true                                    
Package Manager | apt                                     

# System
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Ubuntu                                                                                           |
| Version      | 23.10                                                                                            |
| ID           | ubuntu                                                                                           |
| Go Version   | go1.21.6                                                                                         |
| Platform     | linux                                                                                            |
| Architecture | amd64                                                                                            |
| CPU          | AMD Ryzen 7 3700X 8-Core Processor                                                               |
| GPU          | Navi 23 [Radeon RX 6600/6600 XT/6600M] (Advanced Micro Devices, Inc. [AMD/ATI]) - Driver: amdgpu |
| Memory       | 32GB                                                                                             |
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌──────────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name          | Status    | Version                 |
| *docker    | docker.io             | Installed | 24.0.7                  |
| gcc        | build-essential       | Installed | 12.10ubuntu1            |
| libgtk-3   | libgtk-3-dev          | Installed | 3.24.38-5ubuntu1        |
| libwebkit  | libwebkit2gtk-4.0-dev | Installed | 2.42.4-0ubuntu0.23.10.1 |
| npm        | npm                   | Installed | 9.8.0                   |
| *nsis      | nsis                  | Installed | v3.09-1                 |
| pkg-config | pkg-config            | Installed | 1.8.1-2                 |
└──────────────────────── * - Optional Dependency ─────────────────────────┘

# Diagnosis
 SUCCESS  Your system is ready for Wails development!

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Introduced drag and drop support for files and folders on Windows and Linux platforms.
    • Implemented new JavaScript commands for setting CSS properties related to drag and drop.
  • Documentation

    • Updated options documentation to include new DragAndDrop configuration fields.
    • Added new runtime documentation for handling drag and drop operations.
  • Enhancements

    • Improved file drag and drop event handling with new callback registration functions.
    • Enhanced desktop runtime environment with drag and drop event management.
  • Bug Fixes

    • Removed quarantine attribute on macOS binaries to address execution issues.
    • Added documentation for a common GStreamer error on Linux systems.
    • Fixed dock icon right-click exit handling for improved user experience.

@coderabbitai

coderabbitai Bot commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Walkthrough

The recent updates to the codebase introduce native drag and drop functionality for files and folders, providing absolute paths without reliance on IE11. This enhancement streamlines the process across different browsers and platforms, specifically targeting Windows and Linux systems within the Wails framework, ensuring a more consistent and modern user experience.

Changes

Files Change Summary
v2/internal/frontend/dispatcher/dispatcher.go, .../draganddrop.go Semantic change in dispatcher.go to handle 'D' messages and introduce processDragAndDropMessage method. New file draganddrop.go for parsing drag and drop messages.
v2/internal/frontend/runtime/desktop/draganddrop.js, .../main.js, .../runtime_prod_desktop.js, .../wrapper/runtime.d.ts, .../wrapper/runtime.js Added functionality for drag and drop events in desktop runtime, including handling file drops and managing drag events.
v2/pkg/options/options.go Updated App struct with DragAndDrop field and introduced DragAndDrop type for drag and drop behavior properties.
v2/pkg/runtime/draganddrop.go Added functions for file drag and drop event handling, including registering callbacks and removing event listeners.
website/docs/reference/options.mdx Added DragAndDrop section to options struct with fields for configuring drag and drop behavior.
website/docs/reference/runtime/draganddrop.mdx Documentation for drag and drop operations in the runtime environment, covering enabling file dropping and managing drop events.
website/src/pages/changelog.mdx Added drag and drop support for files and folders on Windows and Linux, removed quarantine attribute on macOS binaries, and implemented dock icon right-click exit handling.

Assessment against linked issues

Objective Addressed Explanation
Enable native drag and drop for files and folders in Wails v1.16.8 on Windows without IE11 (Issue #1090)
Ensure dragged files and folders provide their absolute paths (Issue #1090)
Remove dependency on IE11 for drag and drop functionality (Issue #1090)
Implement a solution that works across different browsers (Issue #1090)
Allow drag and drop for both files and folders, including absolute paths (Issue #1090)

Poem

Files and folders dance in code's embrace,
Paths revealed with elegance and grace.
IE11 departs, a modern leap,
Wails and rabbits, a drag-and-drop sweep!
🐇📂💫

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 12d6336 and 9d69b38.
Files selected for processing (17)
  • v2/internal/frontend/desktop/linux/frontend.go (1 hunks)
  • v2/internal/frontend/desktop/linux/window.c (3 hunks)
  • v2/internal/frontend/desktop/linux/window.go (1 hunks)
  • v2/internal/frontend/desktop/linux/window.h (1 hunks)
  • v2/internal/frontend/desktop/windows/frontend.go (5 hunks)
  • v2/internal/frontend/dispatcher/dispatcher.go (2 hunks)
  • v2/internal/frontend/dispatcher/draganddrop.go (1 hunks)
  • v2/internal/frontend/runtime/desktop/draganddrop.js (1 hunks)
  • v2/internal/frontend/runtime/desktop/main.js (4 hunks)
  • v2/internal/frontend/runtime/runtime_prod_desktop.js (1 hunks)
  • v2/internal/frontend/runtime/wrapper/runtime.d.ts (1 hunks)
  • v2/internal/frontend/runtime/wrapper/runtime.js (1 hunks)
  • v2/pkg/options/options.go (3 hunks)
  • v2/pkg/runtime/draganddrop.go (1 hunks)
  • website/docs/reference/options.mdx (2 hunks)
  • website/docs/reference/runtime/draganddrop.mdx (1 hunks)
  • website/src/pages/changelog.mdx (1 hunks)
Additional comments: 28
v2/internal/frontend/dispatcher/draganddrop.go (1)
  • 9-37: The implementation of processDragAndDropMessage correctly parses the message, validates the data, and emits a wails:file-drop event with the coordinates and paths.
v2/pkg/runtime/draganddrop.go (1)
  • 8-33: The functions OnFileDrop and OnFileDropOff are correctly implemented to manage drag and drop event listeners and callbacks.
v2/internal/frontend/dispatcher/dispatcher.go (1)
  • 49-50: The addition of the case for 'D' messages in ProcessMessage correctly delegates the processing of drag and drop messages to the processDragAndDropMessage method.
website/docs/reference/runtime/draganddrop.mdx (1)
  • 1-42: The documentation in draganddrop.mdx is clear and provides the necessary details for using the drag and drop functionality in the Wails framework.
v2/internal/frontend/desktop/linux/window.h (1)
  • 109-109: The SetupWebview function has been correctly updated to accept additional parameters for controlling drag and drop functionality.
v2/internal/frontend/runtime/wrapper/runtime.js (1)
  • 202-237: The new functions OnFileDrop, OnFileDropOff, CanResolveFilePaths, and ResolveFilePaths have been correctly added to handle drag and drop events and file path resolution.
v2/internal/frontend/runtime/desktop/main.js (2)
  • 19-19: The import and integration of the DragAndDrop module into the runtime object are correctly implemented.
  • 119-122: The function setCSSDropProperties has been correctly added to allow customization of CSS properties for drag and drop.
v2/pkg/options/options.go (2)
  • 153-164: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [98-161]

The App struct has been correctly updated to include a DragAndDrop field, and the MergeDefaults function has been updated to handle its properties.

  • 192-207: The new DragAndDrop type with properties related to drag and drop behavior is correctly defined and integrated into the App struct.
v2/internal/frontend/runtime/desktop/draganddrop.js (1)
  • 1-217: The functions in draganddrop.js for handling drag and drop events, such as OnFileDrop and OnFileDropOff, are correctly implemented.
v2/internal/frontend/runtime/wrapper/runtime.d.ts (1)
  • 237-249: The TypeScript declarations for the new drag and drop functions are correctly added and match the implementation in runtime.js.
v2/internal/frontend/runtime/runtime_prod_desktop.js (1)
  • 1-1: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [104-461]

The changes in runtime_prod_desktop.js include renaming of variables and functions, reordering of functions, and the addition of drag and drop functionality. The drag and drop functionality is implemented as per the PR objectives, and the code changes are consistent with the expected behavior for enabling drag and drop on the frontend.

v2/internal/frontend/desktop/linux/frontend.go (1)
  • 445-461: The modifications to the processMessage function in frontend.go correctly include JavaScript commands to set CSS drop properties and enable drag and drop functionality. This aligns with the PR objectives to introduce drag and drop capabilities in the Wails framework for Linux.
v2/internal/frontend/desktop/linux/window.go (1)
  • 104-105: The NewWindow function in window.go has been updated to handle drag and drop options, which is consistent with the PR's goal of adding native drag and drop support. The use of appoptions.DragAndDrop.Disable and appoptions.DragAndDrop.EnableFileDrop ensures that the window creation respects the configuration for drag and drop functionality.
v2/internal/frontend/desktop/linux/window.c (3)
  • 7-7: The inclusion of <string.h> is appropriate for string manipulation functions used in the drag and drop implementation.
  • 433-498: The implementation of drag and drop functionality with onDragDataReceived and onDragDrop functions is correct and follows the GTK signal handling conventions.
  • 500-518: The conditional logic to enable or disable drag and drop behavior in SetupWebview is correct and respects the disableWebViewDragAndDrop and enableDragAndDrop flags.
v2/internal/frontend/desktop/windows/frontend.go (7)
  • 19-19: The import of the "unsafe" package is necessary for pointer arithmetic used in the drag and drop feature.
  • 465-469: The handling of drag and drop functionality in the setupChromium function with the AllowExternalDrag method is correct.
  • 472-472: The addition of processMessageWithAdditionalObjects and dispatchMessage functions is appropriate for managing messages and file drops.
  • 684-692: The JavaScript command to set CSS properties for drag and drop is correctly formatted and executed.
  • 713-714: The use of a goroutine to dispatch messages asynchronously is a good practice for non-blocking UI operations.
  • 716-768: The processMessageWithAdditionalObjects function correctly handles the drag and drop messages, extracting file paths and coordinates.
  • 833-835: The JavaScript command to enable Wails drag and drop functionality is correctly executed during navigation completion.
website/docs/reference/options.mdx (2)
  • 67-72: The addition of the DragAndDrop struct within the Options.App struct is correctly documented and follows the existing documentation style.
  • 537-588: The documentation for the new DragAndDrop section is clear, well-structured, and provides all necessary details for the new feature, including default values and behavior on different platforms.
website/src/pages/changelog.mdx (1)
  • 21-27: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-23]

Comment thread website/src/pages/changelog.mdx Outdated
Comment thread v2/internal/frontend/desktop/linux/window.c Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9d69b38 and 4edd80b.
Files selected for processing (1)
  • website/src/pages/changelog.mdx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • website/src/pages/changelog.mdx

@lyimmi

lyimmi commented Jan 16, 2024

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 4edd80b and bbef47d.
Files selected for processing (1)
  • v2/internal/frontend/desktop/linux/window.c (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • v2/internal/frontend/desktop/linux/window.c

@risico

risico commented Jan 22, 2024

Copy link
Copy Markdown

Hi @lyimmi! I was wondering if I could help you add this for MacOS. Reading from your Issue thread:

On mac I think the implementation would be the same as on Linux. But I'm not versed in the magic of macOs develpement.

But in this PR we've:

macOS
No solution for macOS.

I assume a solution would be possible but you haven't looked into it, or you actually meant there's no solution for MacOS?

@lyimmi

lyimmi commented Jan 22, 2024

Copy link
Copy Markdown
Contributor Author

@risico I meant that, I have no solution for macOS. That would be nice if you could help with the macOS implementation!

I have no device to test it on, I tried a macOS VM a few times, but it is painfully slow so I gave up on it for now.

@pavelbinar

Copy link
Copy Markdown
Contributor

Hi @lyimmi, this is fantastics! Thank you for pushing this through.

@leaanthony If this is merged do you plan to put it into v2 or v3?

I am asking because my team is considering adding support for Mac (if @lyimmi can guide us a bit), but we would love to see it in production sooner then later.

CC: @jakubpeleska

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bbef47d and 905725e.
Files selected for processing (1)
  • website/src/pages/changelog.mdx (1 hunks)
Additional comments: 1
website/src/pages/changelog.mdx (1)
  • 25-25: The changelog entry for adding Drag & Drop support for Windows and Linux is clear and well-documented. It properly credits the contributors and is consistent with the format of the rest of the changelog.

@leaanthony

leaanthony commented Feb 2, 2024

Copy link
Copy Markdown
Member

@pavelbinar - I'm ok with this going into v2. The v3 solution is purely at the window level. Having it at the DOM level would be great and a far better experience. TLDR; Go for it and I'll port to v3 👍

@leaanthony

Copy link
Copy Markdown
Member

@lyimmi - did this need any updates to go-webview2?

@lyimmi

lyimmi commented Feb 2, 2024

Copy link
Copy Markdown
Contributor Author

@leaanthony - no I just checked out the master and everything I needed was already there, didn't touched any dependecies.

@pavelbinar - I'm happy to help if I can.

@lyimmi

lyimmi commented Feb 2, 2024

Copy link
Copy Markdown
Contributor Author

I'm not too familiar how github works regarding pushing changes to a PR from a fork. Should @pavelbinar push changes to my fork?

Should I set this PR to draft until the mac side is done?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 905725e and 8cb7630.
Files selected for processing (1)
  • v2/pkg/runtime/draganddrop.go (1 hunks)
Additional comments: 1
v2/pkg/runtime/draganddrop.go (1)
  • 33-36: The method OnFileDropOff correctly removes the event listener for drag and drop. This is a straightforward and effective implementation.

Comment thread v2/pkg/runtime/draganddrop.go
Comment thread v2/pkg/runtime/draganddrop.go
Comment thread v2/pkg/runtime/draganddrop.go
Comment thread v2/pkg/runtime/draganddrop.go
@leaanthony

Copy link
Copy Markdown
Member

Having fun @lyimmi ? 😉

@lyimmi

lyimmi commented Feb 3, 2024

Copy link
Copy Markdown
Contributor Author

@leaanthony Yeah. It's pretty good actually. But I'm done now... Sorry. 😁

@pavelbinar

Copy link
Copy Markdown
Contributor

@leaanthony - Thank you for the clarification.

@lyimmi - I appreciate your willingness to help. We will get in touch within a few weeks (may we connect via email?). I will reach out to you later, once we are more familiar with the code and have some questions. Currently, I am exploring the options and preparing the work.

Regarding the PR:
Ideally, @leaanthony would merge your PR into a separate feature branch (instead of master), and later on, we will submit a separate PR based on this feature branch. This way, once all platforms are accounted for, @leaanthony can merge the complete feature branch into master and celebrate with a 🍺

@leaanthony

leaanthony commented Feb 6, 2024

Copy link
Copy Markdown
Member

I've created feature/1090_native_drag_and_drop_for_file_and_folder for this 👍
Thanks @pavelbinar for looking into it 🙏

@leaanthony leaanthony changed the base branch from master to feature/1090_native_drag_and_drop_for_file_and_folder February 6, 2024 06:15
…into feature/1090_native_drag_and_drop_for_file_and_folder
@leaanthony leaanthony merged commit f9df564 into wailsapp:feature/1090_native_drag_and_drop_for_file_and_folder Feb 6, 2024
@pavelbinar

Copy link
Copy Markdown
Contributor

@lyimmi 🎉
Well done

@leaanthony perfect 👌🏻

@lyimmi lyimmi deleted the feature/1090_native_drag_and_drop_for_file_and_folder branch February 6, 2024 21:52
@jakubpeleska jakubpeleska mentioned this pull request May 28, 2024
12 tasks
leaanthony added a commit that referenced this pull request Jun 10, 2024
* Feature/1090 native drag and drop for file and folder (#3203)

* implement basic dnd for linux

* implemented windows

* progress changed linux handling and added coordinates to drop

* progress fix drop coordinates on windows

* progress remove log from windows

* progress move js

* update js after merge

* fix event listener registration

* fix segfault on non file drag

* remove logs, fix coordinates

* minor changes, simplify to drop only

* rename EnableWails -> EnableFileDrop

* add documentation (PR id missing)

* add PR id to changelog

* fix remove casting from malloc

* fix nil check for OnFileDrop's callback

* fix nil check for OnFileDrop skip event when nil

* add error message for nil callback in OnFileDrop

---------

Co-authored-by: lyimmi <lelvente.zambo@gmail.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>

* implement native drag and drop for macOS (#3250)

* implement native drag and drop for macOS

* update docs

* add to changelog

* update docs (macOS is supported)

* Fix windows DragAndDrop options

* Fix class unset on dragleave for full frame elements

* improve class unset (nested elements and borders case)

* Fix runtime drop target detection and CSS class assignment

* Edit changelog

* Fix drag-and-drop options in references

* Update v2/internal/frontend/desktop/darwin/WailsWebView.m

* Update v2/internal/frontend/desktop/darwin/WailsWebView.m

---------

Co-authored-by: Zámbó, Levente <levente.zambo@gmail.com>
Co-authored-by: lyimmi <lelvente.zambo@gmail.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Andrey Pshenkin <andrey.pshenkin@gmail.com>
Co-authored-by: Pavel Binar <pavel@beamtransfer.io>
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.

[FEAT]: Native drap and drop for file and folder with complete filepath

4 participants