studio: show category names in the chosen language (carry of #2377) #3094

Merged
MoonEyes merged 3 commits from upstream-pr/3094 into main 2026-12-02 13:26:02 +00:00
MoonEyes commented 2026-12-02 10:31:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T10:31:10Z.


Claimed in the coordination issue as: STUDIO-CATEGORY-NAMES (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7197726846), the original author's item ID and claim

What and why

Carry of #2377 (syfyra), unchanged since 2026-11-26 (last commit; the only later activity is a verification comment and a draft-status review note by others). Branch = main + the author's head (both commits kept) + a clean merge, no conflicts + no commits of mine.

The studio's I18N table has a catNames entry in both languages, but nothing read it, so the category chips and the model list headers showed the server's two-language name (Транспорт (Vehicles)) whatever the language. The change:

  • The chips and the list headers show categoryLabel(cat), which is catNames[cat] of the current language, or the server's name when catNames has no entry for it.
  • The server's name stays the filter key (selectCategory, activeCategory, the search), so filtering is unchanged.
  • The chips are relabelled on a language switch from a small list kept when they are built.

The original was stacked on #2339 (STUDIO-EU-STRINGS), which has since merged; the merge with current main drops that part, so the diff against main is the category-names change only (viewer/studio.html, tests/test_viewer_studio.cjs).

Review: the only review is a draft-status note (rebase once #2339 merges, run CI, mark ready), which this branch addresses by being on current main. There are no inline review comments and no reported defects, so I made no fixes. The verification comment (VERIFY-2377) found nothing against the change.

Tested

Windows 11, Node v26.13.0, no GPU, no game files, on main 80910637f plus this branch:

  • node --test tests/test_viewer_studio.cjs: 21 tests, 21 pass.
  • Red: with viewer/studio.html restored to main's version (git show origin/main:viewer/studio.html) and the branch's test file, 21 tests, 20 pass, 1 fails: "category chips and headers show the catNames of the chosen language and keep the server name as the filter". The file was restored afterwards.
  • python -I scripts/check_no_game_data.py viewer/studio.html tests/test_viewer_studio.cjs: clean (exit 0).

Not run: the full suite, CI. The tests run the page's script in a vm context, so the HTML and CSS are not rendered and no browser was used.

GPUs tested: n/a (unit tests only)

AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests); separate read-only reviewer agent: 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)

Supersedes #2377 once merged; the original stays open until a maintainer decides.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5604618564 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3094). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T10:31:10Z. --- Claimed in the coordination issue as: STUDIO-CATEGORY-NAMES (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7197726846), the original author's item ID and claim ### What and why Carry of #2377 (syfyra), unchanged since 2026-11-26 (last commit; the only later activity is a verification comment and a draft-status review note by others). Branch = main + the author's head (both commits kept) + a clean merge, no conflicts + no commits of mine. The studio's `I18N` table has a `catNames` entry in both languages, but nothing read it, so the category chips and the model list headers showed the server's two-language name (`Транспорт (Vehicles)`) whatever the language. The change: - The chips and the list headers show `categoryLabel(cat)`, which is `catNames[cat]` of the current language, or the server's name when `catNames` has no entry for it. - The server's name stays the filter key (`selectCategory`, `activeCategory`, the search), so filtering is unchanged. - The chips are relabelled on a language switch from a small list kept when they are built. The original was stacked on #2339 (STUDIO-EU-STRINGS), which has since merged; the merge with current main drops that part, so the diff against main is the category-names change only (`viewer/studio.html`, `tests/test_viewer_studio.cjs`). Review: the only review is a draft-status note (rebase once #2339 merges, run CI, mark ready), which this branch addresses by being on current main. There are no inline review comments and no reported defects, so I made no fixes. The verification comment (VERIFY-2377) found nothing against the change. ### Tested Windows 11, Node v26.13.0, no GPU, no game files, on main 80910637f plus this branch: - `node --test tests/test_viewer_studio.cjs`: 21 tests, 21 pass. - Red: with `viewer/studio.html` restored to main's version (`git show origin/main:viewer/studio.html`) and the branch's test file, 21 tests, 20 pass, 1 fails: "category chips and headers show the catNames of the chosen language and keep the server name as the filter". The file was restored afterwards. - `python -I scripts/check_no_game_data.py viewer/studio.html tests/test_viewer_studio.cjs`: clean (exit 0). Not run: the full suite, CI. The tests run the page's script in a `vm` context, so the HTML and CSS are not rendered and no browser was used. GPUs tested: n/a (unit tests only) AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests); separate read-only reviewer agent: 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) Supersedes #2377 once merged; the original stays open until a maintainer decides. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kal0s-design commented 2026-12-02 11:05:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T11:05:34Z.


Checked in a real browser, since the description notes the tests run the script in a vm context only.

Setup: Windows 11, head c6b51d1a4 merged with current main, no conflicts. I started tools/gallery.py --models-dir on a folder of 8 placeholder .glb files named to hit every category (veh_car_a, w_pistol_a, ped_male_a, tree_oak_a and so on, 4 bytes each, no game data). The page ran in a Chromium-based browser. node --test tests/test_viewer_studio.cjs: 21 pass, 0 fail (Node 20).

Works as described:

  • RU: the chips read Транспорт (2), Оружие (1) and so on, and the accordion headers match.
  • EU: they read Vehicles (2), Vegetation & Nature (1), World & Architecture (1) and so on, again with matching headers.
  • I selected Транспорт, then switched EU → RU. The chip kept its active class and was relabelled. activeCategory stayed the server key Транспорт (Vehicles), so the filter is unaffected.

One small gap: search does not match the label it shows. The model search box says "Search by name or category...", but renderAccordionList still matches m.category, the server key. With EU selected and All chosen:

Query Result
Vegetation nothing
Architecture nothing
Nature Vegetation & Nature
World World & Architecture
Транспорт Vehicles

So a word that is only in the shown label finds nothing, while a word that is only in the hidden RU key does. Before this PR the chips showed the key itself, so this mismatch is new. A possible fix is to also test categoryLabel(m.category).toLowerCase().includes(modelSearchQuery) in the matchesSearch check. This is not a blocker.

Not checked: the 3D view. The placeholder files are not real glTF. The /vendor/ three.js requests also returned 404 in this setup.

GPUs tested: n/a (UI only).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7343412022 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3094#issuecomment-7343412022). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T11:05:34Z. --- Checked in a real browser, since the description notes the tests run the script in a `vm` context only. Setup: Windows 11, head `c6b51d1a4` merged with current `main`, no conflicts. I started `tools/gallery.py --models-dir` on a folder of 8 placeholder `.glb` files named to hit every category (`veh_car_a`, `w_pistol_a`, `ped_male_a`, `tree_oak_a` and so on, 4 bytes each, no game data). The page ran in a Chromium-based browser. `node --test tests/test_viewer_studio.cjs`: 21 pass, 0 fail (Node 20). **Works as described:** - RU: the chips read `Транспорт (2)`, `Оружие (1)` and so on, and the accordion headers match. - EU: they read `Vehicles (2)`, `Vegetation & Nature (1)`, `World & Architecture (1)` and so on, again with matching headers. - I selected `Транспорт`, then switched EU → RU. The chip kept its `active` class and was relabelled. `activeCategory` stayed the server key `Транспорт (Vehicles)`, so the filter is unaffected. **One small gap: search does not match the label it shows.** The model search box says "Search by name or category...", but `renderAccordionList` still matches `m.category`, the server key. With EU selected and All chosen: | Query | Result | |---|---| | `Vegetation` | nothing | | `Architecture` | nothing | | `Nature` | Vegetation & Nature | | `World` | World & Architecture | | `Транспорт` | Vehicles | So a word that is only in the shown label finds nothing, while a word that is only in the hidden RU key does. Before this PR the chips showed the key itself, so this mismatch is new. A possible fix is to also test `categoryLabel(m.category).toLowerCase().includes(modelSearchQuery)` in the `matchesSearch` check. This is not a blocker. Not checked: the 3D view. The placeholder files are not real glTF. The `/vendor/` three.js requests also returned 404 in this setup. GPUs tested: n/a (UI only). AI-assisted: yes (Claude Code).
MoonEyes commented 2026-12-02 11:15:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:15:27Z.


Thanks for the browser check. The search gap is fixed in f17157c8f: the model search now matches the category name shown in the chosen language as well as the server's name, so Vegetation finds Vegetation & Nature in EU while Транспорт and Nature still work. A test covers the three queries; it fails with the previous studio.html and passes now (node --test tests/test_viewer_studio.cjs: 22 pass).

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7343654374 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3094#issuecomment-7343654374). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:15:27Z. --- Thanks for the browser check. The search gap is fixed in f17157c8f: the model search now matches the category name shown in the chosen language as well as the server's name, so `Vegetation` finds Vegetation & Nature in EU while `Транспорт` and `Nature` still work. A test covers the three queries; it fails with the previous `studio.html` and passes now (`node --test tests/test_viewer_studio.cjs`: 22 pass). AI-assisted (Claude Code, Claude Opus 5.5)
enlight3d commented 2026-12-02 13:10:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T13:10:14Z.


RUN (independent run on Windows, #3094 head f17157c8f, merged locally into main 23a51c494 with git merge --no-ff, no conflicts. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)

  • History: #2377's head 45a128d32 (syfyra) is an ancestor of the head through the merge c6b51d1a4, under its author's name. The body says "no commits of mine", but the head is f17157c8f, the carrier's search fix made after Kal0s-design's browser check. The counts below are for that head.
  • node --test tests/test_viewer_studio.cjs (Node 24.18): main 21 tests pass; merge 23 pass.
  • node --test tests/test_*.cjs, the viewer suite CI runs: main 111 pass; merge 113 pass.
  • Red: main's viewer/studio.html with the head's test file gives 23 tests and 2 failures:
    • "category chips and headers show the catNames of the chosen language...": the chips read Транспорт (Vehicles) (1), where Транспорт (1) is wanted.
    • "model search matches the category name shown in the chosen language...": Vegetation finds nothing.
  • Previous head: c6b51d1a4's page with the head's tests fails the search test, which is the gap Kal0s-design reported. It also fails the camera test, because that page predates #3092 on main.
  • Mutations of the merge's viewer/studio.html, each run with tests/test_viewer_studio.cjs and restored afterwards (git status clean). 4 of 6 are killed:
    • Chips not relabelled on a language switch: killed (the chips test).
    • categoryLabel returning the server's name: killed (both new tests).
    • Search back to the server's name only, the c6b51d1a4 behaviour: killed (the search test).
    • List headers showing the server's name: killed (both new tests).
    • Survives: a chip that filters by its shown label instead of the server's name (selectCategory(categoryLabel(cat), chip) in onclick). The chips test calls selectCategory directly with the server's name, so the key the chip itself passes is not pinned. Clicking the "Vehicles" chip with this mutation would match no model.
    • Survives: the chip list not reset when chips are rebuilt (categoryChips.length = 0 dropped). Old chips would then be relabelled too, but they are no longer on the page, so nothing visible changes in the tests.

Not covered here: a real browser (the tests run the page's script in a vm context; Kal0s-design checked c6b51d1a4 in Chromium), and Linux and macOS.

Verdict: PASS. Chips and headers follow the chosen language and the filter keeps the server's key, the search matches the shown label (the gap from the browser check is fixed and pinned), red on main and green on the merge hold, and the author's commit is kept. One gap remains: no test clicks a chip, so the key passed by onclick is not pinned.

Machine: Windows 11 Pro 26300 (NTFS), i9-13900K, 64 GB, Node 24.18.0; unit tests only, no GPU or game files used.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7346456743 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3094#issuecomment-7346456743). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-12-02T13:10:14Z. --- RUN (independent run on Windows, #3094 head f17157c8f, merged locally into `main` 23a51c494 with `git merge --no-ff`, no conflicts. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) - History: #2377's head 45a128d32 (syfyra) is an ancestor of the head through the merge c6b51d1a4, under its author's name. The body says "no commits of mine", but the head is f17157c8f, the carrier's search fix made after Kal0s-design's browser check. The counts below are for that head. - `node --test tests/test_viewer_studio.cjs` (Node 24.18): main 21 tests pass; merge 23 pass. - `node --test tests/test_*.cjs`, the viewer suite CI runs: main 111 pass; merge 113 pass. - Red: `main`'s `viewer/studio.html` with the head's test file gives 23 tests and 2 failures: - "category chips and headers show the catNames of the chosen language...": the chips read `Транспорт (Vehicles) (1)`, where `Транспорт (1)` is wanted. - "model search matches the category name shown in the chosen language...": `Vegetation` finds nothing. - Previous head: c6b51d1a4's page with the head's tests fails the search test, which is the gap Kal0s-design reported. It also fails the camera test, because that page predates #3092 on `main`. - Mutations of the merge's `viewer/studio.html`, each run with `tests/test_viewer_studio.cjs` and restored afterwards (`git status` clean). 4 of 6 are killed: - Chips not relabelled on a language switch: killed (the chips test). - `categoryLabel` returning the server's name: killed (both new tests). - Search back to the server's name only, the c6b51d1a4 behaviour: killed (the search test). - List headers showing the server's name: killed (both new tests). - Survives: a chip that filters by its shown label instead of the server's name (`selectCategory(categoryLabel(cat), chip)` in `onclick`). The chips test calls `selectCategory` directly with the server's name, so the key the chip itself passes is not pinned. Clicking the "Vehicles" chip with this mutation would match no model. - Survives: the chip list not reset when chips are rebuilt (`categoryChips.length = 0` dropped). Old chips would then be relabelled too, but they are no longer on the page, so nothing visible changes in the tests. Not covered here: a real browser (the tests run the page's script in a `vm` context; Kal0s-design checked c6b51d1a4 in Chromium), and Linux and macOS. Verdict: PASS. Chips and headers follow the chosen language and the filter keeps the server's key, the search matches the shown label (the gap from the browser check is fixed and pinned), red on `main` and green on the merge hold, and the author's commit is kept. One gap remains: no test clicks a chip, so the key passed by `onclick` is not pinned. Machine: Windows 11 Pro 26300 (NTFS), i9-13900K, 64 GB, Node 24.18.0; unit tests only, no GPU or game files used.
MoonEyes commented 2026-12-02 13:13:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T13:13:45Z.


Merging. Head f17157c8f merges cleanly with main bf7886746 and does not force a rebase of #2566. Independent check on head f17157c8f: enlight3d's red/green on main + this head (2 failures with main's page: untranslated chips, empty search for a translated category; green 23 node tests, viewer suite 111 -> 113; 4 of 6 mutations killed, no test clicks a chip), comment 7346456743; syfyra's commits from #2377 are kept; CI green incl. no-game-data. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7346547092 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3094#issuecomment-7346547092). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T13:13:45Z. --- Merging. Head `f17157c8f` merges cleanly with `main` `bf7886746` and does not force a rebase of #2566. Independent check on head f17157c8f: enlight3d's red/green on main + this head (2 failures with main's page: untranslated chips, empty search for a translated category; green 23 node tests, viewer suite 111 -> 113; 4 of 6 mutations killed, no test clicks a chip), comment 7346456743; syfyra's commits from #2377 are kept; CI green incl. no-game-data. Merged by MoonEyes. AI-assisted (Claude Code).
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!3094
No description provided.