chris.giteaandClaude Sonnet 5 bc696f9cdc refactor(gallery): render date headers as their own fixed-height grid item
Root fix for the persistent :selected staleness bug: a date's header
used to be extra, taller content optionally rendered inside that
date's own first content row's cell (GalleryRowCell.renderPhotos), so
row height varied depending on whether a row happened to start a
date. On a virtualised ListView with no fixedCellSize, that variable
height was demonstrably (via -Dpholio.skipTheme=true, confirmed to
never reproduce against JavaFX's own near-empty default stylesheet,
only ever AtlantaFX's much heavier one) part of what let VirtualFlow's
cell recycling/positioning fall out of sync with mouse picking badly
enough to leave a stale (or missing) selection highlight on a
thumbnail clicked shortly after another one in the same multi-row
date group.

GalleryRow.chunk() is untouched (still pure width-packing, markers
embedded exactly as before). New GalleryGridItem is a sealed
interface (GalleryRow | HeaderRow) with itemize(), a pure conversion
step that expands chunk()'s output into ThumbnailGalleryPane.rows'
own item sequence: one HeaderRow item (one or more date columns,
their spanWidth computed once here) immediately before whichever
GalleryRow content item it labels. Every content item is now exactly
the same height regardless of which date(s) its entries belong to;
every header item has its own different fixed height.

GalleryRowCell becomes GalleryGridCell, a ListCell<GalleryGridItem>
branching in updateItem between a content half (photosBox, unchanged
card-reuse/thumbnail logic) and a header half (headerStrip, unchanged
label/select-all/actions-menu logic) — a cell tracks which half it
currently holds and only tears down the other on an actual kind
switch, preserving the existing card-reuse optimisation for the
common content-to-content recycling case.

wireDateSelectHover's hover-reveal narrows to the header column's own
hover only (dropping the "or hovering one of its cards" half, no
longer possible now that a date's header and its cards live in
different cells) — a deliberate, minor UX narrowing, confirmed with
the user.

ThumbnailGalleryPane: rows becomes ListView<GalleryGridItem>;
verticalNeighbour/rowIndexOf skip HeaderRow items; updateTimeline/
resolveGroupLabel read HeaderRow items directly instead of scanning
every entry of every row for a marker.

New GalleryGridItemTest covers itemize() in isolation (no JavaFX),
mirroring GalleryRowTest's style. ThumbnailGalleryPaneTest's row-count
assertions gain the one extra header item per date group; the two
header-alignment tests now exercise cross-cell alignment instead of
intra-cell.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 19:42:19 -04:00
2026-08-22 17:52:02 -04:00
2026-08-22 11:54:20 -04:00
2026-08-22 11:54:20 -04:00
2026-08-22 11:54:20 -04:00
2026-08-08 23:21:21 -04:00
2026-07-26 18:49:07 -04:00
2026-07-26 18:49:07 -04:00
S
Description
No description provided
54 MiB
Languages
Java 97.4%
CSS 1.5%
Python 0.9%
JavaScript 0.2%