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

PR Review Add Comment increments counter in Review button but CTRL+Enter shortcut doesn't #31622

Closed
encoder9 opened this issue Jul 12, 2024 · 4 comments · Fixed by #32596
Closed
Labels

Comments

@encoder9
Copy link

Description

When reviewing a PR, adding a comment via the Add Comment button will increment the counter presented in the Review button in the top right corner.

When adding a comment and using the CTRL+Enter shortcut, the comment is added correctly, but the counter is not incremented.

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

We're running a docker container on a Linux VPC

Database

None

@henrygoodman
Copy link
Contributor

henrygoodman commented Jul 15, 2024

I'm looking into this one now. Looks like the on submit functionality doesn't trigger correctly when ctrl+enter submits the form (i.e. no submit handler is attached to the form for ctrl+enter event)

@henrygoodman
Copy link
Contributor

henrygoodman commented Jul 15, 2024

I've actually encountered another bug (its similar enough to just mention here instead of creating a new one), this is also replicable on Gitea demo site if anyone can confirm. Counter is incremented without a comment posted.

Demo Site Version: 1.23.0+dev-318-g957c75bfd2

  • PR Diff Page
  • Click + to add new comment (open dialog)
  • With empty textarea, click Start Review (or Add Comment if review already started) (click 10 times)
  • Observe the Review comment counter increments by 1 (on initial click, not supposed to increment here)
  • Enter some text so the Start Review button becomes 'clickable', click Start Review
  • Observe the comment now submits but the Review comment counter has incremented by 10 (should only be 1 for the 1 valid submission)

This is just a UI bug, the comments arent actually being submitted (i.e. reloading the page fixes it), but definitely need to fix the logic surrounding when this button is clickable/form submits and when the incrementing happens.

@henrygoodman
Copy link
Contributor

#19612

May relate to above issue (comments go over some guidelines anyway about frontend code which may be pertinent)

@wxiaoguang
Copy link
Contributor

I think it could be fixed by this: Fix PR diff review form submit #32596

wxiaoguang added a commit that referenced this issue Nov 21, 2024
Fix #31622, there is a longstanding bug in #19612, 
it doesn't handle submit event, correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants