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

Closed
opened 2025-11-02 10:37:16 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @encoder9 on GitHub (Jul 12, 2024).

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

Originally created by @encoder9 on GitHub (Jul 12, 2024). ### 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
GiteaMirror added the type/bug label 2025-11-02 10:37:16 -06:00
Author
Owner

@henrygoodman commented on GitHub (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 commented on GitHub (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)
Author
Owner

@henrygoodman commented on GitHub (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 commented on GitHub (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.
Author
Owner

@henrygoodman commented on GitHub (Jul 15, 2024):

https://github.com/go-gitea/gitea/pull/19612

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

@henrygoodman commented on GitHub (Jul 15, 2024): https://github.com/go-gitea/gitea/pull/19612 May relate to above issue (comments go over some guidelines anyway about frontend code which may be pertinent)
Author
Owner

@wxiaoguang commented on GitHub (Nov 21, 2024):

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

@wxiaoguang commented on GitHub (Nov 21, 2024): I think it could be fixed by this: Fix PR diff review form submit #32596
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13281