Skip to content

Paginate past attempt history - #680

Open
onepch wants to merge 1 commit into
sysprog21:mainfrom
onepch:paginate-attempt-history
Open

onepch wants to merge 1 commit into
sysprog21:mainfrom
onepch:paginate-attempt-history

Conversation

@onepch

@onepch onepch commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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.

Written for commit 8025b84. Summary will update on new commits.

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

jserv

This comment was marked as outdated.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as outdated.

jserv

This comment was marked as resolved.

liehcheng

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from ea5383a to d817dc1 Compare November 13, 2026 10:34
@jserv
jserv dismissed their stale review November 13, 2026 10:36

No merge conflicts at the current head.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from d817dc1 to b2bf4ba Compare November 13, 2026 19:59
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from b2bf4ba to 5d82d8c Compare November 14, 2026 04:28
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from 5d82d8c to 13bd3aa Compare November 14, 2026 07:38
jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from 13bd3aa to 84ad09e Compare November 14, 2026 11:27
@onepch
onepch requested a review from alanhc as a code owner November 14, 2026 11:27
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from 84ad09e to 4fc35ab Compare November 14, 2026 13:51
@onepch onepch changed the title Paginate and safeguard attempt history Paginate past attempt history Nov 15, 2026
@onepch
onepch force-pushed the paginate-attempt-history branch from 7315569 to a80b3ac Compare November 15, 2026 11:27
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from a80b3ac to 9e87421 Compare November 15, 2026 12:16
jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch 2 times, most recently from 5255cdf to 37e2732 Compare November 15, 2026 16:15
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from 37e2732 to fff6b89 Compare November 16, 2026 10:40
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from fff6b89 to 73e984e Compare November 16, 2026 16:47
jserv

This comment was marked as resolved.

@jserv

jserv commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Some review comments on this pull request are not settled yet. Please refine the change per the review comments listed below, reply on each thread with what you changed or why you did not, and mark each thread resolved yourself once it is settled (Resolve conversation, at the bottom of the thread). The pull request stays blocked while review threads are open.

Not addressed at the current head:

Checked at 73e984e.

@onepch
onepch force-pushed the paginate-attempt-history branch from 73e984e to e18b1b1 Compare November 16, 2026 22:28
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from e18b1b1 to 1674ba6 Compare November 16, 2026 23:23
jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@onepch
onepch force-pushed the paginate-attempt-history branch from 1674ba6 to cc77df8 Compare November 17, 2026 01:08

@xubo9367 xubo9367 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed cc77df8 on Ubuntu with Node.js v22.23.4 and npm 10.9.9.

Baseline validation:

  • account.test.js and lobby-render.test.js: 49 passed.
  • Filtered pagination-related lobby tests: 12 passed.
  • No failures or skips in these runs.

Two inline suggestions strengthen regression coverage:

  1. Verify the identities of downloaded cross-page reports.
  2. Verify ordered-list numbering on each page.

For each suggestion, the added assertions passed on the original implementation and failed with the corresponding deliberate mutation. Reproduction details and results are included inline.

No current functional failure was reproduced. The full scripts/test.sh gate was not run. All temporary changes were restored.

Comment thread tests/browser/lobby.test.js Resolved
Comment thread web/attempt-pagination.js Resolved
Limit visible history without changing filtered totals or batch
actions. State the cross-page selection scope and keep pagination
locked while report deletion is pending. Restore navigation after
both successful and failed deletions.

Keep page status concise and describe summary totals as filter
matches. Move focus outside history when an empty reload hides the
panel. Cover pagination interactions and focus fallbacks with browser
tests.

Close sysprog21#651

Change-Id: I3f02f5b9eb44aa067682f82383400dd73c60b313
@onepch
onepch force-pushed the paginate-attempt-history branch from cc77df8 to 8025b84 Compare November 17, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pagination and page-size selection to Past attempts

4 participants