go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.31k stars 5.43k forks source link

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

Open encoder9 opened 2 months ago

encoder9 commented 2 months ago

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 commented 2 months ago

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 2 months ago

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

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 2 months ago

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)