Skip to content

[v3 alpha test] HTML Drag and Drop API test#3856

Merged
leaanthony merged 3 commits into
wailsapp:v3-alphafrom
FerroO2000:v3-alpha
Oct 29, 2024
Merged

[v3 alpha test] HTML Drag and Drop API test#3856
leaanthony merged 3 commits into
wailsapp:v3-alphafrom
FerroO2000:v3-alpha

Conversation

@FerroO2000

@FerroO2000 FerroO2000 commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

Description

Add test in examples folder for the HTML Drag and Drop API.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

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 a README file detailing the HTML Drag and Drop API example, including expected behaviors and console messages.
    • Added a new HTML file demonstrating drag-and-drop functionality with visual feedback and event logging.
    • Launched a Go application using the Wails framework to showcase the drag-and-drop capabilities.
    • Updated changelog to reflect new features, including templates for SvelteKit and enhancements in Windows environment support.
  • Bug Fixes

    • Noted functionality issues on Windows, with successful operation confirmed on Mac.
    • Addressed various bugs related to drag-and-drop functionality and compile errors on Linux.
  • Documentation

    • Provided instructions for running and building the example, along with a platform compatibility status table.

@coderabbitai

coderabbitai Bot commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The changes introduce a new example for the HTML Drag and Drop API in the v3/examples/html-dnd-api directory. This includes a README file detailing the drag-and-drop functionality, an HTML file implementing the drag-and-drop interface, and a Go application that serves the example using the Wails framework. The README outlines expected behaviors and console messages during drag events, while the HTML file provides the structure and event handling for the drag-and-drop interactions. The Go application manages the embedding of assets and initializes the desktop application.

Changes

File Path Change Summary
v3/examples/html-dnd-api/README.md New file added; outlines drag-and-drop functionality, console messages, running instructions, and platform status.
v3/examples/html-dnd-api/assets/index.html New file added; implements HTML Drag and Drop API with event listeners and styling for draggable and drop target elements.
v3/examples/html-dnd-api/main.go New file added; initializes a Go application using Wails, embeds assets, and handles application lifecycle.
mkdocs-website/docs/en/changelog.md Updated changelog to include new features, changes, and fixes, including the HTML Drag and Drop API example.

Possibly related PRs

Suggested reviewers

  • leaanthony

Poem

In a world of drag and drop,
A rabbit hops, and won’t stop.
With colors bright and messages clear,
It plays with joy, no hint of fear.
From Mac to Linux, it takes a leap,
In the land of code, its dreams run deep! 🐇✨


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>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@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.

Actionable comments posted: 7

🧹 Outside diff range and nitpick comments (2)
v3/examples/html-dnd-api/main.go (1)

38-40: Enhance error handling

The current error handling could be more descriptive to aid in debugging.

if err != nil {
-	log.Fatal(err.Error())
+	log.Fatalf("Failed to run application: %v", err)
}
v3/examples/html-dnd-api/assets/index.html (1)

4-5: Update page title to be more descriptive

The current title "Title" is generic. Consider changing it to match the purpose of the demo, such as "HTML Drag and Drop API Demo" to maintain consistency with the h1 heading.

-    <title>Title</title>
+    <title>HTML Drag and Drop API Demo</title>
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 308304b and 3408272.

📒 Files selected for processing (3)
  • v3/examples/html-dnd-api/README.md (1 hunks)
  • v3/examples/html-dnd-api/assets/index.html (1 hunks)
  • v3/examples/html-dnd-api/main.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • v3/examples/html-dnd-api/README.md
🔇 Additional comments (2)
v3/examples/html-dnd-api/main.go (2)

11-12: LGTM!

The assets embedding is correctly implemented using the go:embed directive.


16-25: Consider adding cross-platform window configurations

The application configuration includes Mac-specific options but lacks corresponding Windows and Linux configurations for consistency across platforms.

Consider adding platform-specific configurations for Windows and Linux users. For example:

app := application.New(application.Options{
	Name:        "HTML Drag and Drop API Demo",
	Description: "A demo of the HTML Drag and drop API",
	Assets: application.AssetOptions{
		Handler: application.BundledAssetFileServer(assets),
	},
	Mac: application.MacOptions{
		ApplicationShouldTerminateAfterLastWindowClosed: true,
	},
+	Windows: application.WindowsOptions{
+		// Add Windows-specific configurations
+		WebviewUserDataPath: "dragdrop-demo",
+	},
+	Linux: application.LinuxOptions{
+		// Add Linux-specific configurations
+		Icon: application.LinuxIconOptions{},
+	},
})

Comment thread v3/examples/html-dnd-api/main.go
Comment on lines +27 to +34
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "Drag-n-drop Demo",
Mac: application.MacWindow{
Backdrop: application.MacBackdropTranslucent,
TitleBar: application.MacTitleBarHiddenInsetUnified,
InvisibleTitleBarHeight: 50,
},
})

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.

🛠️ Refactor suggestion

Enhance window configuration

The window configuration could be improved in several ways:

  1. No initial URL/path is specified for the window to load
  2. Window dimensions are not specified, which could lead to inconsistent sizing
  3. The Mac-specific window configuration might need corresponding settings for other platforms

Consider enhancing the window configuration:

app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
	Title: "Drag-n-drop Demo",
+	URL: "/",  // Specify the initial page to load
+	Width: 800,
+	Height: 600,
	Mac: application.MacWindow{
		Backdrop:                application.MacBackdropTranslucent,
		TitleBar:                application.MacTitleBarHiddenInsetUnified,
		InvisibleTitleBarHeight: 50,
	},
+	Windows: application.WindowsWindow{
+		// Add Windows-specific window configurations
+	},
})

Committable suggestion was skipped due to low confidence.

Comment on lines +19 to +21
Assets: application.AssetOptions{
Handler: application.BundledAssetFileServer(assets),
},

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.

💡 Codebase verification

Based on the search results, I can now generate a final response since I have enough information about the security configurations and asset serving implementation:

Add security headers for asset server

The current implementation lacks essential security headers. While there is a middleware capability available, it's not being used to set security headers except for cache control in one example. To enhance security, you should add a middleware that sets the following security headers:

  • Content-Security-Policy (CSP)
  • X-Frame-Options
  • X-Content-Type-Options
  • Strict-Transport-Security (HSTS)

Example implementation:

Assets: application.AssetOptions{
    Handler: application.BundledAssetFileServer(assets),
    Middleware: func(next http.Handler) http.Handler {
        return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
            w.Header().Set("Content-Security-Policy", "default-src 'self'")
            w.Header().Set("X-Frame-Options", "DENY")
            w.Header().Set("X-Content-Type-Options", "nosniff")
            w.Header().Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains")
            next.ServeHTTP(w, r)
        })
    },
},
🔗 Analysis chain

Verify security headers and CSP configuration

When serving web content in a desktop application, it's important to configure appropriate security headers and Content Security Policy (CSP).

Let's check if the codebase has any security configurations:


Let me try another search strategy to gather more information about the security configurations and asset serving implementation.

This should help us understand:

  1. How the asset server is implemented
  2. If there are any security middlewares in place
  3. How the HTTP server is configured
  4. If there are any header configurations in the handlers
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for security-related configurations in the codebase
echo "Searching for security header configurations..."
rg -i "content-security-policy|x-frame-options|x-content-type-options" 

echo "Searching for middleware or security setup..."
ast-grep --pattern 'SecurityHeaders|CSP|security'

Length of output: 330


Script:

#!/bin/bash
# Look for asset server implementation and security-related code
echo "Checking asset server implementation..."
rg -A 5 "BundledAssetFileServer" 

echo "Checking for any security middleware or handlers..."
rg -i "middleware|handler.*security"

echo "Looking for HTTP server setup..."
ast-grep --pattern 'http.Server|http.ListenAndServe'

echo "Checking for header configurations..."
rg -i "header.set|setheader|w.header"

Length of output: 78845

Comment on lines +36 to +73
<script type="module">
const draggable = document.getElementById('draggable');

draggable.addEventListener('dragstart', (event) => {
console.log('dragstart');
dropTarget.innerText = 'drop target';
});

draggable.addEventListener("drag", (event) => {
console.log('drag');
});

draggable.addEventListener("dragend", (event) => {
console.log('dragend');
});

const dropTarget = document.getElementById('dropTarget');

dropTarget.addEventListener('dragenter', (event) => {
console.log('dragenter');
});

dropTarget.addEventListener('dragleave', (event) => {
console.log('dragleave');
dropTarget.innerText = 'left drop target';
});

dropTarget.addEventListener('dragover', (event) => {
event.preventDefault()
console.log('dragover');
dropTarget.innerText = 'dragged over';
});

dropTarget.addEventListener('drop', (event) => {
console.log('drop');
dropTarget.innerText = 'dropped';
});
</script>

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.

⚠️ Potential issue

Add keyboard support for drag and drop operations

The current implementation only supports mouse interactions. Consider adding keyboard support for better accessibility.

Here's an example of how to implement keyboard support:

// Keyboard handling for drag and drop
const handleKeyboard = {
    keydown: (event) => {
        if (event.key === 'Enter' || event.key === ' ') {
            // Simulate drag start
            const dragEvent = new DragEvent('dragstart');
            draggable.dispatchEvent(dragEvent);
        }
        if (event.key === 'Escape') {
            // Cancel drag operation
            const dragEndEvent = new DragEvent('dragend');
            draggable.dispatchEvent(dragEndEvent);
        }
        if (event.key === 'Tab') {
            // Move focus between draggable and drop target
            dropTarget.focus();
        }
    }
};

// Add keyboard event listeners
draggable.addEventListener('keydown', handleKeyboard.keydown);

🛠️ Refactor suggestion

Enhance JavaScript implementation for robustness and maintainability

The current implementation has several areas for improvement:

  1. Console.log statements should be replaced with proper logging
  2. Missing error handling
  3. No cleanup of event listeners
  4. State management could be more robust
 <script type="module">
+    // Constants for DOM elements
     const draggable = document.getElementById('draggable');
+    const dropTarget = document.getElementById('dropTarget');
+    
+    // State management
+    let isDragging = false;
+    
+    // Logging utility
+    const logEvent = (eventName) => {
+        if (window.runtime) {
+            window.runtime.LogDebug(`Drag event: ${eventName}`);
+        } else {
+            console.log(`Drag event: ${eventName}`);
+        }
+    };
 
-    draggable.addEventListener('dragstart', (event) => {
-        console.log('dragstart');
-        dropTarget.innerText = 'drop target';
-    });
+    // Event handlers
+    const handlers = {
+        dragstart: (event) => {
+            try {
+                isDragging = true;
+                logEvent('dragstart');
+                dropTarget.innerText = 'drop target';
+                event.dataTransfer.setData('text/plain', '');
+            } catch (error) {
+                logEvent(`Error in dragstart: ${error.message}`);
+            }
+        },
 
-    draggable.addEventListener("drag", (event) => {
-        console.log('drag');
-    });
+        drag: (event) => {
+            logEvent('drag');
+        },
 
-    draggable.addEventListener("dragend", (event) => {
-        console.log('dragend');
-    });
+        dragend: (event) => {
+            try {
+                isDragging = false;
+                logEvent('dragend');
+            } catch (error) {
+                logEvent(`Error in dragend: ${error.message}`);
+            }
+        },
 
-    const dropTarget = document.getElementById('dropTarget');
+        dragenter: (event) => {
+            logEvent('dragenter');
+            if (isDragging) {
+                dropTarget.classList.add('drag-over');
+            }
+        },
 
-    dropTarget.addEventListener('dragenter', (event) => {
-        console.log('dragenter');
-    });
+        dragleave: (event) => {
+            logEvent('dragleave');
+            dropTarget.classList.remove('drag-over');
+            if (isDragging) {
+                dropTarget.innerText = 'left drop target';
+            }
+        },
 
-    dropTarget.addEventListener('dragleave', (event) => {
-        console.log('dragleave');
-        dropTarget.innerText = 'left drop target';
-    });
+        dragover: (event) => {
+            event.preventDefault();
+            logEvent('dragover');
+            if (isDragging) {
+                dropTarget.innerText = 'dragged over';
+            }
+        },
 
-    dropTarget.addEventListener('dragover', (event) => {
-        event.preventDefault()
-        console.log('dragover');
-        dropTarget.innerText = 'dragged over';
-    });
+        drop: (event) => {
+            try {
+                event.preventDefault();
+                logEvent('drop');
+                dropTarget.classList.remove('drag-over');
+                dropTarget.innerText = 'dropped';
+            } catch (error) {
+                logEvent(`Error in drop: ${error.message}`);
+            }
+        }
+    };
 
-    dropTarget.addEventListener('drop', (event) => {
-        console.log('drop');
-        dropTarget.innerText = 'dropped';
+    // Add event listeners
+    Object.entries(handlers).forEach(([event, handler]) => {
+        const element = event.startsWith('drop') ? dropTarget : draggable;
+        element.addEventListener(event, handler);
     });
+
+    // Cleanup on page unload
+    window.addEventListener('unload', () => {
+        Object.entries(handlers).forEach(([event, handler]) => {
+            const element = event.startsWith('drop') ? dropTarget : draggable;
+            element.removeEventListener(event, handler);
+        });
+    });
 </script>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<script type="module">
const draggable = document.getElementById('draggable');
draggable.addEventListener('dragstart', (event) => {
console.log('dragstart');
dropTarget.innerText = 'drop target';
});
draggable.addEventListener("drag", (event) => {
console.log('drag');
});
draggable.addEventListener("dragend", (event) => {
console.log('dragend');
});
const dropTarget = document.getElementById('dropTarget');
dropTarget.addEventListener('dragenter', (event) => {
console.log('dragenter');
});
dropTarget.addEventListener('dragleave', (event) => {
console.log('dragleave');
dropTarget.innerText = 'left drop target';
});
dropTarget.addEventListener('dragover', (event) => {
event.preventDefault()
console.log('dragover');
dropTarget.innerText = 'dragged over';
});
dropTarget.addEventListener('drop', (event) => {
console.log('drop');
dropTarget.innerText = 'dropped';
});
</script>
<script type="module">
// Constants for DOM elements
const draggable = document.getElementById('draggable');
const dropTarget = document.getElementById('dropTarget');
// State management
let isDragging = false;
// Logging utility
const logEvent = (eventName) => {
if (window.runtime) {
window.runtime.LogDebug(`Drag event: ${eventName}`);
} else {
console.log(`Drag event: ${eventName}`);
}
};
// Event handlers
const handlers = {
dragstart: (event) => {
try {
isDragging = true;
logEvent('dragstart');
dropTarget.innerText = 'drop target';
event.dataTransfer.setData('text/plain', '');
} catch (error) {
logEvent(`Error in dragstart: ${error.message}`);
}
},
drag: (event) => {
logEvent('drag');
},
dragend: (event) => {
try {
isDragging = false;
logEvent('dragend');
} catch (error) {
logEvent(`Error in dragend: ${error.message}`);
}
},
dragenter: (event) => {
logEvent('dragenter');
if (isDragging) {
dropTarget.classList.add('drag-over');
}
},
dragleave: (event) => {
logEvent('dragleave');
dropTarget.classList.remove('drag-over');
if (isDragging) {
dropTarget.innerText = 'left drop target';
}
},
dragover: (event) => {
event.preventDefault();
logEvent('dragover');
if (isDragging) {
dropTarget.innerText = 'dragged over';
}
},
drop: (event) => {
try {
event.preventDefault();
logEvent('drop');
dropTarget.classList.remove('drag-over');
dropTarget.innerText = 'dropped';
} catch (error) {
logEvent(`Error in drop: ${error.message}`);
}
}
};
// Add event listeners
Object.entries(handlers).forEach(([event, handler]) => {
const element = event.startsWith('drop') ? dropTarget : draggable;
element.addEventListener(event, handler);
});
// Cleanup on page unload
window.addEventListener('unload', () => {
Object.entries(handlers).forEach(([event, handler]) => {
const element = event.startsWith('drop') ? dropTarget : draggable;
element.removeEventListener(event, handler);
});
});
</script>

Comment on lines +26 to +34
<body>
<h1>HTML Drag and Drop API Demo</h1>
<br/>

<div id="draggable" draggable="true" >draggable</div>

<div id="dropTarget" >drop target</div>

</body>

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.

⚠️ Potential issue

Improve HTML semantics and accessibility

The current structure lacks proper semantic elements and accessibility attributes. Consider enhancing it for better screen reader support and user experience.

 <body>
-<h1>HTML Drag and Drop API Demo</h1>
-<br/>
+<main>
+    <h1>HTML Drag and Drop API Demo</h1>
 
-<div id="draggable" draggable="true" >draggable</div>
+    <div id="draggable" 
+         draggable="true"
+         role="button"
+         aria-label="Draggable item"
+         tabindex="0">
+        draggable
+    </div>
 
-<div id="dropTarget" >drop target</div>
+    <div id="dropTarget"
+         role="region"
+         aria-label="Drop target area"
+         tabindex="0">
+        drop target
+    </div>
+</main>
 </body>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<body>
<h1>HTML Drag and Drop API Demo</h1>
<br/>
<div id="draggable" draggable="true" >draggable</div>
<div id="dropTarget" >drop target</div>
</body>
<body>
<main>
<h1>HTML Drag and Drop API Demo</h1>
<div id="draggable"
draggable="true"
role="button"
aria-label="Draggable item"
tabindex="0">
draggable
</div>
<div id="dropTarget"
role="region"
aria-label="Drop target area"
tabindex="0">
drop target
</div>
</main>
</body>

Comment on lines +7 to +24
body{
background-color: white;
}

#draggable {
width: 100px;
height: 100px;
background-color: yellow;
text-align: center;
}

#dropTarget {
width: 200px;
height: 200px;
border: 2px solid red;
text-align: center;
}
</style>

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.

🛠️ Refactor suggestion

Enhance styling for better user experience and maintainability

Consider the following improvements:

  1. Add visual feedback for interactive states
  2. Use CSS variables for consistent colors and dimensions
  3. Add appropriate cursor styles for draggable elements
     <style>
+        :root {
+            --drag-color: #ffeb3b;
+            --drop-border-color: #f44336;
+            --hover-opacity: 0.8;
+        }
+
         body{
             background-color: white;
         }

         #draggable {
             width: 100px;
             height: 100px;
-            background-color: yellow;
+            background-color: var(--drag-color);
             text-align: center;
+            cursor: move;
+            transition: opacity 0.2s;
+        }
+        
+        #draggable:hover {
+            opacity: var(--hover-opacity);
         }

         #dropTarget {
             width: 200px;
             height: 200px;
-            border: 2px solid red;
+            border: 2px solid var(--drop-border-color);
             text-align: center;
+            transition: border-width 0.2s;
         }
+        
+        #dropTarget.drag-over {
+            border-width: 4px;
         }
     </style>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
body{
background-color: white;
}
#draggable {
width: 100px;
height: 100px;
background-color: yellow;
text-align: center;
}
#dropTarget {
width: 200px;
height: 200px;
border: 2px solid red;
text-align: center;
}
</style>
:root {
--drag-color: #ffeb3b;
--drop-border-color: #f44336;
--hover-opacity: 0.8;
}
body{
background-color: white;
}
#draggable {
width: 100px;
height: 100px;
background-color: var(--drag-color);
text-align: center;
cursor: move;
transition: opacity 0.2s;
}
#draggable:hover {
opacity: var(--hover-opacity);
}
#dropTarget {
width: 200px;
height: 200px;
border: 2px solid var(--drop-border-color);
text-align: center;
transition: border-width 0.2s;
}
#dropTarget.drag-over {
border-width: 4px;
}
</style>

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@leaanthony

Copy link
Copy Markdown
Member

Thanks 🙏 Please could you add an entry to the changelog located at mkdocs-website/docs/changelog.md? Thanks!

@sonarqubecloud

Copy link
Copy Markdown

@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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
mkdocs-website/docs/en/changelog.md (1)

23-23: Enhance the changelog entry description.

While the entry follows the correct format, consider making it more descriptive to better convey the purpose and value of this addition:

- Example to test the HTML Drag and Drop API by [FerroO2000](https://github.com/FerroO2000) in [#3856](https://github.com/wailsapp/wails/pull/3856)
+ Added example demonstrating HTML5 Drag and Drop API integration with Wails desktop applications by [FerroO2000](https://github.com/FerroO2000) in [#3856](https://github.com/wailsapp/wails/pull/3856)
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b8174db and 8667e41.

📒 Files selected for processing (1)
  • mkdocs-website/docs/en/changelog.md (1 hunks)

@leaanthony leaanthony merged commit f9d8032 into wailsapp:v3-alpha Oct 29, 2024
Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
* [v3 example] HTML dnd API test

* Update v3/examples/html-dnd-api/main.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* docs: add entry to changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

2 participants