Repository navigation
studio: opening a texture no longer shows the previous one - #6697
dukefissura wants to merge 1 commit into
Conversation
…new name openModal set the new title and changed only the image's src. Chromium keeps showing the image it has while a new src loads (currentSrc stays the old URL; measured in Chromium 156), so the modal showed the last texture under the next texture's name until the new preview arrived, which for a DDS is a conversion on the server. The src attribute is now removed before the new one is set, so the modal is empty until the right picture loads, and the image's alt is the texture's name. tests/test_viewer_studio.cjs: a fake image that keeps showing its picture until a new one loads, as Chromium does; after openModal the old texture must no longer be shown. It fails before the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fi5BEBqGPiXnY67f9mzu13
|
Independent AI-assisted check of Within the same JavaScript turn as opening B, base still reported A as With B held for 1.6 seconds and C opening during that delay, the modal stayed on C on both revisions after B finished decoding in a companion thumbnail. The final modal sampled C's blue pixel and width 43; head also kept C as alt. Closing during B and reopening on C gave the same result. Stock Studio tests passed 3/3 on base and 4/4 on head with Node 24.16.0. |
|
Closing: whattheflop's check was right. Measured frame by frame in Chromium 156, the base already shows no image on the first rendered frame after the swap ( |
Claimed in the coordination issue as: STUDIO-MODAL-STALE-IMAGE (in #6603)
Depends on: none. It conflicts only textually with my STUDIO-EU-STRINGS PR and with #6529 in
tests/test_viewer_studio.cjs, where each adds a test;viewer/studio.htmlchanges don't overlap.What and why
openModalinviewer/studio.htmlset the new title and changed only the image'ssrc. Chromium keeps showing the image it already has while a newsrcloads. Measured in Chromium 156: right after the swap,currentSrcis still the old URL andnaturalWidthis still the old image's. So the texture modal showed the last texture under the next texture's name until the new preview arrived, which for a DDS means a conversion on the server.The
srcattribute is now removed before the new one is set (measured in the same browser:naturalWidthis 0 until the new image loads), so the modal shows nothing rather than the wrong texture. The image'saltis the texture's name.Tested
Linux, Node 22.23.5, plus Chromium 156 for the
currentSrc/naturalWidthmeasurement. No GPU or driver involved, no game files.node --test tests/test_viewer_studio.cjs: 4/4 on top of main 1cc6e3c.opening a texture clears the previous one instead of showing it under the new nametest uses a fake image that keeps showing its picture until a new one loads, as Chromium does. AfteropenModal, the old texture must no longer be shown. It fails without theviewer/studio.htmlchange (still showing/textures/a.png) and passes with it.tests/test_viewer_streaming.cjs: the only failure is the Shift/Ctrl test that already fails on main (fixed by test(viewer): pass AbortController and timers into camera-speed vm context #5692).git diff --checkis clean.AI-assisted: yes (Claude)
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)