mirror of
https://github.com/TommyFang2077/dsh-desktop.git
synced 2026-08-17 09:06:36 +08:00
fix: read Linux clipboard images natively and ingest them as paste
GTK/wl-paste/xclip fallbacks plus a paste-event path so ModLens can take over image paste instead of only synthesizing drop. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,22 @@ class VisionPluginFilesTests(unittest.TestCase):
|
||||
self.assertIn("example: 'haiku'", host)
|
||||
|
||||
|
||||
class ClipboardIngestTests(unittest.TestCase):
|
||||
def test_inject_delivers_images_as_paste_not_only_drop(self):
|
||||
ingest = (ROOT / "ui" / "inject" / "ingest.js").read_text(encoding="utf-8")
|
||||
chrome = (ROOT / "ui" / "inject" / "chrome.js").read_text(encoding="utf-8")
|
||||
self.assertIn("window.__dshDesktopIngestFiles", ingest)
|
||||
self.assertIn("/modlens/paste", ingest)
|
||||
self.assertIn("ClipboardEvent", ingest)
|
||||
self.assertIn("navigator.clipboard.read", chrome)
|
||||
self.assertIn("read_clipboard_images", chrome)
|
||||
self.assertIn("__dshDesktopIngesting", chrome)
|
||||
self.assertNotIn(
|
||||
'item.kind === "file" && item.getAsFile()',
|
||||
chrome,
|
||||
)
|
||||
|
||||
|
||||
class BundledAttributionTests(unittest.TestCase):
|
||||
def test_readme_cites_upstream_plugins(self):
|
||||
readme = (ROOT / "README.md").read_text(encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user