From 761bb812cd469e5202f68217878d622b15b630e8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 4 Sep 2026 15:19:15 -0700 Subject: The pager's Prev/Next buttons loop within the pages instead of disabling at the ends: Next on the last page returns to page 1, Prev on page 1 jumps to the end. Unlike the swipe ring they never leave the list for the tabs — buttons paginate, swipes navigate. Applies to the shared pager, so the address list wraps the same way MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz --- src/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index dff963a..c815cc5 100644 --- a/src/app.js +++ b/src/app.js @@ -4607,6 +4607,9 @@ function txHistoryItem(tx) { } // Prev / page-of / next controls. Returns null when there's only one page. +// The buttons LOOP within the pages (never disabled): Next on the last page +// returns to page 1, Prev on page 1 jumps to the end — unlike the swipe +// ring, they never leave the list for the tabs. const PAGE_SIZE = 10; // The history list currently on screen ({ page, pages }), null when a detail // view / spinner / another tab is up — the swipe gesture paginates against @@ -4616,9 +4619,9 @@ function pager(page, total, onPage) { const pages = Math.ceil(total / PAGE_SIZE); if (pages <= 1) return null; return h('div', { class: 'row between', style: 'align-items:center;padding-top:10px' }, - h('button', { class: 'btn-sm', disabled: page <= 0, onClick: () => onPage(page - 1) }, t('prevPage')), + h('button', { class: 'btn-sm', onClick: () => onPage((page - 1 + pages) % pages) }, t('prevPage')), h('span', { class: 'small muted' }, t('pageXofY', { x: page + 1, y: pages })), - h('button', { class: 'btn-sm', disabled: page >= pages - 1, onClick: () => onPage(page + 1) }, t('nextPage')) + h('button', { class: 'btn-sm', onClick: () => onPage((page + 1) % pages) }, t('nextPage')) ); } -- cgit v1.2.3