From 8025b84e63f700111f93b5a4c9e2597b0c69dbcb Mon Sep 17 00:00:00 2001 From: onepch <330227622+onepch@users.noreply.github.com> Date: Thu, 12 Nov 2026 12:06:52 +0800 Subject: [PATCH] Paginate past attempt history 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 #651 Change-Id: I3f02f5b9eb44aa067682f82383400dd73c60b313 --- tests/browser/account.test.js | 2 +- tests/browser/download.test.js | 2 + tests/browser/lobby-render.test.js | 11 + tests/browser/lobby.test.js | 846 ++++++++++++++++++++++++++++- web/app.js | 136 ++++- web/attempt-pagination.js | 73 +++ web/index.html | 38 +- web/styles.css | 20 +- 8 files changed, 1082 insertions(+), 46 deletions(-) create mode 100644 web/attempt-pagination.js diff --git a/tests/browser/account.test.js b/tests/browser/account.test.js index 2ea5df70f..d62d97152 100644 --- a/tests/browser/account.test.js +++ b/tests/browser/account.test.js @@ -1645,7 +1645,7 @@ test("post-interview and lobby reports wire same-category comparison into HTML a ); assert.match( functionBody(app, "syncAttemptSelection"), - /downloadingSelectedAttempts \|\| selected === 0/, + /downloadingSelectedAttempts \|\| paginationSourcePending \|\| selected === 0/, ); assert.match(functionBody(app, "downloadSavedReport"), /categoryComparison/); }); diff --git a/tests/browser/download.test.js b/tests/browser/download.test.js index a5092d95e..a25b4ea61 100644 --- a/tests/browser/download.test.js +++ b/tests/browser/download.test.js @@ -32,6 +32,8 @@ for (const [path, name] of [ }, requestTimeoutMs: 10_000, pendingReportDownloads: new Set(), + pendingRowReportDownloads: new Set(), + visibleReportDownloadButtons: new Map(), selectionKey: (attempt) => attempt.id || attempt, loadPageMapWithin: () => new Promise((resolve, reject) => { diff --git a/tests/browser/lobby-render.test.js b/tests/browser/lobby-render.test.js index b5aa58da2..37610018c 100644 --- a/tests/browser/lobby-render.test.js +++ b/tests/browser/lobby-render.test.js @@ -28,6 +28,16 @@ import { installDocument } from "./dom.js"; const markup = read("web/index.html"); const dom = installDocument(markup); +dom.node("attempt-page-size").options = ["5", "10", "20"].map((value) => ({ + value, +})); +// The small DOM stub does not apply an option's HTML `selected` attribute. +const pageSizeMarkup = markup.match( + /]*id="attempt-page-size"[\s\S]*?<\/select>/, +)[0]; +dom.node("attempt-page-size").value = pageSizeMarkup.match( + /