feat: Add a Preview Feature to check the text after formatting it.
Brief Title
I need to provide users with a preview option for formatted messages before sending them, So that they can review and ensure the message appears as intended. Fixes #890
Video/Screenshots
Screencast from 2025-01-13 20-59-12.webm
PR Test Details
Hey @Spiral-Memory,
I'm not sure if this is necessary, but as a user, I wanted this feature in RC, so I started working on it without considering the requirement. If it turns out that it's not needed, please leave feedback on my changes.
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-889 after approval. Contributors are requested to replace <pr_number> with the actual PR number.
@Spiral-Memory I will improve it further, if we are including it.
Hey @thepiyush-303, this is good feature to get implemented, LGTM ! 🎉
Thankyou, @devanshkansagra
Hi @thepiyush-303 , this seems like a nice addition 🚀 ! I noticed that you're adding the marked package as a dependency. You might have observed that EC already has a markups package for handling markdowns. Could we have utilized that? 🤔 Let @Spiral-Memory confirm it once.
Hi @thepiyush-303 , this seems like a nice addition 🚀 ! I noticed that you're adding the marked package as a dependency. You might have observed that EC already has a markups package for handling markdowns. Could we have utilized that? 🤔 Let @Spiral-Memory confirm it once.
the markup you are talking about needs message body (md) to format the text, however we do not have acces to it initially.
Hi @thepiyush-303 This is a good addition, but I'm not entirely sure if it's fine to merge yet. This feature is needed, as we do want to see a preview before posting, and it would be great to have it.
However, the way it's implemented, I'm not fully convinced. Maybe you can check how other social media sites implement this, in case anyone has already done it in a similar way.
Thanks!
@Spiral-Memory feature in zulip is like this:
https://github.com/user-attachments/assets/7c72ce92-3e6e-4e62-9847-439c137a18d3
@Spiral-Memory can you please look into this also? and let me know if any changes required?
@Spiral-Memory can you please look into this also? and let me know if any changes required?
This is something that needs discussion with the team, I will let you know once i discuss and see if we can merge this
Sorry @thepiyush-303 By mistake I merged it, I have reverted this PR, please raise this again - So will still need discussion to merge this. Thanks
Alright @Spiral-Memory