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

Open
opened 2026-11-26 21:20:04 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2100
Author: @Saauf
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: studio-failed-load-selection


📝 Commits (1)

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

📊 Changes

2 files changed (+61 additions, -5 deletions)

View changed files

📝 tests/test_viewer_studio.cjs (+49 -2)
📝 viewer/studio.html (+12 -3)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2100 **Author:** [@Saauf](https://github.com/Saauf) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `studio-failed-load-selection` --- ### 📝 Commits (1) - [`515fc75`](https://github.com/ubiquitarianism/leonida/commit/515fc75c0da42dd235301460b52a1887e0aee4b3) studio: go back to the shown model's row when a download fails (STUDIO-FAILED-LOAD-SELECTION) ### 📊 Changes **2 files changed** (+61 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_viewer_studio.cjs` (+49 -2) 📝 `viewer/studio.html` (+12 -3) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2108
No description provided.