Skip to content

Paged Build History and Build Library in the Svelte client - #78

Open
krixkrix wants to merge 1 commit into
alexanderoster:developfrom
krixkrix:svelte-list-paging
Open

krixkrix wants to merge 1 commit into
alexanderoster:developfrom
krixkrix:svelte-list-paging

Conversation

@krixkrix

@krixkrix krixkrix commented Oct 9, 2026

Copy link
Copy Markdown

Summary

The Svelte client rendered every row of the Build History (execution list) and Build Library (build list). With 10,000 executions, opening Build History blocked the browser for tens of seconds. It also ignored the list's entriesperpage setting, which the server sends and core already parses (default 25). Both lists now render one page at a time.

 <ModuleExecutionList> / <ModuleBuildList>
-  {#each entries as row}
+  listPage = paginate(entries, pageNumber, module.entriesperpage)
+  {#each listPage.rows as row}
   ...
+  <ListPager {listPage} />      # "1–20 of 10002", first / prev / page n of m / next / last
 Client/svelte/
 ├── package.json               # + "test": node --test (no new dependencies)
 └── src/lib/amcf/
+    ├── paging.ts              # paginate(): page slice, page count, clamp past the end
+    ├── paging.test.ts
+    ├── ListPager.svelte       # hidden when there is only one page
     └── modules/
         ├── ModuleExecutionList.svelte
         └── ModuleBuildList.svelte

The pager also exposed a bug in the execution list. Its ScrollArea set max-h-[500px] on the root, but the viewport is size-full, so it never scrolled. Rows past about 500 px were clipped and could not be reached. The cap now applies to the viewport (*:data-[slot=scroll-area-viewport]:max-h-[500px]).

Evidence

Checked in Chromium against a server with 10,002 executions and 43 builds, with entriesperpage="20".

  • Before: Build History renders 10,003 <tr> and 130,189 DOM elements, and the main thread is blocked until the first row appears. Build Library renders all 43 rows. Neither list has a pager.
    After: Build History renders 20 rows and 440 DOM elements, showing "1–20 of 10002" (1 / 501). Build Library shows "1–20 of 43" (1 / 3). First, previous, next and last work on both, and the last page of Build History shows the remaining 2 rows. The pager is visible and clickable at 1280×800 and 800×480.
  • Before: the execution list viewport is 1,260 px tall inside a 500 px root and can't be scrolled.
    After: the viewport is 500 px and scrolls to the last row.
  • npm test, 4/4 passing:
    10,000 entries, page 1, 20 per page  → rows 1–20, 500 pages
    43 entries, page 3                   → rows 41–43
    25 entries, page 3 (past the end)    → shows page 2, rows 21–25
    0 entries                            → one empty page, 0–0
    
  • npm run check: adds no errors.
  • Note: develop cannot currently build the Svelte client, because Client/core/common/AMCListDeltaSync.js is imported but was never committed. These checks used a local copy of that file. It is not part of this PR.

Merge Danger

Door: two-way

This is client-only, with no server, API or data changes, and a revert removes it completely.

Blast Radius: layout

  • Users now see 25 rows per page, or whatever entriesperpage is configured, instead of everything at once.
  • Paging is client-side. The full list is still fetched and kept in memory, and only rendering is paged.
  • New executions are inserted at the top of the list, so rows on later pages shift by one when one arrives.
  • The scroll fix changes the execution list's height behaviour.

ModuleExecutionList and ModuleBuildList rendered every entry. With
10,000 executions, Build History created 10,003 rows (130,189 DOM
elements) and froze the browser. Both lists now show one page of
module.entriesperpage rows, with a first/previous/next/last pager.

The Build History scroll area capped its root height but not its
viewport, so rows past about 500 px were clipped and could not be
scrolled to. The cap now applies to the viewport.

Adds an npm test script that runs the paging tests with node --test.

This branch has not been deployed

No deployments
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.

1 participant