Skip to content
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

[V3] fix drag n drop example not running #3742

Conversation

Etesam913
Copy link

@Etesam913 Etesam913 commented Sep 12, 2024

Description

  • Replaces the usage of app.customEventProcessor with app.EmitEvent.
  • It seems like app.customEventProcessor does not exist

Video of the example working

Screen.Recording.2024-09-12.at.1.01.32.AM.mov

Fixes #3741

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.

# System
┌────────────────────────────┐
| Name          | MacOS      |
| Version       | 15.0       |
| ID            | 24A5331b   |
| Branding      | MacOS 15.0 |
| Platform      | darwin     |
| Architecture  | arm64      |
| Apple Silicon | true       |
| CPU           | Apple M2   |
| CPU           | Unknown    |
| GPU           | Unknown    |
| Memory        | Unknown    |
└────────────────────────────┘

# Build Environment
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-alpha.6                                                                                                            |
| Go Version     | go1.23.1                                                                                                                  |
| Revision       | ef8c886b101ab13258998cbb0cfca36db5b110e4                                                                                  |
| Modified       | false                                                                                                                     |
| -buildmode     | exe                                                                                                                       |
| -compiler      | gc                                                                                                                        |
| CGO_CFLAGS     |                                                                                                                           |
| CGO_CPPFLAGS   |                                                                                                                           |
| CGO_CXXFLAGS   |                                                                                                                           |
| CGO_ENABLED    | 1                                                                                                                         |
| CGO_LDFLAGS    |                                                                                                                           |
| DefaultGODEBUG | asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1 |
| GOARCH         | arm64                                                                                                                     |
| GOARM64        | v8.0                                                                                                                      |
| GOOS           | darwin                                                                                                                    |
| vcs            | git                                                                                                                       |
| vcs.modified   | false                                                                                                                     |
| vcs.revision   | ef8c886b101ab13258998cbb0cfca36db5b110e4                                                                                  |
| vcs.time       | 2024-09-08T22:36:19Z                                                                                                      |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────────────┐
| Xcode cli tools | 2409                                                 |
| npm             | 10.8.1                                               |
| *NSIS           | Not Installed. Install with `brew install makensis`. |
└─────────────────────── * - 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

    • Improved drag-and-drop functionality with a fix for the custom event processor.
  • Bug Fixes

    • Resolved a Linux compile error related to IgnoreMouseEvents.
    • Fixed syso icon file generation issue on Windows.
    • Addressed native operation issues in Wayland on Linux.
  • Refactor

    • Simplified event handling logic for dropped files in the drag-and-drop example.

@Etesam913 Etesam913 changed the base branch from master to v3-alpha September 12, 2024 04:58
Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

The pull request introduces a fix for the customEventProcessor bug in the drag-and-drop example, enhancing its functionality. It simplifies the event handling logic in the main.go file by replacing a verbose event emission structure with a more concise call to app.EmitEvent. Additionally, it addresses various platform-specific issues, including a Linux compile error and a Windows icon file generation problem, improving overall application stability across different environments.

Changes

Files Change Summary
mkdocs-website/docs/en/changelog.md Added a fix for customEventProcessor in the drag-and-drop example.
v3/examples/drag-n-drop/main.go Simplified event handling logic by replacing verbose event emission with a direct call to app.EmitEvent.

Assessment against linked issues

Objective Addressed Explanation
Fix the customEventProcessor bug in example (#[3741])
Ensure the drag-and-drop example runs without errors (#[3741])

🐰 In the meadow, where bunnies play,
A fix was made, hip-hip-hooray!
The drag-and-drop now works just right,
With events that dance, oh what a sight!
Bugs are gone, stability's here,
Hopping along, we have nothing to fear! 🌼✨


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ef8c886 and ce1e2f6.

Files selected for processing (2)
  • mkdocs-website/docs/en/changelog.md (1 hunks)
  • v3/examples/drag-n-drop/main.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • v3/examples/drag-n-drop/main.go
Additional comments not posted (1)
mkdocs-website/docs/en/changelog.md (1)

29-29: LGTM!

The changelog entry accurately captures the fix for the customEventProcessor bug in the drag-n-drop example, as described in the PR objectives. It follows the proper format and provides relevant details for future reference.


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 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

@Etesam913 Etesam913 changed the title V3 alpha fix custom event processor for drag n drop [V3] fix drag n drop example not running Sep 12, 2024
@leaanthony
Copy link
Member

Thanks for this! It was a side-effect of a recent change. Appreciate you picking this up.
Please could you add an entry to the changelog located at mkdocs-website/docs/changelog.md? Thanks!

Copy link

@Etesam913
Copy link
Author

I added an entry to the changelog.

@leaanthony leaanthony enabled auto-merge (squash) September 12, 2024 19:40
@leaanthony leaanthony disabled auto-merge September 12, 2024 19:40
@leaanthony leaanthony enabled auto-merge (squash) September 12, 2024 19:40
@leaanthony leaanthony disabled auto-merge September 12, 2024 19:40
@leaanthony leaanthony merged commit b30cea0 into wailsapp:v3-alpha Sep 12, 2024
10 of 11 checks passed
@Etesam913 Etesam913 deleted the v3-alpha-fix-customEventProcessor-for-drag-n-drop branch September 17, 2024 23:50
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.

[v3] Drag n drop example is not running
2 participants