RocketChat / RocketChat/Rocket.Chat
Attachment image not clickable
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Images sent as attachment using image_url are not clickable
Steps to reproduce:
- Sent message with attachment
- Add
image_urlin the attachment - Check the image
- Mouse will suggest link on hover
- Click is not implemented
Expected behavior:
When i click an image it will expand
Actual behavior:
Nothing happens
Additional context
When compared to link-preview we can see that the image attachment has a different class and attributes..
Adjusting this to the same as in link-preview the click and expand will work.
e.g.
original where click and expand is not working
<img class="gallery-item" data-src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQ6uESwmWmLq7bJbrbhquA7su_ZCMphg0aZhxvfylOdQ&s" alt="" width="360" height="360" loading="lazy" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQ6uESwmWmLq7bJbrbhquA7su_ZCMphg0aZhxvfylOdQ&s">
adjusted the class to be generic-preview and renamed data-src to data-id which enables click and expand
<img alt="" width="360" height="360" loading="lazy" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQ6uESwmWmLq7bJbrbhquA7su_ZCMphg0aZhxvfylOdQ&s" class="rcx-message-generic-preview__image preview-image" data-id="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQ6uESwmWmLq7bJbrbhquA7su_ZCMphg0aZhxvfylOdQ&s">
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the frontend for the attachment image markup using gallery-item, image_url, and rcx-message-generic-preview__image, then compare it with the link-preview rendering. Reproduce the issue with an image attachment and verify that clicking the image opens the expanded preview without affecting other attachment behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100