Paginate past attempt history

ON
27m ago
+1082-46

Problem and behavior

As candidates accumulate practice attempts, the Past attempts list grows long enough to push the remaining progress information farther down the page. This change paginates the already-loaded, filtered history so candidates can browse 5, 10, or 20 attempts per page without changing the existing attempt order.

Previous and Next expose accessible labels and disabled boundary states, while the page status reports the current and total page count. Pagination is hidden when five or fewer matching attempts fit on one page. Progress summaries continue to use every matching attempt, and report selection and batch downloads continue to include matching attempts on other pages.

Approach

A new web/attempt-pagination.js module owns the current page, page-size selection, boundary clamping, visible history slice, disabled state, and focus movement. pageAttempts contains only the rows rendered on the current page, while shownAttempts retains the complete filtered collection used by selection and batch download controls.

Changing a filter, page size, or history source resets pagination to the first page. Reloading or deleting history retains the current page while it remains valid and otherwise clamps it to the last valid page.

Previous, Next, and the page-size selector remain disabled while report deletion is pending. Their page-boundary states are recalculated after either a successful or failed deletion. When a redraw removes the focused row or pagination control, focus moves to an available target. If empty history hides the entire history section, focus moves to the visible Practice heading outside that section.

The progress summary describes the number of attempts matching the current filters, while the pagination status remains Page N of M. When matching attempts span multiple pages, the batch controls explicitly state their scope with labels such as Deselect all pages and Download selected (N, all pages).

Preview

  • Before
Desktop Mobile
Past attempts without pagination on desktop Past attempts without pagination on mobile
  • After
Desktop Mobile
Past attempts with pagination on desktop Past attempts with pagination on mobile
  • Five or fewer attempts
Desktop Mobile
Pagination hidden after filtering to one attempt on desktop Pagination hidden after filtering to one attempt on mobile

Validation

Added browser coverage for 21 attempts across three pages, 30-attempt account and device histories, page-size changes, filtering from a later page, history reloads, authentication-source changes, cross-page selection and batch downloads, report actions, deletion on the last page, aggregate progress information, empty history, and keyboard focus movement.

Added regression coverage that holds a report deletion request pending and checks that Previous, Next, and the page-size selector remain disabled. The tests cover both successful and failed deletions and verify that navigation is restored afterward.

Ran all three browser shards before the final review amendments; 3169 tests passed and none failed. On the final committed HEAD, nine targeted Chromium tests and two lobby-render tests passed.

Ran ./scripts/test.sh portable; all executed checks passed, including all 337 Git hook checks. One Python test was reported as skipped because the tests ran outside a virtual environment.

Ran ./scripts/test.sh rust; all executed tests passed, and the dependency license and source checks passed.

Closes #651


Summary by cubic

Paginates the Past attempts list so long attempt histories no longer push remaining progress down the page. Candidates browse 5, 10, or 20 attempts per page without changing attempt order; pagination hides when five or fewer attempts fit one page.

A new web/attempt-pagination.js owns the current page, page-size selection, visible slice, and focus movement. shownAttempts keeps the complete filtered collection so selection and batch downloads cover matching attempts on other pages, with labels like "Select all pages" stating that scope. Pagination resets to page 1 when a filter, page size, or history source changes, clamps to the last valid page after reloads and deletions, and a custom page size reverts to the default on reload. It stays locked while a report deletion is pending or history switches to another account, restoring after success or failure; a failed account switch also drops the old page. Downloads and selection remain locked until the new account's rows land and pagination resets with them, and a row download stays disabled when paging away and back until it completes.

Previous/next controls have accessible labels, disabled boundary states, and live page announcements; focus moves before a focused row or control is removed and returns to the page title when an empty reload hides the panel. The status shows Page N of M while the summary reads "match these filters" across all matching attempts. Browser tests cover pagination across account and device histories, cross-page selection and downloads, pending deletions and downloads, account switches, filter resets, and focus fallbacks.

Closes #651.