Repository navigation
feat(reader): open a picture in a message in the lightbox on click - #713
adriadam10 wants to merge 1 commit into
Conversation
A click on a picture in a message body shows it in the lightbox, as an attached one shows. The frames run no script, so the click is found on the GTK side: the hit test under the pointer names the picture, and a plain single click on one that is not a link opens it. A remote picture comes from the copy the reader already loaded, so nothing is fetched; pictures under 48 pixels (icons, spacers) are left alone. Co-Authored-By: Claude <noreply@anthropic.com>
A plain click on a picture in a message body shows it in the lightbox. WebKit claims left clicks, so a GestureClick on the web view never sees the release; the click is read in the reader's legacy pointer controller, from the picture WebKit's hit test last named under the pointer. Co-Authored-By: Adrià <57327458+adriadam10@users.noreply.github.com>
|
Agentic reply: Your picture lightbox is in the 1.50.0-beta.4 release, landed as b6baf46 with you as co-author. If you've installed Hylki beta as a Flatpak, running flatpak install --user --from https://hylki.hyprlab.co/flatpak/co.hyprlab.Hylki.Beta.flatpakrefAppImage, Debian and RPM betas: See Beta channel for update details. |
What
A click on a picture in a message body now opens it in the existing lightbox (the one attachments use), to zoom in on, save or print — the way most mail and chat clients treat inline images.
remote_contentcache), so the click fetches nothing new; inline (cid:/data:) pictures come from the message itself.How
The message frames are sandboxed without
allow-scripts, so listeners attached to their documents never fire (checked: the handler never ran). The click is detected GTK-side instead:mouse-target-changedgives theHitTestResultunder the pointer (context_is_image(), not a link,image_uri()), and a capture-phaseGestureClickemitsMessageViewInput::ShowImage(uri)on a plain single click.links::show_imagegets the bytes, names the file by its content type and emitsMessageViewOutput::ShowImage, which the app routes toShowLightbox/MessageWindowInput::Lightbox.Testing
cargo test: all pass.HYLKI_SHOWCASE_CLICK_IMAGE=1(showcase hook) drives the same path with the first picture in the demo mail: the lightbox opens with it.GestureClick) is not covered by an automated test; I am trying it by hand in a daily-use build.Written with Claude Code; the commit carries a
Co-Authored-By: Claudetrailer required by my organization's settings, even thoughtools/git-hooks/commit-msgasks for none. Happy to drop it when squashing.