mirror of
https://github.com/discourse/discourse.git
synced 2025-06-23 21:31:35 +08:00

It is an old bug that preview is not working for newly uploaded images. To fix it, we need to initialize lightbox when image is rendered and not when component. We have Qunit test when image is already available https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/tests/integration/components/uppy-image-uploader-test.gjs#L28 System test was added to ensure lightbox is working right after image is uploaded. <img width="1236" alt="Screenshot 2025-03-12 at 10 23 18 am" src="https://github.com/user-attachments/assets/3984306b-f351-4b35-936c-eb7f0e57ea9d" /> After fix https://github.com/user-attachments/assets/1091cd55-b24b-4640-8e8f-a60c3426ff65