3.4 KiB
3.4 KiB
Q-Edit v0.7.1 — Pagination UX & State Persistence
Date: 2025-08-24
This release focuses on making very large result sets (hundreds to thousands of pages) pleasant to navigate. We replaced the full page-number list with a compact, windowed pager; added a jump-to-page control; preserved your place via URL hash; and made the page count preference persistent.
Highlights
- Windowed + Ellipsis Pagination
- Only shows a small window around the current page: first/prev, current±2, next/last, with
…for gaps. - Prevents the pagination bar from stretching the page horizontally.
- Only shows a small window around the current page: first/prev, current±2, next/last, with
- Jump to page
- Number input + Go button; Enter key supported.
- URL hash deep-linking
- The current page is reflected as
#page=NN. Browser back/forward & reload restore state.
- The current page is reflected as
- Default items per page = 25
- Persisted in
localStorageunder the keyqedit_itemsPerPage.
- Persisted in
- Overflow guard
.pagination-controlsis now constrained withmax-width:100%; overflow-x:auto; white-space:nowrap;.
Technical changes
- Files modified
index.html- Default items-per-page option switched to 25 (
<option value="25" selected>).
- Default items-per-page option switched to 25 (
style.css- Added overflow guard for
.pagination-controls. - New styles for
.jump-to-pagecontrols.
- Added overflow guard for
script.js- Replaced
buildPaginationControls()with windowed/ellipsis logic and jump UI. - Expanded
addPaginationEventHandlers()to wire jump button and Enter on the number input. - New helpers:
getPageFromHash()— parse#page=NN.setPageHash(p)— update hash on navigation.initPaginationPrefs()— applylocalStorageitems-per-page and hash page on startup; listens forhashchange.
- Persist selection on items-per-page change via
localStorage.setItem('qedit_itemsPerPage', ...). - Respect existing page from hash after auth; removed forced
currentPage = 1in login success path. - A11y:
aria-labelon navigation controls;aria-current="page"on active page. - Defensive: no-op when
totalPages <= 1.
- Replaced
Behavior notes
- If
localStorageis unavailable, items-per-page simply won’t persist (feature degrades gracefully). - Deep-links like
/#page=17will open directly on page 17 after authentication completes. - Both top and bottom pagers render identically from the same HTML string.
QA checklist
- With large datasets (e.g., 4,000+ items):
- No horizontal page-wide scrolling due to pagination.
- Pager shows compact numbers with
…where appropriate. - Clicking First/Prev/Next/Last updates content and hash.
- Typing a page number and pressing Go or Enter navigates correctly and clamps to 1..N.
- Reload preserves page via
#page=NN. - Changing items-per-page updates
#pageto 1 and persists across reloads.
- A11y:
aria-current="page"present on current page link.- Focus rings visible; buttons keyboard-activatable.
Potential regressions / mitigations
- Hash collisions: If other features later use the hash, ensure
page=remains compatible or parse jointly. - Bookmark drift: When items-per-page changes, page resets to 1 by design; the hash updates accordingly.
Future work (optional)
- Keyboard nav shortcuts (←/→) to flip pages when the pager is focused.
- Gradient edge hints on the pager to signal scrollable overflow.
- Virtualized/infinite scroll mode for image-heavy views.