Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] No warning when editing a comment to an empty comment #3411

Closed
sorikang0806 opened this issue Apr 3, 2024 · 4 comments · Fixed by #3502
Closed

[bug] No warning when editing a comment to an empty comment #3411

sorikang0806 opened this issue Apr 3, 2024 · 4 comments · Fixed by #3502

Comments

@sorikang0806
Copy link

sorikang0806 commented Apr 3, 2024

Describe the bug
There is no warning or error message that notifies the user that an edited comment cannot be empty.

To Reproduce
Steps to reproduce the behaviour:

  1. Write a comment eg. on one of the research threads
  2. Click on Edit comment
  3. Remove all the characters and make an empty comment then save
  4. It doesn't change the original comment

Expected behaviour
When the save button is clicked, display a warning message that a comment cannot be empty

Screenshots
Screenshot 2024-04-02 at 11 44 59 PM
Screenshot 2024-04-02 at 11 45 07 PM
Screenshot 2024-04-02 at 11 45 23 PM

Additional context
I am a newbie here and want to try fixing this bug myself first if that is okay!

@benfurber
Copy link
Member

Thanks @sorikang0806, a really good spot!

Looks like the EditComment component and the CreateComment component should share more code so that the behaviour is consistent.

@V24039
Copy link
Contributor

V24039 commented Apr 23, 2024

Hi, I would like to work on this. After looking through the code I have made some obs

  • For CreateComment the button is disabled if the comment length is 0 i.e. no input is given. As the button is disabled I feel that an error message is not required.
  • For EditComment the store procedure function editComment is trimming the comment and checking it hence the original comment is not changed. It will require a validation at EditComment to show an error message to the user.

@benfurber
Copy link
Member

Thanks for your notes @V24039. I agree there's a challenge with how CreateComment is basically implemented completely differently to EditComment.

I see @npaddle has jumped on this too! :) Will add some feedback there too.

@onearmy-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.183.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment