studio: go back to the shown model's row when a download fails (STUDIO-FAILED-LOAD-SELECTION) #2100

Merged
Saauf merged 1 commit from upstream-pr/2100 into main 2026-11-29 02:15:08 +00:00
Saauf commented 2026-11-25 20:41:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Saauf on 2026-11-25T20:41:58Z.


Claimed in the coordination issue as: STUDIO-FAILED-LOAD-SELECTION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174039782)

What and why

Follows CrazyThiago's finding. When a model download failed, Studio kept the failed model's row selected while the viewport and the statistics still showed the previous model, and redrawing the list kept the mismatch.

Studio now remembers the model it shows and selects that row again on an error (no row if nothing is shown yet), before the alert. The list is not rebuilt, so its scroll position and collapsed groups stay. A late failure of a download that a newer click replaced is still ignored.

The test harness's querySelectorAll and classList.toggle did nothing; they now work, because the new test reads the rows.

Tested

  • node --test tests/test_viewer_studio.cjs tests/test_viewer_streaming.cjs (Node 22.16, macOS): 70 pass. The new test fails with main's studio.html.
  • tests/test_viewer_serve.py and tests/test_viewer_cdn_integrity.py pass.
  • In the desktop app's built-in browser, against tools/gallery.py with three synthetic GLBs, one of them malformed: after the error the first model's row is selected again, and the next model loads normally.
  • scripts/check_no_game_data.py is clean on both files. The diffs of the open #1138 and #1490, which touch the same files, still apply on top of this branch.

GPUs tested: n/a

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a, no translator change)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5498834757 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2100). Originally posted by [Saauf](https://github.com/Saauf) on 2026-11-25T20:41:58Z. --- Claimed in the coordination issue as: STUDIO-FAILED-LOAD-SELECTION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174039782) ### What and why Follows [CrazyThiago's finding](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173608370). When a model download failed, Studio kept the failed model's row selected while the viewport and the statistics still showed the previous model, and redrawing the list kept the mismatch. Studio now remembers the model it shows and selects that row again on an error (no row if nothing is shown yet), before the alert. The list is not rebuilt, so its scroll position and collapsed groups stay. A late failure of a download that a newer click replaced is still ignored. The test harness's `querySelectorAll` and `classList.toggle` did nothing; they now work, because the new test reads the rows. ### Tested - `node --test tests/test_viewer_studio.cjs tests/test_viewer_streaming.cjs` (Node 22.16, macOS): 70 pass. The new test fails with `main`'s `studio.html`. - `tests/test_viewer_serve.py` and `tests/test_viewer_cdn_integrity.py` pass. - In the desktop app's built-in browser, against `tools/gallery.py` with three synthetic GLBs, one of them malformed: after the error the first model's row is selected again, and the next model loads normally. - `scripts/check_no_game_data.py` is clean on both files. The diffs of the open #1138 and #1490, which touch the same files, still apply on top of this branch. GPUs tested: n/a AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a, no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
zmasi commented 2026-11-28 21:46:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:46:31Z.


#2100 | head 515fc75c0d (merged cleanly with main a8465211fb) | node --test tests/test_viewer_studio.cjs | red on main: pass 12, fail 1 (AssertionError: nothing is shown yet — actual: ['a'], expected: []; clicking a row mutated selectedModel and .active before GLTFLoader.load completed and never restored the previously shown model on download failure) | green on PR+main: pass 13 / 13, fail 0 (duration_ms 209.6) | Windows 11 (10.0.26200.9974), Node.js v24.16.0 | AI-assisted: yes

Audited viewer/studio.html and tests/test_viewer_studio.cjs on Windows 11: tracking shownModel on successful scene swaps and calling selectModel(shownModel) when the latest modelLoadId fails restores the active sidebar row (and subsequent renderAccordionList() redraws) to the model actually shown in the viewport without rebuilding the accordion or disturbing superseded loads. Also verified tests/test_ci_registration.py and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246262078 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2100#issuecomment-7246262078). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T21:46:31Z. --- #2100 | head 515fc75c0da42dd235301460b52a1887e0aee4b3 (merged cleanly with main a8465211fb) | `node --test tests/test_viewer_studio.cjs` | red on main: `pass 12, fail 1` (`AssertionError: nothing is shown yet` — `actual: ['a'], expected: []`; clicking a row mutated `selectedModel` and `.active` before `GLTFLoader.load` completed and never restored the previously shown model on download failure) | green on PR+main: `pass 13 / 13, fail 0` (`duration_ms 209.6`) | Windows 11 (`10.0.26200.9974`), Node.js v24.16.0 | AI-assisted: yes Audited `viewer/studio.html` and `tests/test_viewer_studio.cjs` on Windows 11: tracking `shownModel` on successful scene swaps and calling `selectModel(shownModel)` when the latest `modelLoadId` fails restores the active sidebar row (and subsequent `renderAccordionList()` redraws) to the model actually shown in the viewport without rebuilding the accordion or disturbing superseded loads. Also verified `tests/test_ci_registration.py` and `scripts/check_no_game_data.py`.
OreoFR commented 2026-11-29 01:58:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:58:15Z.


Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Node v26.7.0, main 59e65849b, PR head 515fc75c0 : red 1 failure / green 13 OK

node --test tests/test_viewer_studio.cjs:

  • Red (main + only this PR's test file): 13 tests (incl. subtests), 1 failed:
    • a failed download selects the row of the model still shown, also after the list is redrawn
  • Green (main + merge): 13/13 OK.
  • (MEASURED n=3) each failing test rerun alone 3 times: red 3/3 fail, green 3/3 pass.
  • Skipped: none (skip 0, todo 0). No npm dependencies (CI runs node --test tests/test_*.cjs).
  • Merge: clean (git merge --no-ff onto main). The PR's test file is not older than main's, so the red run is the plain one.

Verdict: READY

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249128743 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2100#issuecomment-7249128743). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T01:58:15Z. --- Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Node v26.7.0, main 59e65849b, PR head 515fc75c0 : red 1 failure / green 13 OK `node --test tests/test_viewer_studio.cjs`: - **Red** (main + only this PR's test file): 13 tests (incl. subtests), 1 failed: - `a failed download selects the row of the model still shown, also after the list is redrawn` - **Green** (main + merge): 13/13 OK. - (MEASURED n=3) each failing test rerun alone 3 times: red 3/3 fail, green 3/3 pass. - Skipped: none (skip 0, todo 0). No npm dependencies (CI runs `node --test tests/test_*.cjs`). - Merge: clean (`git merge --no-ff` onto main). The PR's test file is not older than main's, so the red run is the plain one. **Verdict: READY** AI-assisted: Claude Code
MoonEyes commented 2026-11-29 02:15:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T02:15:11Z.


Merged after OreoFR's red/green check (check) (macOS 27.2.1, Apple M5) and a local re-check here. Merged after local re-verification: this PR merged onto main 02944d4ca without conflict, and its test file(s) (tests/test_viewer_studio.cjs) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249307970 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2100#issuecomment-7249307970). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T02:15:11Z. --- Merged after **OreoFR**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/2100#issuecomment-7249128743)) (macOS 27.2.1, Apple M5) and a local re-check here. Merged after local re-verification: this PR merged onto `main` 02944d4ca without conflict, and its test file(s) (`tests/test_viewer_studio.cjs`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2100
No description provided.