mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3748] [GUI] pasting a screenshot with Ctrl+V does nothing in the message box #1574
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1574
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3748
Area
[GUI] (the desktop app)
Desktop app, Terminal or source?
Desktop app (Windows)
What happened
Copying a screenshot to the clipboard and pressing Ctrl+V in the message box does not attach it. Nothing appears in the composer: no thumbnail, no error, the box stays empty. Text paste still works, because the handler below only intercepts when it finds an image file.
The composer already has an image-paste handler, so pasting a screenshot is intended to work:
dGionly readsclipboardData.files. With a Win+Shift+S screenshot, that list is not yielding a file to this handler (the paste produces nothing), and the handler never looks atclipboardData.itemsortext/html.dGireturns[], the handler skipspreventDefault(), and the screenshot is silently ignored.The attach path itself is fine: the composer listens for
strata:drop-files(window.addEventListener("strata:drop-files", Ws)) and adds the files (hs.current(Ls.detail ?? [])); the+file picker (accept="image/*,...",Cs(Array.from(files))) and drag-and-drop use the same path. Only the clipboard extractor is missing theitemscase.Expected: Ctrl+V with an image on the clipboard attaches it to the composer, the same as the
+picker and drag-and-drop. If there is no image, the normal text paste should happen. A missing image should not fail silently.Possible fix (not tested): read
clipboardData.itemsas well:If
itemshas no image, fall back totext/html/text/uri-list; only callpreventDefault()when an image is found.Smallest steps or command that reproduce it
Expected: the screenshot is attached (thumbnail) and can be sent, like a file chosen with the
+button.Reproduction status
Reproduced locally
Strata version
Strata 0.2.2 · engine 0.1.47
Graphics card, memory and system
RTX 3080 Ti Laptop 16 GB · 64 GB RAM · Windows 11 (10.0.26300)
Model, size and settings
Swift 1.5 IQ3_XXS · 384K context (the paste path is model-independent)
Logs
No engine log: this is client-side clipboard handling. Evidence from the installed 0.2.2 bundle
host/dist/assets/index-DsqNG4H4.js:onPastehandler above;dGiiterates onlyclipboardData.files.strata:drop-filesis dispatched on paste; the composer listens for it and adds the files (hs.current(Ls.detail ?? [])), so the attachment path works when files are found.+file picker acceptsimage/*and adds images; drag-and-drop usesdataTransfer.files.dGithroughclipboardData.fileson this machine, and the handler does not inspectclipboardData.items.@Niko1221 commented on GitHub (Oct 26, 2026):
Fixed in 0.2.5: a screenshot pasted with Ctrl+V is attached to the message.