Skip to content

Fix review conversation reply #23846

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

Merged
merged 1 commit into from
Apr 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/repo/diff/comment_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
{{if $.reply}}
<button class="ui submit green tiny button btn-reply" type="submit">{{$.root.locale.Tr "repo.diff.comment.reply"}}</button>
<input type="hidden" name="reply" value="{{$.reply}}">
<input type="hidden" name="single_review" value="true">
Copy link
Member

Choose a reason for hiding this comment

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

I have a slight feeling that the current mechanism will always be somewhat erroneous:

  • With your proposed approach, it won't be possible to use replies as part of a pending review.
    The question is whether we want to allow that or not…
  • With the current approach, replies are listed as a separate review.

Copy link
Contributor Author

@wxiaoguang wxiaoguang Mar 31, 2023

Choose a reason for hiding this comment

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

That's the old behavior before the regression. At that time, a default form submission means comment but not pending.


Or maybe I made something wrong, but I haven't figured out. I felt that this fix works like before

Update: I think this fix is not wrong, see comment below.

Copy link
Contributor Author

@wxiaoguang wxiaoguang Mar 31, 2023

Choose a reason for hiding this comment

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

  • "With your proposed approach"
    That's not my proposal, that's how it worked before. Actually I think after my refactoring, the logic is slightly clearer than before, it's easier to add a correct pending behavior in the future.

  • "With the current approach, replies are listed as a separate review."
    And confirmed with Gitea 1.16, it was already like that before

So this PR only fixes the "pending" problem, I think we should leave other improvements to the future.

Screenshot of 1.16

image

Screenshot of 1.20

image

{{else}}
{{if $.root.CurrentReview}}
<button name="pending_review" type="submit" class="ui submit green tiny button btn-add-comment">{{$.root.locale.Tr "repo.diff.comment.add_review_comment"}}</button>
Expand Down