EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

fix: Improve GIF handling and display consistency in chat messages

Open KrishnaShuk opened this issue 9 months ago • 11 comments

This PR addresses issues with GIF rendering and display consistency in chat messages.

1.Enhanced GIF detection 2.Implemented consistent sizing 3.Fixed animation handling 4.Improved URL handling

Acceptance Criteria fulfillment

  • [x] GIFs display consistently at 200x200px
  • [x] GIF animations play correctly
  • [x] Both uploaded and external GIFs work
  • [x] Error handling works for invalid GIF URLs

Fixes #982

Before

Screenshot from 2025-02-12 16-29-26

After

Screenshot from 2025-02-12 16-55-22

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.

KrishnaShuk avatar Feb 12 '25 12:02 KrishnaShuk

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 12 '25 12:02 CLAassistant

@Spiral-Memory I have made all the required changes and tested it. You can see in my latest commit.

KrishnaShuk avatar Mar 02 '25 09:03 KrishnaShuk

Sorry removing it asap!

KrishnaShuk avatar Mar 02 '25 09:03 KrishnaShuk

N make sure you format your code with prettier extension otherwise format check workflow will fail

Spiral-Memory avatar Mar 02 '25 10:03 Spiral-Memory

Removed all console logs and fixed the formatting of the files.

KrishnaShuk avatar Mar 02 '25 10:03 KrishnaShuk

Hey @Spiral-Memory! I have made the required changes. You can merge this PR.

KrishnaShuk avatar Mar 05 '25 07:03 KrishnaShuk

@SinghaAnirban005

Once this PR is deployed, Can you check this feature with locally deployed Rocket.Chat server but with cloud deployed frontend if it is working correctly

Since I can't check images etc with the deployed one, please check that

Spiral-Memory avatar Mar 26 '25 07:03 Spiral-Memory

Sure @Spiral-Memory

SinghaAnirban005 avatar Mar 26 '25 07:03 SinghaAnirban005

https://github.com/user-attachments/assets/39218158-01e5-49bc-aab2-cfd389d2e736

@Spiral-Memory Tested with different GIF's but GIF's did not render while testing with my local server

SinghaAnirban005 avatar Mar 26 '25 19:03 SinghaAnirban005

@KrishnaShuk Did you not get a 403 status response while GIF's were rendering ? If yes how did you tackle it ? Since on testing i got this status code

SinghaAnirban005 avatar Mar 27 '25 17:03 SinghaAnirban005

Thanks for the testing @SinghaAnirban005

@KrishnaShuk please look into it

Spiral-Memory avatar Mar 27 '25 17:03 Spiral-Memory

Hey @SinghaAnirban005 , I am able to send the gif with my local server. Could be some other issue.I think there is no problem with the code. Here is the video proof :- Screencast from 2025-03-30 19-35-48.webm

KrishnaShuk avatar Mar 30 '25 14:03 KrishnaShuk

@KrishnaShuk Just out of curiosity Did you use the cloud deployed fronted ? Also which browser did you use ?

SinghaAnirban005 avatar Mar 30 '25 14:03 SinghaAnirban005

The frontend is locally hosted and i am using chrome.

KrishnaShuk avatar Mar 30 '25 14:03 KrishnaShuk

https://rocketchat.github.io/EmbeddedChat/pulls/pr-984/?path=/story/embeddedchat-simple--simple

Try the same with this cloud deployed url and then let me know Thank You !

SinghaAnirban005 avatar Mar 30 '25 14:03 SinghaAnirban005

Ok i see the issue. I am working on it.

KrishnaShuk avatar Mar 30 '25 15:03 KrishnaShuk