From 964901d672d8e12baf4ac0eb29821d670ae15eb8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 25 Jun 2026 12:16:17 +0300 Subject: Flush preview-grid rows: fixed breakpoint columns + multiple-of-12 pages The overview grid used auto-fill columns (an unpredictable count at view time) while tiles per page were fixed at generation, so the last row was ragged -- an empty, cut-off bottom-right corner, made worse by a 2x2 feature tile. CSS (header.tmpl): replace auto-fill with a FIXED column count per width breakpoint -- 2 (phone) / 3 / 4 / 6 -- all divisors of 12. THUMBHEIGHT no longer drives the grid (it only sizes the thumbnail files), so its obsolete render-var is dropped (template.source.sh). Generator (album-tile-layout, album-thumbnail-html): append_preview_grid now decides a page's tiles, then snaps the grid-cell total onto a multiple of 12 before emitting, via two photo-preserving levers -- _grid_split_subdivides_to_add (round up: split subdivided tiles into singles; preferred, abundant) and _grid_merge_singles_to_remove (round down: merge adjacent singles). Because 2/3/4/6 all divide 12, a multiple-of-12 page tiles into a COMPLETE rectangle at every breakpoint: a flush last row at any window width, with no image distortion (object-fit: cover). Per-photo preview numbers and all navigation redirects are unchanged. Tiny pages (a short final page or small stats mini-album) are left as-is. Decrements use assignment, not bare "(( --k ))": under set -euo pipefail an arithmetic command evaluating to 0 returns status 1 and would abort generate. Helper namerefs are uniquely named and arrays are forwarded by name to avoid bash circular-nameref errors. Tests: add test_album_grid_cells_align_to_multiple_of_12 (both levers); update the two tests that pinned the old auto-fill CSS / render-var list. Co-Authored-By: Claude Opus 4.8 --- src/lib/template.source.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'src/lib/template.source.sh') diff --git a/src/lib/template.source.sh b/src/lib/template.source.sh index 016d2a2..6201647 100644 --- a/src/lib/template.source.sh +++ b/src/lib/template.source.sh @@ -262,7 +262,6 @@ declare -ra TEMPLATE_RENDER_FIELD_SPECS=( 'render_stats_page_html|config_html|STATS_PAGE||header' 'render_tarball_include|tarball_include|||footer' 'render_tarball_name_html|context_html|tarball_name|tarball_name|footer' - 'render_thumbheight_html|config_html|THUMBHEIGHT||header' 'render_thumbs_dir_html|context_html|thumbs_dir|thumbs_dir|preview' 'render_title_html|config_html|TITLE||camera header splash stats' 'render_view_next_html|preview_num_next_html|preview_num||details view' -- cgit v1.2.3