feat(layout): stick the title row too, and chain the sticky offsets

"All items · N items" scrolled away like the pager did. It now sticks at
the scrollport top (padding-top/negative margin cancel .content's padding
so nothing shows through the gap), and the three things below it offset
by --hdr-h: batch bar, pagination, and the table header (--hdr-h + --pag-h).
Both vars are measured on .content in renderEntries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-22 11:31:52 +01:00
parent 60cf26b259
commit 24d74df2ab
2 changed files with 19 additions and 7 deletions
+6 -3
View File
@@ -2296,13 +2296,16 @@ function renderGrid() {
const start = (state.currentPage - 1) * state.pageSize;
const pageList = list.slice(start, start + state.pageSize);
// Sticky offsets: the pagination bar parks under the title row, and the
// table header under both. Measured, so a wrapped pager still lines up.
const content = $('.content');
content.style.setProperty('--hdr-h', $('.content-header').offsetHeight + 'px');
if (total > 10) {
const pag = renderPagination(total, totalPages);
grid.appendChild(pag);
// The table header sticks below the sticky pagination bar, not under it.
grid.style.setProperty('--pag-h', pag.offsetHeight + 'px');
content.style.setProperty('--pag-h', pag.offsetHeight + 'px');
} else {
grid.style.setProperty('--pag-h', '0px');
content.style.setProperty('--pag-h', '0px');
}
if (state.viewMode === 'table') {