Skip to content

feat: Add drag-and-drop support and multi-file parsing#157

Open
metergames wants to merge 2 commits intopetertzy:mainfrom
metergames:main
Open

feat: Add drag-and-drop support and multi-file parsing#157
metergames wants to merge 2 commits intopetertzy:mainfrom
metergames:main

Conversation

@metergames
Copy link
Copy Markdown
Contributor

This PR adds drag-and-drop file opening support to the app, allowing users to open supported files by dragging them into the app window or tabs. The implementation gracefully handles multiple files and various drag-and-drop payload formats. The README is updated to document the feature.

Closes #156

Drag-and-Drop File Support:

  • Added drag-and-drop file opening for .md, .markdown, .html, .htm, and .pdf files using tkinterdnd2 when available, with fallback to standard window if not.
  • Registered drag-and-drop targets for the main window, notebook, and editor tabs, and implemented a handler.

@petertzy
Copy link
Copy Markdown
Owner

We actually already implemented this PR earlier. However, there is still an unresolved issue.

When users are on Apple Silicon (M-series), they may encounter an architecture mismatch:

  • Python is running as arm64
  • tkdnd is compiled as x86_64

This leads to runtime errors due to incompatible binaries.

It might work fine in your specific environment, but since users can have different systems and hardware configurations, a proper solution should cover these common scenarios.

From my research, there is currently no reliable and universal fix for this mismatch in setups like mine. Therefore, I would prefer to wait until the official library/plugin provides proper support before introducing this feature.

In the meantime, feel free to continue investigating possible solutions for the architecture compatibility issue. You can either keep improving the implementation or wait for an official update that resolves it. Thanks.

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.

Drag and Drop shows 'not allowed' cursor / missing UI bindings

2 participants