لا يمكن فتح الصور في الدردشة المكبرة بعد إرسال رسالة تحتوي على الصورة

Reproduction steps:

1. Enlarge chat:

2.1. Post a message with a medium to big image, so that you’d expect a popup with a larger image if you click on it in the message.

OR

2.2. Receive such a message from other people in the chat.

3. Click on the image. It won’t open.

Workaround:

4. Refresh the page in the browser.

5. Click on the image - it would now open a popup with a bigger size image.

إعجابَين (2)

That’s a recent regression afayk?

إعجاب واحد (1)

Yes, I have seen this today as well. Pretty sure it’s a recent regression.

إعجاب واحد (1)

I think the issue is here:

api.decorateChatMessage(
      (element) =>
        lightbox(element.querySelectorAll("img:not(.emoji, .avatar)")),
      {
        id: "lightbox",
      }
    );

Before, api.decorateChatMessage was passing .chat-message-container element:

After, it passes .chat-cooked element:

With the images defined inside chat-message-collapser-body, lightbox can’t find the images here.

Changes introduced here: DEV: Refactor chat HTML decorating (#31309) · discourse/discourse@a0f681b · GitHub

4 إعجابات

Yes, sorry you dont see it, it’s a whisper but I have already pinged @david about it. I also think this is related to this recent change.

Thanks for checking, I didnt have the time yet to prove my theory :+1:

4 إعجابات

Thanks @meglio and @Arkshine!

Limiting the normal “decorate cooked” to only the message content is intentional. But we did add some specific lightboxing logic which was supposed to handle the images. Looks like that wasn’t handling the case where the original image is swapped out for the optimized version.

Fix here:

6 إعجابات

This topic was automatically closed after 21 hours. New replies are no longer allowed.