Preview an image in a clipboard confirmation #30
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wayfinder:map
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeff/harrier#30
Loading…
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?
The Confirmation for Clipboard access names the Clipboard types and their sizes (#28), but an image is just
image/png, 1.2 MiB. Showing the image itself would let the user see what a program is about to put on the clipboard.Builder.imageis private and takes a kittyPlacement, so a preview needs a public way to draw an image of its own, with its own upload key.vt.sys.decode_png(wuffs on Linux, z2dimg on Windows).gtk-kitty-clipboardbranch previews images in its confirmation (ba50c6387, d6a4294f6), which is prior art.Done in
c171fde. The first PNG in a write is shown in its confirmation between the types and the text. It's fitted to the box at most 8 rows high, never scaled up, and drawn over a checkerboard. It's decoded once when the question is asked and shrunk to 512px on a side before upload; PNGs over 8192px on a side, or that don't decode, are only named. The sway VM test now writes a real PNG and checks the confirmation's screenshot for its magenta.