Repository navigation
Conversation
|
Verified merged with main 1cc6e3c: node --test tests/test_viewer_studio.cjs passes 4/4, and the new resize test fails on clean main with camera.aspect NaN, so both the zero-size guard and the CSS diagnosis (the #models-view ID rule outranking .view-panel{display:none}) are load-bearing. Flag: this PR has no CI checks attached at all — worth a push. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
AI-assisted T3 Preview integration check on Windows. This head At a 1,280 px viewport, main left the Models panel displayed and placed the 48 px Textures panel at x=1280. The combination hid Models and displayed Textures at x=0 with all 1,280 px. A resize event with Models hidden preserved the finite camera aspect (1.284153) and canvas width; the aspect matched after switching back. With the local texture endpoint delayed by 300 ms, rapid reopen issued one request (503), the next visit retried once (200 with an empty list), and the following visit reused the result. Main issued four requests in the equivalent tab sequence. Local Three.js r128, synthetic HTTP responses, no game assets. |
|
Tested 96d4aab on Arch Linux, Node 26, CPU only: pass, first Linux check on this head. tests/test_viewer_studio.cjs 4/4 pass. Negative control: merge-base studio.html fails the hidden-canvas projection test (NaN aspect); restored, 4/4 green. Note: neighbor test_viewer_streaming.cjs has 1 failure (AbortController vm-context env issue), present with and without this PR's files — pre-existing, unrelated. No game files. AI-assisted. |
shadshuvo
left a comment
There was a problem hiding this comment.
Code read (CPU) ?
Review
This fix correctly prevents invalid camera projection updates when the canvas is hidden (zero width or height).
Code Quality
- ? Logic is correct: guard clause prevents NaN/Infinity aspect ratios
- ? Performance: avoids unnecessary renderer.setSize() calls on hidden canvas
- ? Comprehensive test: verifies projection preservation across multiple zero-dimension resizes
- ? All 4 studio tests pass locally
- ? Minimal change: 2 guard lines + CSS cleanup
Testing
nnode tests/test_viewer_studio.cjs ? 4 tests pass (including new projection preservation test) n
The test confirms that aspect ratio stays at 2.0 through three zero-dimension resize events, then correctly updates to 1.5 (900/600) when the tab reopens with valid dimensions.
Ready to merge.
Reviewed on Windows 11, Node v24.13.0 (AI-assisted)
|
checked: #643296d4aab | with: Environment: Linux; no GPU (llvmpipe only), no game copy, no real WebGL. clang-cl 23.1.5 + xwin / Wine 11.22-staging available but not needed for a JS/CSS change. What I ran, on GitHub
Negative control (main's Import state: not in the maintainers' forge Not run: a real browser layout pass (the Node harness stubs the DOM and renderer), WebGL/GPU paths, retail assets. AI-assisted. |
Claimed in the coordination issue.
What changed
Opening Textures left the Models panel in the flex layout. At a viewport width of 1280 px, Chrome gave roughly 628 px to Models and 652 px to Textures. Removing the ID-level display override lets the existing active-panel rule control the layout. The resize handler now waits for a nonzero canvas area before updating the projection. Switching back to Models sizes the canvas to the current viewport.
Tests
AI-assisted.