Skip to content

Comments

fix: use joplin.clipboard API for copy#110

Open
PierreLga456 wants to merge 1 commit intocqroot:mainfrom
PierreLga456:fix/clipboard-clean
Open

fix: use joplin.clipboard API for copy#110
PierreLga456 wants to merge 1 commit intocqroot:mainfrom
PierreLga456:fix/clipboard-clean

Conversation

@PierreLga456
Copy link

This PR replaces the deprecated navigator.clipboard call
with Joplin's native joplin.clipboard API.

✅ Works on macOS (Sequoia/Tahoe) and Linux (Mint Cinnamon)

@PierreLga456
Copy link
Author

🧾 Pull Request Description (ready-to-copy)

Summary
This PR fixes the clipboard copy feature by replacing deprecated browser clipboard access with Joplin’s official API.

Details
• Replaces navigator.clipboard.writeText() with await joplin.clipboard.writeText()
• Removes all joplin.views.dialogs.showMessageBox() calls that caused blocking issues (notably on Linux GTK)
• Keeps user feedback handled directly by the Outline panel, avoiding redundant popups
• Improves UX consistency and reliability across platforms

Tested on
• ✅ macOS 15.0 “Tahoe” (Apple Silicon)
• ✅ Linux Mint Cinnamon (T2 hardware)
• No regressions, no crashes, clipboard works instantly

Why it matters
The previous implementation triggered modal dialogs that could freeze the UI on Linux and interrupt workflow.
This patch ensures seamless copy operations using Joplin’s own clipboard API, aligning with plugin API best practices.

@cqroot
Copy link
Owner

cqroot commented Oct 12, 2025

Hi, thank you for your contribution. I've just released version 1.5.15, and this PR #108 should have fixed your issue.

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