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

fix(grader): Sending two comments on the same line won't multiple com… #363

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

yammesicka
Copy link
Member

…ments

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Type: Bug fix

PR Summary: The pull request introduces a fix to the grader functionality where previously, sending two comments on the same line could result in multiple comments being sent unintentionally. The changes include the addition of a named function for handling 'keydown' events on textareas, which upon a successful comment submission (using CTRL + ENTER), clears the textarea's value and removes the event listener to prevent duplicate submissions. Additionally, the event listener is now properly attached to the specific textarea element, enhancing the specificity and reliability of the event handling.

Decision: Comment

📝 Type: 'Bug fix' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Consider adding comments within the code to explain the rationale behind removing the event listener after a comment is sent. This could help future maintainers understand the decision-making process.
  • Review the use of both 'ev.key' and 'ev.which' for determining the ENTER key press. Modern browsers support 'ev.key', so if there's no explicit requirement to support very old browsers, simplifying the condition to only check 'ev.key' might improve code readability.
  • Ensure thorough testing across different browsers and devices to confirm that the removal of the event listener does not interfere with other functionalities and that all intended behaviors work as expected.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.12%. Comparing base (74fa1c1) to head (79d26cd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #363   +/-   ##
=======================================
  Coverage   80.12%   80.12%           
=======================================
  Files          63       63           
  Lines        2953     2953           
=======================================
  Hits         2366     2366           
  Misses        587      587           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yammesicka yammesicka merged commit cd09e7c into master Feb 24, 2024
3 checks passed
@yammesicka yammesicka deleted the fix-multiple-comments branch February 24, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant