Skip to content

Studio: keep large model categories paginated - #6793

Merged
shayderrr merged 3 commits into
ItsNotRexed:mainfrom
jewmaster1337:codex/studio-model-pagination
Nov 23, 2026
Merged

shayderrr merged 3 commits into
ItsNotRexed:mainfrom
jewmaster1337:codex/studio-model-pagination

Conversation

@jewmaster1337

@jewmaster1337 jewmaster1337 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in coordination #6750.

What changed

Studio originally rendered the first 100 models in each category, then appended every remaining row in one click. On a synthetic category with 10,001 models, the first click increased the live row count from 100 to 10,001 in Chrome.

Keep one page of up to 100 rows per category. Previous and Next show the current range, preserve the selected model when moving between pages, and keep each category's position independent. Filtering starts the filtered results on their first page.

Tested

  • node --test tests/test_viewer_studio.cjs: 6 passed on Windows (Node 26). The regression reproduced 10,001 rows on main.
  • Headless Chrome using the actual Studio HTML and 10,001 synthetic models: next showed models 101–200 with 100 live rows, and previous returned to the first 100. No WebGL or network resources.
  • python -I tests/test_viewer_serve.py: 37 passed, 2 skipped. python -I tests/test_docs_links.py: 7 passed. git diff --check passed.
  • tests/test_viewer_streaming.cjs: 56 passed with the same AbortController fixture failure on both clean main and this PR. Tracked in test(viewer): pass AbortController and timers into camera-speed vm context #5692.

No game data or GPU used. AI-assisted (Codex).

Review follow-up

Changing language now preserves each category's page and the selected row. Search text that normalizes to the current query leaves the list in place. A changed filter still starts from page one. The new regression reproduces the reset at the first PR commit and passes on the updated head.

DDS inspector integration

Resolved the conflict with #6896 in the shared Studio test fixture. replaceChildren now accepts arguments for page rows and an empty call for clearing inspector controls.

  • node --test tests/test_viewer_studio.cjs — 9 passed on Windows and Debian (Node 24), including pagination and all three DDS inspector tests.
  • python -IB tests/test_viewer_serve.py — 37 passed, 2 skipped on Windows.
  • The combined Studio and streaming suite still reports a streaming VM case missing AbortController. The streaming suite and its viewer source exactly match upstream d215ec8b.

@whattheflop

Copy link
Copy Markdown
Contributor

Independent AI-assisted Node 24 VM check of 4417d6b9 and base 1cc6e3c1. Two synthetic categories of 205 and 307 models ended with partial pages of 5 and 7 rows. Clicking Models again or switching Models → Textures → Models kept both page positions and the selected row. A changed filter reset both pages, and paging back to the selected row restored its highlight without another load.

One remaining state reset occurs when changing language or editing search to a value that normalizes to the same query. Both category pages reset to page 1, hiding the selected row while its model stays loaded. Base also discarded its expanded list on those actions. The translation handler and search handler are the two entry points.

The Studio HTML merged cleanly with #6786 and its parent #6731. After preserving both sides of the scratch-only Node fixture conflict, six focused tests passed, and the merged VM kept pagination and selection across DDS mip/Z changes. Synthetic CPU checks.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

viewer/studio.html replaces the "show all" button with 100-row paging: a per-category modelPages map, selectedModel, renderPage() and Previous/Next/range controls with previousModelPage/nextModelPage i18n labels; equivalent search text leaves the page in place and a changed filter resets to page one. tests/test_viewer_studio.cjs upgrades the fake DOM and adds three paging/selection tests.

Why merge

A category with 10,001 models previously injected 10,001 rows in one click, freezing the Studio viewer. Keeping one page preserves responsive browsing of model exports while retaining the selected model across pages and language changes.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

viewer/studio.html replaces the "show all" button with 100-row paging: a per-category modelPages map, selectedModel, renderPage() and Previous/Next/range controls with previousModelPage/nextModelPage i18n labels; equivalent search text leaves the page in place and a changed filter resets to page one. tests/test_viewer_studio.cjs upgrades the fake DOM and adds three paging/selection tests.

Why merge

A category with 10,001 models previously injected 10,001 rows in one click, freezing the Studio viewer. Keeping one page preserves responsive browsing of model exports while retaining the selected model across pages and language changes.

Verdict: Approve

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.

3 participants