From 6e47246dbbc97821b97aa9c45352abc9c2a9aa4a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 15 Jun 2026 13:26:28 +0300 Subject: Stats/camera pages: blurred background, album-like camera thumbs, spacing Three refinements to the stats site: - Stats and per-camera pages now get a random blurred background image (same seeded pick the album preview pages use) instead of a plain black page. Adds _stats_random_background + STATS_BLURS_DIR; falls back to black when no photos exist (e.g. isolated unit tests). - Per-camera thumbnails now behave like the main album: they link to each photo's album view page (navigation, details, EXIF tooltip) and carry the same seeded animation class, instead of linking to the raw image. render_album_pages records a photo -> "-" map (ALBUM_VIEW_PAGE_BY_PHOTO) that the camera pages read; photos with no recorded view page fall back to the image. - Spacing: the camera leaderboard rows get padding + a separator line so the long wrapping camera names are distinguishable, and the stats sections, headings, bar rows, back-link, and camera grid get moderate extra spacing so nothing looks cramped. Tests updated for the new camera-thumbnail markup and extended to assert the stats background and the album view-page links; camera.tmpl comment corrected. Co-Authored-By: Claude Opus 4.8 --- tests/cli.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'tests/cli.sh') diff --git a/tests/cli.sh b/tests/cli.sh index f01c2e0..14439bf 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -3060,6 +3060,7 @@ test::stats_identify_output() { } test_generate_stats_pages_created_and_nav_linked() { + local camera_html local config_file local fake_bin local -i nav_links @@ -3088,6 +3089,21 @@ test_generate_stats_pages_created_and_nav_linked() { test::assert_contains 'Canon EOS R5' "$(<"$TEST_TMPDIR/dist/stats.html")" test::assert_not_contains '&2 + exit 1 + fi + # The header bar links to the stats page on at least one generated page. nav_links=$(grep -lF 'stats.html">Stats' "$TEST_TMPDIR"/dist/*.html | wc -l) test "$nav_links" -gt 0 @@ -4001,6 +4017,8 @@ MAXPREVIEWS=40 ORIGINAL_BASEPATH='' TARBALL_INCLUDE=no SHURIKEN_OUTPUT_MODE=quiet +# Seed so the per-thumbnail animation class is reproducible across runs. +RANDOM_SEED=camera-test apply_config_defaults feed() { @@ -4040,11 +4058,14 @@ BASH test::assert_file_exists "$dist_dir/run1/camera-canon-eos-5d-2.html" test::assert_file_exists "$dist_dir/run1/camera-nikon-co-z6.html" - # The Canon EOS 5D page lists exactly its two photos as thumbnails linking to - # the full images under photos/, and not the other camera's photo. + # The Canon EOS 5D page lists exactly its two photos as thumbnails, and not + # the other camera's photo. With no album rendered here, the thumbnail link + # falls back to the full image under photos/; the img carries a thumb class + # (plus a seeded animation class) pointing at thumbs/. html=$(cat "$dist_dir/run1/camera-canon-eos-5d.html") test::assert_contains '' "$html" - test::assert_contains '' "$html" + test::assert_contains 'class="thumb ' "$html" + test::assert_contains 'src="../thumbs/a.jpg" />' "$html" test::assert_contains '' "$html" test::assert_not_contains 'photos/c.png' "$html" test::assert_not_contains 'photos/d.jpg' "$html" -- cgit v1.2.3