Repository navigation
Conversation
#models-view set display: flex with an ID selector, which outranks
.view-panel { display: none }, so the models panel stayed visible when
another tab was active and the gallery was laid out beside it, off-screen.
The panel now follows .view-panel / .active like the textures panel.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
devnull34
left a comment
There was a problem hiding this comment.
Verified via Tier 2 Free Cloud (Groq gpt-oss-120b): Adjusting CSS specificity so #models-view respects .view-panel.active allows the Textures tab to hide the models view panel cleanly without pushing the gallery off-screen.
|
Correction: this overlaps #6432 (@Racurs156, opened about four hours earlier), which removes the same |
|
Closing in favour of #6432, which made the same change first and also guards the resize handler. The CSS-level test and the browser measurements here are free to reuse there. AI-assisted (Claude Code). |
|
Tested
|
Claim: #8047 (comment) (new Studio item, not on the list)
Problem
In
viewer/studio.html(served bytools/gallery.py) the Textures tab never shows the texture gallery. The tab button lights up,/api/texturesand the previews load, and the page keeps showing the model list and the 3D view.switchTabhides a panel by removing itsactiveclass, relying on.view-panel { display: none; }. But#models-view { ...; display: flex; }is an ID selector and outranks that class rule, so the models panel is never hidden. Both panels arewidth: 100%in a flex row withoverflow: hidden, so the gallery is laid out to the right of the page.Measured on main
dde82f2in Chromium (Windows 11),python -I tools/gallery.py --models-dir … --textures-dir …with hand-made files (6 one-triangle glTF/GLB models, 3 8×8 PNGs), viewport 1025 px, after clicking the tab:#models-view#textures-viewdisplay: flex, x = 0, width 1025display: flex, x = 1025, width 48 (3 cards loaded, off-screen)display: nonedisplay: flex, x = 0, width 1025 (3 cards visible)Switching back to 3D Модели on this PR: models panel
flexat full width, gallerynone, canvas 685×699 (the existingonWindowResize()call inswitchTab).Change
One declaration:
display: flexis removed from#models-view. The panel already hasclass="view-panel active", so.view-panel.active { display: flex; }gives it the same layout when its tab is active.Tests
tests/test_viewer_studio.cjs: new case that reads the page's<style>block and checks that.view-panelisdisplay: none,.view-panel.activeisdisplay: flex, and that no#<panel id>rule of aview-panelsection setsdisplay. It fails on main (#models-view must not set display) and passes here.node --test tests/test_viewer_studio.cjs: 10 of 10 pass.python -I tests/test_gallery.py: OK.viewer/vendor/(a checkout without them shows no models at all, which is Studio: load the CDN copy of three.js while parsing, so a checkout without viewer/vendor shows its models #7681's subject, not this PR's).python -I scripts/check_no_game_data.pyon both files: clean.Windows 11, Node 22.20, Python 3.13. CPU only; no game files (RTX 3080 in the machine, used only by the browser's WebGL). Not run: the other Python suites, runtime/CMake and GPU tests — none read these files.
AI-assisted (Claude Code).
🤖 Generated with Claude Code