From 3adeaa68af3bac73450a4156edb51fd1ec88347a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 15 Jun 2026 12:47:25 +0300 Subject: Add EXIF mouse-over tooltip to the normal image view The details view already showed a title="" hover summary (camera, aperture, ISO, shutter, date) on its image; the normal image view did not. Wire the same tooltip into view.tmpl: - render_view_page now computes the EXIF tooltip via photo_exif_tooltip_text (reusing the shared identify cache, so no extra ImageMagick work) and passes it as the exif_tooltip context var. - exif_tooltip is now a required render field for the view template too. - view.tmpl adds the title="" attribute to its when the summary is non-empty, mirroring details.tmpl (no title when there is no EXIF). - Tests: extend the EXIF render test to assert the view image carries the same tooltip, and update the required-context-vars expectation for view. Co-Authored-By: Claude Opus 4.8 --- tests/cli.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/cli.sh b/tests/cli.sh index a78741a..f01c2e0 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -3846,7 +3846,7 @@ preview:animation_class backhref html_dir page_num photo preview_num thumbs_dir redirect:html_dir redirect_page splash:backhref background_image blurs_dir enter_page html_dir photo photos_dir stats:backhref html_dir stats_body -view:animation_class backhref html_dir page_num photo photos_dir preview_num +view:animation_class backhref exif_tooltip html_dir page_num photo photos_dir preview_num END ) output=$( @@ -4785,6 +4785,10 @@ test_generate_renders_exif_details() { details_html=$(<"$TEST_TMPDIR/dist/1-1-details.html") test::assert_contains 'href="1-1-details.html">Details' "$view_html" + # The normal image view carries the same EXIF tooltip as the details view. + test::assert_contains \ + 'title="Camera: ExampleCam Model & "X"; Aperture: f/2.8; ISO: 400; Shutter speed: 1/125; Taken: 2026:06:04 12:34:56"' \ + "$view_html" test::assert_contains '' "$details_html" test::assert_contains \ 'title="Camera: ExampleCam Model & "X"; Aperture: f/2.8; ISO: 400; Shutter speed: 1/125; Taken: 2026:06:04 12:34:56"' \ -- cgit v1.2.3