[usability] In Pull Request view, commenting on changed lines is confusing #10489

Open
opened 2025-11-02 09:09:11 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @sliedes on GitHub (Mar 23, 2023).

Description

Related, but distinct: #4898 (difference: I'd still want the comments to go to the Pull Request, not the commit, and I'd view this as purely a UI issue.)

As a new user to Gitea, but familiar with Gitlab and Github, this is something that confused me at first. I'll use an arbitrarily chosen Pull Request from gitea.com as an example: https://gitea.com/gitea/act_runner/pulls/69

To be sure, the way it is implemented is logical from a "how the system is designed" point of view, but I found myself first struggling with how to comment on changed lines.

In the Pull Request view, we see three tabs: Conversation, Commits and Files Changed.

image

At least for me, the natural first approach is to look at the individual commits in the pull request to get a high level overview of the author's intent and not delve immediately into the diff of the whole. This is perhaps reinforced by having the Commits tab before the Files Changed tab. So I click on the Commits tab to see what commits there are.

image

Now I look into an individual commit by clicking on the SHA1 of one of the commits, getting into this view:

96ce0b83d7

image

Now, obviously, I am viewing a commit. From my mental perspective, though, I am still viewing the code changes of the pull request. I hovered over one of the lines, wanting to comment it. Because I had no previous experience on Gitea's "comment on PR changed lines" feature, I was left wondering if this is a feature Gitea supports at all. Only after reading #4898 I realized that Gitea does support comments on changed lines, and then it still took some figuring out how to do it.

I don't have a clear answer here about what exactly I would like to see, but I have a few suggestions. Essentially, they would involve modifying the UI so that what is shown, in some mental sense, is a "commit view inside a pull request", not a commit in isolation. For example, add an extra parameter to the commit view linking it to a pull request, like commit/96ce0b83d77ff71b026c3838dd09f4920a1a0b7d&pull_request=69. Allow commenting on the lines of the commit in that view, attaching the comments to the pull request. Also show the pull request code line comments on this view. I realize this may entail making some changes to the data included in a pull request code line comment, since commits may make cumulative changes. I don't know if the comments then should be attached "to a single commit in a pull request" to be less confusing. Perhaps?

In Github, this works pretty intuitively. See for example this: 9bb0bbb8a7 . Perhaps just take a deep look at what Github does here?

Screenshots

(see screenshots interspersed with description)

Gitea Version

1.20.0+dev-171-gb2c1c17f3

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Linux

Browser Version

Firefox 110.0.1

Originally created by @sliedes on GitHub (Mar 23, 2023). ### Description Related, but distinct: #4898 (difference: I'd still want the comments to go to the Pull Request, not the commit, and I'd view this as purely a UI issue.) As a new user to Gitea, but familiar with Gitlab and Github, this is something that confused me at first. I'll use an arbitrarily chosen Pull Request from gitea.com as an example: https://gitea.com/gitea/act_runner/pulls/69 To be sure, the way it is implemented is logical from a "how the system is designed" point of view, but I found myself first struggling with how to comment on changed lines. In the Pull Request view, we see three tabs: Conversation, Commits and Files Changed. ![image](https://user-images.githubusercontent.com/2307997/227158714-3e0aa86b-9d23-4a3e-bd73-3510fcf45dea.png) At least for me, the natural first approach is to look at the individual commits in the pull request to get a high level overview of the author's intent and not delve immediately into the diff of the whole. This is perhaps reinforced by having the Commits tab before the Files Changed tab. So I click on the Commits tab to see what commits there are. ![image](https://user-images.githubusercontent.com/2307997/227159179-2f72ae23-d15c-47e7-9e11-1d7834c829a0.png) Now I look into an individual commit by clicking on the SHA1 of one of the commits, getting into this view: https://gitea.com/gitea/act_runner/commit/96ce0b83d77ff71b026c3838dd09f4920a1a0b7d ![image](https://user-images.githubusercontent.com/2307997/227162460-3830bcb2-35d6-4395-9300-3f810afdd0a6.png) Now, obviously, I am viewing a commit. From my mental perspective, though, I am still viewing the code changes of the pull request. I hovered over one of the lines, wanting to comment it. Because I had no previous experience on Gitea's "comment on PR changed lines" feature, I was left wondering if this is a feature Gitea supports at all. Only after reading #4898 I realized that Gitea _does_ support comments on changed lines, and then it still took some figuring out how to do it. I don't have a clear answer here about what exactly I would like to see, but I have a few suggestions. Essentially, they would involve modifying the UI so that what is shown, in some mental sense, is a "commit view inside a pull request", not a commit in isolation. For example, add an extra parameter to the commit view linking it to a pull request, like commit/96ce0b83d77ff71b026c3838dd09f4920a1a0b7d&pull_request=69. Allow commenting on the lines of the commit in that view, attaching the comments to the pull request. Also show the pull request code line comments on this view. I realize this may entail making some changes to the data included in a pull request code line comment, since commits may make cumulative changes. I don't know if the comments then should be attached "to a single commit in a pull request" to be less confusing. Perhaps? In Github, this works pretty intuitively. See for example this: https://github.com/go-gitea/gitea/pull/23650/commits/9bb0bbb8a78ff0ca600a3b1c7b556c4ebb0a19fe . Perhaps just take a deep look at what Github does here? ### Screenshots (see screenshots interspersed with description) ### Gitea Version 1.20.0+dev-171-gb2c1c17f3 ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System Linux ### Browser Version Firefox 110.0.1
GiteaMirror added the topic/ui label 2025-11-02 09:09:11 -06:00
Author
Owner

@gempir commented on GitHub (Mar 23, 2023):

Is this not just comments on commits you want? Because that's exactly what Github does.

Related: https://github.com/go-gitea/gitea/issues/4898

@gempir commented on GitHub (Mar 23, 2023): Is this not just comments on commits you want? Because that's exactly what Github does. Related: https://github.com/go-gitea/gitea/issues/4898
Author
Owner

@sliedes commented on GitHub (Mar 23, 2023):

Actually, I'm not sure. I didn't look quite at how GitHub does it. I read the discussion in #4898, and the idea that comments should be tied to a pull request did seem kind of sensible to me, and the GitHub url that you get when you click s commit in PR view contains both the pull request number and the commit hash, so I assumed they will still be tied to a PR. It may be that I misunderstood what comments on commits are in GitHub. Do they have an existence separate of the PR?

I think one way of implementing this, admittedly not very beautiful, would be to just add a comment on the PR that links to the line in the commit and contains the comment text.

Even more than that, my point is that the UI is confusing. While not ideal, I think even just a note in the commit view saying that you can add comments in the Files Changed view would help alleviate this confusion.

@sliedes commented on GitHub (Mar 23, 2023): Actually, I'm not sure. I didn't look quite at how GitHub does it. I read the discussion in #4898, and the idea that comments should be tied to a pull request did seem kind of sensible to me, and the GitHub url that you get when you click s commit in PR view contains both the pull request number and the commit hash, so I assumed they will still be tied to a PR. It may be that I misunderstood what comments on commits are in GitHub. Do they have an existence separate of the PR? I think one way of implementing this, admittedly not very beautiful, would be to just add a comment on the PR that links to the line in the commit and contains the comment text. Even more than that, my point is that the UI is confusing. While not ideal, I think even just a note in the commit view saying that you can add comments in the Files Changed view would help alleviate this confusion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10489