| Age | Commit message (Collapse) | Author |
|
Two layout-breaking cases remained after the fixed-column grid landed:
1. A 2x2 feature spans two rows, so one placed near the bottom of a page
left an L-shaped gap grid-auto-flow: dense could not backfill (nothing
follows it) -- a cut-off corner. append_preview_grid now only offers the
feature layout while at least feature_tail_margin (16) photos remain, so
a hero always sits in the upper rows with enough trailing 1-cell tiles to
complete its rows at every breakpoint (and short pages get no hero).
2. A short final page (a leftover handful of photos) could be subdivided
down below 12 cells, where it can't be aligned to a multiple of 12 and is
ragged. Such pages now go through _build_final_page_tiles: plain singles,
then merge down to a multiple of 12 (count >= 12 -> flush grid) or a
full-row "fill" filmstrip (count < 12 -> one clean banner, or stacked
banners). Longer/full pages keep the normal roll-and-align path.
Verified hole-free at 2/3/4/6 columns with a grid-auto-flow:dense packing
simulator across ~480 generated pages (regular + short final), 0 failures.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
A short final preview page (e.g. one leftover photo when the photo count
isn't a multiple of the page size) can't be aligned to a multiple of 12
cells, so it left an orphaned bottom-right corner. The album's LAST page
now widens its leftover final single tile into a "fill" tile spanning the
whole row (grid-column: 1 / -1) at any breakpoint, so the bottom edge is
flush; object-fit: cover keeps the wider crop undistorted.
append_preview_grid takes a fill_last flag: render_full_preview_page sets
it only for the page with no "next" link; stats mini-albums pass 'no' so
their small galleries are unaffected. build_tile_block gains a 'fill'
layout and header.tmpl an a.fill-row rule.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
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 <noreply@anthropic.com>
|
|
album-render.source.sh bundled four concerns that change for unrelated
reasons. Extract three focused siblings, leaving album-render as the page
orchestrator:
- album-tile-layout.source.sh tile_layout_for, build_tile_block,
build_subdivided_tile
- album-thumbnail-html.source.sh build_preview_thumbnail,
append_preview_grid
- album-photo-select.source.sh album_photo_files, album_page_records,
splash_photo_files, random_splash_photo,
randomphoto
album-render.source.sh keeps page assembly, the per-photo view/details
pages, navigation redirects, index/splash, and the job_pool_* plumbing.
Every function moved whole with no body/signature change. The
album_view_page_for_photo accessor and its private ALBUM_VIEW_PAGE_BY_PHOTO
map stay in album-render so the stats mini-album boundary is unchanged.
LIB_SOURCES (Justfile + src/shuriken.sh) sources the three new modules
before album-render. Regenerated bin/shuriken.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|