feat(ui): improve the user experience to review individual commits in a pull request #7155

Merged
earl-warren merged 9 commits from sclu1034/forgejo:feat/single-commit-review into forgejo 2025-06-17 09:31:57 +02:00
Member

This implements the UI controls and information displays necessary to allow reviewing pull requests by stepping through commits individually.

Notable changes:

  • Within the PR page, commit links now stay in the PR context by navigating to {owner}/{repo}/pulls/{id}/commits/{sha}
  • When showing a single commit in the "Files changed" tab, the commit header containing commit message and metadata is displayed
    • I dropped the existing buttons, since they make less sense to me in the PR context
    • The SHA links to the separate, dedicated commit view
  • "Previous"/"Next" buttons have been added to that header to allow stepping through commits
  • Reviews can be submitted in "single commit" view

Talking points:

  • The "Showing only changes from" banner made sense when that view was limited (e.g. review submit was disabled). Now that it's on par with the "all commits" view, and visually distinct due to the commit header, this banner could potentially be dropped.

Closes: #5670 #5126 #5671 #2281 #8084

image

Checklist

The contributor guide contains information that will be helpful to first time contributors. There also are a few conditions for merging Pull Requests in Forgejo repositories. You are also welcome to join the Forgejo development chatroom.

Tests

  • I added test coverage for Go changes...
    • in their respective *_test.go for unit tests.
    • in the tests/integration directory if it involves interactions with a live Forgejo server.
  • I added test coverage for JavaScript changes...

Documentation

  • I created a pull request to the documentation to explain to Forgejo users how to use this change.
  • I did not document these changes and I do not expect someone else to do it.

Release notes

  • I do not want this change to show in the release notes.
  • I want the title to show in the release notes with a link to this pull request.
  • I want the content of the release-notes/<pull request number>.md to be be used for the release notes instead of the title.

Release notes

  • User Interface features
    • PR: feat(ui): improve the user experience to review individual commits in a pull request
This implements the UI controls and information displays necessary to allow reviewing pull requests by stepping through commits individually. Notable changes: - Within the PR page, commit links now stay in the PR context by navigating to `{owner}/{repo}/pulls/{id}/commits/{sha}` - When showing a single commit in the "Files changed" tab, the commit header containing commit message and metadata is displayed - I dropped the existing buttons, since they make less sense to me in the PR context - The SHA links to the separate, dedicated commit view - "Previous"/"Next" buttons have been added to that header to allow stepping through commits - Reviews can be submitted in "single commit" view Talking points: - The "Showing only changes from" banner made sense when that view was limited (e.g. review submit was disabled). Now that it's on par with the "all commits" view, and visually distinct due to the commit header, this banner could potentially be dropped. Closes: #5670 #5126 #5671 #2281 #8084 ![image](/attachments/cff441dc-a080-42f8-86ae-9b80490761bf) ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [ ] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [x] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. <!--start release-notes-assistant--> ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> - User Interface features - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description--> <!--end release-notes-assistant-->
sclu1034 force-pushed feat/single-commit-review from 052d49cab6
Some checks failed
issue-labels / backporting (pull_request_target) Has been skipped
issue-labels / cascade (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Failing after 57s
testing / backend-checks (pull_request) Successful in 4m21s
Integration tests for the release process / release-simulation (pull_request) Successful in 6m3s
testing / test-unit (pull_request) Has been skipped
testing / test-e2e (pull_request) Has been skipped
testing / test-mysql (pull_request) Has been skipped
testing / test-pgsql (pull_request) Has been skipped
testing / test-sqlite (pull_request) Has been skipped
requirements / merge-conditions (pull_request) Failing after 7s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / test-remote-cacher (redis) (pull_request) Has been skipped
testing / test-remote-cacher (valkey) (pull_request) Has been skipped
testing / test-remote-cacher (garnet) (pull_request) Has been skipped
testing / test-remote-cacher (redict) (pull_request) Has been skipped
testing / security-check (pull_request) Has been skipped
to af3d4e7c14
Some checks failed
testing / frontend-checks (pull_request) Successful in 1m21s
testing / backend-checks (pull_request) Successful in 3m36s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m54s
testing / test-unit (pull_request) Successful in 6m17s
testing / test-e2e (pull_request) Successful in 8m5s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m23s
testing / test-remote-cacher (valkey) (pull_request) Successful in 2m25s
testing / test-remote-cacher (garnet) (pull_request) Successful in 2m13s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m55s
testing / test-mysql (pull_request) Failing after 20m15s
testing / test-sqlite (pull_request) Failing after 21m47s
testing / test-pgsql (pull_request) Failing after 25m52s
testing / security-check (pull_request) Failing after 11m36s
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / backporting (pull_request_target) Has been skipped
issue-labels / cascade (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Has been skipped
2025-03-07 15:41:42 +01:00
Compare
Gusted left a comment
Owner

Will do a proper review later.

Will do a proper review later.
@ -932,0 +957,4 @@
}
if curCommit == nil {
ctx.ServerError("Repo.GitRepo.viewPullFiles", git.ErrNotExist{ID: commitID})
Owner

add return here.

add `return` here.
Author
Member

Fixed in 13a6b16993

Fixed in https://codeberg.org/forgejo/forgejo/commit/13a6b169930cae8f608c4e4401c7e07f0da54927
earl-warren marked this conversation as resolved
@ -1511,1 +1511,3 @@
m.Get("/{sha:[a-f0-9]{4,40}}", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForSingleCommit)
m.Group("/{sha:[a-f0-9]{4,40}}", func() {
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForSingleCommit)
m.Post("/reviews/submit", web.Bind(forms.SubmitReviewForm{}), repo.SubmitReview)
Owner

Please add context.RepoMustNotBeArchived() to the middleware (before web.Bind)

Please add `context.RepoMustNotBeArchived()` to the middleware (before `web.Bind`)
Author
Member

Fixed in c2f32ded99

Fixed in https://codeberg.org/forgejo/forgejo/commit/c2f32ded99f424fe11166ccf89b6735c9214d89b
earl-warren marked this conversation as resolved
Member

Hi, I'd just like to comment that this is a very good concept that would solve one of my biggest problems with the "GitHub-like workflows" and I hope that this makes it into Forgejo. Thank you for working on this!

Hi, I'd just like to comment that this is a very good concept that would solve one of my biggest problems with the "GitHub-like workflows" and I hope that this makes it into Forgejo. Thank you for working on this!
First-time contributor

In #5670, the user also mentioned wanting to "review" the commit message by having a comment field attached to the overall commit rather than code. As a potential solution, I kept the button to edit commit notes (from #4753) in the header.
This may, however, lead to confusion, as people might assume that this note functions like a review comment. Especially when the button is situated right next to the navigation buttons.
I'm not a huge fan of this, so I've kept it as a separate commit that can easily be dropped.

I didn't have a closer look so far, but I think what we want is the possibility to leave an actual review comment (that can be resolved, etc.) on the commit message and not a commit note. I share your doubts here and also think that this will probably cause confusion more than it actually helps to solve the problem.

I created a separate issue for the "review commit messages" aspect here: #7353.

> In #5670, the user also mentioned wanting to "review" the commit message by having a comment field attached to the overall commit rather than code. As a potential solution, I kept the button to edit commit notes (from #4753) in the header. This may, however, lead to confusion, as people might assume that this note functions like a review comment. Especially when the button is situated right next to the navigation buttons. I'm not a huge fan of this, so I've kept it as a separate commit that can easily be dropped. I didn't have a closer look so far, but I think what we want is the possibility to leave an actual review comment (that can be resolved, etc.) on the commit message and not a commit note. I share your doubts here and also think that this will probably cause confusion more than it actually helps to solve the problem. I created a separate issue for the "review commit messages" aspect here: https://codeberg.org/forgejo/forgejo/issues/7353.
First-time contributor

I've just started migrating to codeberg and the lack of contextual PR navigation was the only thing so far that was limiting. Many thanks and kudos for implementing it! 👏🏼👏🏼

Please let's try and get this feature in. I'm not a go programmer, but will help out in any way I can if anyone requests it.

I've just started migrating to codeberg and the lack of contextual PR navigation was the only thing so far that was limiting. Many thanks and kudos for implementing it! 👏🏼👏🏼 Please let's try and get this feature in. I'm not a go programmer, but will help out in any way I can if anyone requests it.
Contributor

It needs conflict resolution and addressing review comments to move forward.

It needs conflict resolution and addressing review comments to move forward.
Author
Member

If you mean the comments from Gusted, those have already been addressed by the commits afterwards.

If you mean the comments from Gusted, those have already been addressed by the commits afterwards.
Contributor

In that case you need to answer the review comment to say so. The reviewer can't be expected to read each commit that is pushed to figure out which one may address a comment that they made. Establishing that relationship falls on you, otherwise it may be missed. And it was evidently missed.

Then there is the matter of marking the review "resolved" or not. I personally think it is better to let the reviewer decide, based on the answer you made, if their comment was correctly addressed or not. But that's not a fixed rule.

In that case you need to answer the review comment to say so. The reviewer can't be expected to read each commit that is pushed to figure out which one may address a comment that they made. Establishing that relationship falls on you, otherwise it may be missed. And it was evidently missed. Then there is the matter of marking the review "resolved" or not. I personally think it is better to let the reviewer decide, based on the answer you made, if their comment was correctly addressed or not. But that's not a fixed rule.
sclu1034 force-pushed feat/single-commit-review from 85bb983c0d
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 53s
testing / backend-checks (pull_request) Successful in 3m31s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m22s
testing / test-unit (pull_request) Successful in 5m54s
testing / test-e2e (pull_request) Successful in 7m42s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m3s
testing / test-remote-cacher (valkey) (pull_request) Successful in 2m2s
testing / test-remote-cacher (redict) (pull_request) Successful in 2m3s
testing / test-remote-cacher (garnet) (pull_request) Successful in 2m6s
testing / test-mysql (pull_request) Failing after 18m50s
testing / test-sqlite (pull_request) Failing after 20m33s
testing / test-pgsql (pull_request) Failing after 24m31s
testing / security-check (pull_request) Has been skipped
to 61583a3b58
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 56s
testing / backend-checks (pull_request) Failing after 1m25s
testing / test-unit (pull_request) Has been skipped
testing / test-e2e (pull_request) Has been skipped
testing / test-mysql (pull_request) Has been skipped
testing / test-pgsql (pull_request) Has been skipped
testing / test-sqlite (pull_request) Has been skipped
testing / test-remote-cacher (redis) (pull_request) Has been skipped
testing / test-remote-cacher (valkey) (pull_request) Has been skipped
testing / test-remote-cacher (garnet) (pull_request) Has been skipped
testing / test-remote-cacher (redict) (pull_request) Has been skipped
testing / security-check (pull_request) Has been skipped
2025-05-03 16:14:21 +02:00
Compare
Owner

@sclu1034 sorry for the inconvenience, the CI failure is not your fault. You need to rebase when #7772 is merged.

@sclu1034 sorry for the inconvenience, the CI failure is not your fault. You need to rebase when https://codeberg.org/forgejo/forgejo/pulls/7772 is merged.
sclu1034 force-pushed feat/single-commit-review from 61583a3b58
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 56s
testing / backend-checks (pull_request) Failing after 1m25s
testing / test-unit (pull_request) Has been skipped
testing / test-e2e (pull_request) Has been skipped
testing / test-mysql (pull_request) Has been skipped
testing / test-pgsql (pull_request) Has been skipped
testing / test-sqlite (pull_request) Has been skipped
testing / test-remote-cacher (redis) (pull_request) Has been skipped
testing / test-remote-cacher (valkey) (pull_request) Has been skipped
testing / test-remote-cacher (garnet) (pull_request) Has been skipped
testing / test-remote-cacher (redict) (pull_request) Has been skipped
testing / security-check (pull_request) Has been skipped
to d59b2c12d6
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 49s
testing / backend-checks (pull_request) Successful in 3m1s
testing / test-unit (pull_request) Successful in 7m24s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m6s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m50s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m49s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m49s
testing / test-mysql (pull_request) Failing after 23m37s
testing / test-sqlite (pull_request) Failing after 28m29s
testing / test-pgsql (pull_request) Failing after 31m37s
testing / security-check (pull_request) Has been skipped
testing / test-e2e (pull_request) Failing after 6m39s
2025-05-03 18:28:27 +02:00
Compare
Contributor

I now have an understanding of what you're after and that's something I'd like in theory: using the single commit view is currently rarely convenient. I like that you've made individual commits that are well designed and isolated. The path is quite clear and that's an areas that needed love for some time ❤️

As with every UX / UI change, there will be discussions and opinions at every turn. For that you'll benefit from having individual pull requests so you're not frustrated by very long and hairy reviews.

A first (and rather non controversial) PR could be to restructure the template, add tests (which you did for JavaScript already but I suspect you'll need a few more to verify the template is evaluated properly and that the test breaks if you insert a typo somewhere in a template variable). This is the tedious part (not good) but also an immediate merge (very good) as it would change nothing and improve the test coverage of the existing code.

Once this is done it will be comparatively a lot less code for a PR that adds Next / Prev but more UX design discussions.


I have opinions on how the code added to the function should be split in a different function to not inflate the complexity too much, but that will, I think, get resolved as a side effect of having a series of PR rather than a single one.

I now have an understanding of what you're after and that's something I'd like in theory: using the single commit view is currently rarely convenient. I like that you've made individual commits that are well designed and isolated. The path is quite clear and that's an areas that needed love for some time ❤️ As with every UX / UI change, there will be discussions and opinions at every turn. For that you'll benefit from having individual pull requests so you're not frustrated by very long and hairy reviews. A first (and rather non controversial) PR could be to restructure the template, add tests (which you did for JavaScript already but I suspect you'll need a few more to verify the template is evaluated properly and that the test breaks if you insert a typo somewhere in a template variable). This is the tedious part (not good) but also an immediate merge (very good) as it would change nothing and improve the test coverage of the existing code. Once this is done it will be comparatively a lot less code for a PR that adds Next / Prev but more UX design discussions. --- I have opinions on how the code added to the function should be split in a different function to not inflate the complexity too much, but that will, I think, get resolved as a side effect of having a series of PR rather than a single one.
Owner

TestPullDiff tests are failing.

`TestPullDiff` tests are failing.
Contributor

@sclu1034 I made a note to spend time reviewing this pull request (and possibly other related pull requests) early June. Unless someone beats me to it, of course, I don't mean that as blocking other reviewers 😇 Just that I won't forget about it.

@sclu1034 I made a note to spend time reviewing this pull request (and possibly other related pull requests) early June. Unless someone beats me to it, of course, I don't mean that as blocking other reviewers 😇 Just that I won't forget about it.
Contributor

As promised I'm back to take a looks but see that it did not change and you did not reply @sclu1034. Did you notice my comment? What do you think about my suggestions?

As promised I'm back to take a looks but see that it did not change and you did not reply @sclu1034. Did you notice my comment? What do you think about my suggestions?
Author
Member

@earl-warren wrote in #7155 (comment):

Did you notice my comment? What do you think about my suggestions?

I did notice them, but they weren't directly actionable to me. And I refrained from replying at the time, both to give myself the opportunity for a another look at this later, and because it was already clear that a discussion could only happen at a later time.


You mentioned splitting off the template restructure and adding tests with the only specific example being that it should "[break] if you insert a typo somewhere in a template variable". As far as I'm aware that would already be covered by the template failing to compile.
So bar further examples, and with my lack of experience with the code base at the time, I did not come up with suitable test cases to work on back then.

That did change when I looked at this again yesterday, so that's something I started working on.


As for the general concept of splitting into small PRs, in my opinion, very few of the changes here make sense by themselves.
If, for example, "Link to PR-scoped commit" was merged on its own, it would make for an inferior product, because without the commit header, the view is less useful than the commit view, and without also adding the the prev/next buttons to the header it is tedious to navigate.

And I think it would also make it harder to keep the context of the change known to everyone involved, both reviewers and myself, in terms of how a discussion/change in one thing might affect everything else.

Additionally, I feel like a lot of small PRs, where each one can only start when the previous one has been merged, would lead to the longer reviews overall compared to the single one where, for example, the UX of the prev/next buttons can already be commented on while I might still be working on tests for the commit header.

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-4980000: > Did you notice my comment? What do you think about my suggestions? I did notice them, but they weren't directly actionable to me. And I refrained from replying at the time, both to give myself the opportunity for a another look at this later, and because it was already clear that a discussion could only happen at a later time. --- You mentioned splitting off the template restructure and adding tests with the only specific example being that it should "[break] if you insert a typo somewhere in a template variable". As far as I'm aware that would already be covered by the template failing to compile. So bar further examples, and with my lack of experience with the code base at the time, I did not come up with suitable test cases to work on back then. That did change when I looked at this again yesterday, so that's something I started working on. --- As for the general concept of splitting into small PRs, in my opinion, very few of the changes here make sense by themselves. If, for example, "Link to PR-scoped commit" was merged on its own, it would make for an inferior product, because without the commit header, the view is less useful than the commit view, and without also adding the the prev/next buttons to the header it is tedious to navigate. And I think it would also make it harder to keep the context of the change known to everyone involved, both reviewers and myself, in terms of how a discussion/change in one thing might affect everything else. Additionally, I feel like a lot of small PRs, where each one can only start when the previous one has been merged, would lead to the longer reviews overall compared to the single one where, for example, the UX of the prev/next buttons can already be commented on while I might still be working on tests for the commit header.
Author
Member

As mentioned, since it is a reasonably independent change, the template extraction is now also a separate PR at #8061.

This PR has been rebased on top of that.

As mentioned, since it is a reasonably independent change, the template extraction is now also a separate PR at #8061. This PR has been rebased on top of that.
sclu1034 force-pushed feat/single-commit-review from d59b2c12d6
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 49s
testing / backend-checks (pull_request) Successful in 3m1s
testing / test-unit (pull_request) Successful in 7m24s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m6s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m50s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m49s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m49s
testing / test-mysql (pull_request) Failing after 23m37s
testing / test-sqlite (pull_request) Failing after 28m29s
testing / test-pgsql (pull_request) Failing after 31m37s
testing / security-check (pull_request) Has been skipped
testing / test-e2e (pull_request) Failing after 6m39s
to 1a3fd1e649
All checks were successful
requirements / merge-conditions (pull_request) Successful in 5s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 2m3s
testing / backend-checks (pull_request) Successful in 4m47s
Integration tests for the release process / release-simulation (pull_request) Successful in 7m0s
testing / test-unit (pull_request) Successful in 6m56s
testing / test-e2e (pull_request) Successful in 8m22s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m46s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m46s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m45s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m46s
testing / test-mysql (pull_request) Successful in 18m45s
testing / test-sqlite (pull_request) Successful in 22m29s
testing / test-pgsql (pull_request) Successful in 24m56s
testing / security-check (pull_request) Successful in 44s
2025-06-03 14:28:27 +02:00
Compare
Contributor

@sclu1034 wrote in #7155 (comment):

You mentioned splitting off the template restructure and adding tests with the only specific example being that it should "[break] if you insert a typo somewhere in a template variable". As far as I'm aware that would already be covered by the template failing to compile. So bar further examples, and with my lack of experience with the code base at the time, I did not come up with suitable test cases to work on back then.

That did change when I looked at this again yesterday, so that's something I started working on.

Great.

As for the general concept of splitting into small PRs, in my opinion, very few of the changes here make sense by themselves. If, for example, "Link to PR-scoped commit" was merged on its own, it would make for an inferior product, because without the commit header, the view is less useful than the commit view, and without also adding the the prev/next buttons to the header it is tedious to navigate.

And I think it would also make it harder to keep the context of the change known to everyone involved, both reviewers and myself, in terms of how a discussion/change in one thing might affect everything else.

I agree and your approach to have cleanly organized commits is helpful to review this pull request.

Additionally, I feel like a lot of small PRs, where each one can only start when the previous one has been merged, would lead to the longer reviews overall compared to the single one where, for example, the UX of the prev/next buttons can already be commented on while I might still be working on tests for the commit header.

I also agree.

@sclu1034 wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-4981041: > You mentioned splitting off the template restructure and adding tests with the only specific example being that it should "[break] if you insert a typo somewhere in a template variable". As far as I'm aware that would already be covered by the template failing to compile. So bar further examples, and with my lack of experience with the code base at the time, I did not come up with suitable test cases to work on back then. > > That did change when I looked at this again yesterday, so that's something I started working on. Great. > As for the general concept of splitting into small PRs, in my opinion, very few of the changes here make sense by themselves. If, for example, "Link to PR-scoped commit" was merged on its own, it would make for an inferior product, because without the commit header, the view is less useful than the commit view, and without also adding the the prev/next buttons to the header it is tedious to navigate. > > And I think it would also make it harder to keep the context of the change known to everyone involved, both reviewers and myself, in terms of how a discussion/change in one thing might affect everything else. I agree and your approach to have cleanly organized commits is helpful to review this pull request. > Additionally, I feel like a lot of small PRs, where each one can only start when the previous one has been merged, would lead to the longer reviews overall compared to the single one where, for example, the UX of the prev/next buttons can already be commented on while I might still be working on tests for the commit header. I also agree.
Contributor

Please rebase. In the meantime I'll play with it manually and make a detailed review.

Please rebase. In the meantime I'll play with it manually and make a detailed review.
Contributor

First hand UX experience - per commit review selection

Preparation

  • Add two commits to a PR in a new repository
  • As a different user visit the file review tab and chose a commit
    image

Without this PR

  • Select the first one and open the commit selection menu, visually match the commit number to see which one is current
    image
  • Select the second one and open the commit selection menu
    image
  • Click Show all commits and click on Finish review
    image
  • Submit a review and see it is redirected to the pull request main page
    image

With this PR

  • Select the first one and see the Next button is active the Prev button is not. Also note that the commit message is displayed (without buttons to display the branches, etc.)
    image
  • Click Next and see the Prev button is active the Next button is not
    image
  • Select two commits out of three and see the Prev and Next buttons are not displayed
    image
  • Click Finish review
    image
  • Submit a review and see it is redirected to the pull request main page
    image
First hand UX experience - per commit review selection ## Preparation * Add two commits to a PR in a new repository * As a different user visit the file review tab and chose a commit ![image](/attachments/e26248cd-54cb-47bd-80bc-f14d3b52524e) ## Without this PR * Select the first one and open the commit selection menu, visually match the commit number to see which one is current ![image](/attachments/6b531adb-4221-4dd0-8bbe-857ca414bb87) * Select the second one and open the commit selection menu ![image](/attachments/9de76a4c-3556-4bd3-ab9e-cfda339e12be) * Click Show all commits and click on Finish review ![image](/attachments/840bde96-ce3e-4ea0-9c5f-333136a87550) * Submit a review and see it is redirected to the pull request main page ![image](/attachments/751d9e82-b742-4f40-85dd-4bbeb47af8f1) ## With this PR * Select the first one and see the Next button is active the Prev button is not. Also note that the commit message is displayed (without buttons to display the branches, etc.) ![image](/attachments/2d175153-9b56-4066-88a2-5b70fa5623e4) * Click Next and see the Prev button is active the Next button is not ![image](/attachments/b2306a8b-a7e1-403e-a447-e38d9f2723d0) * Select two commits out of three and see the Prev and Next buttons are not displayed ![image](/attachments/833d82b6-629b-4b9c-8ad7-f602db48e153) * Click Finish review ![image](/attachments/47173d44-d6b4-4b30-9a09-4df82e362286) * Submit a review and see it is redirected to the pull request main page ![image](/attachments/b58ab324-7ef7-4b78-9345-4ad26fc0d057)
Contributor

Here is how I see the "needs and benefits" section of an hypothetical feature request (it may be a good idea to create one, even if only for the sake of the UX debate). I find best if this section focuses on collecting evidence of the UX problem rather than hinting on a possible solution. This PR is already a solution and my intent here is more to establish a clear problem statement a-posteriori rather than revisiting the proposed UX entirely. In other words, even if there could be a different UX to solve that same problem, I would prefer this one because I tried it and find it solves the problem for me. And also because an existing working solution should only be discarded if it tries to solve a non-existing problem or if it is horribly implemented.

Needs and benefits

When reviewing a pull request that has multiple commits well organized in a series, it may be convenient to review them one by one instead of browsing the entire diff of the accumulated commits. This is possible with a select menu.

image

To better understand the diff, the commit message can be displayed by opening the "Commits" in another browser tab, visually finding the SHA of the corresponding commit (the title is not displayed in the per-commit review page) and clicking on it.

The menu can then be used again to select another commit. To do so the review needs visually match the SHA of the current commit in the menu if they want to work on them sequentially.

Once the reviewer is done, they need to either select "Show all commits" from the menu to submit the review (it is not active when reviewing a single commit) or click on "Files changed".

First hand testimonies:

  • @earl-warren likes reviewing neatly organized commit series and tried to use this feature. He ran into two problems (i) visually matching the current commit from the list and moving to the next one required memorizing the SHA (ii) the absence of the commit message on the display required navigating outside of the view to get it and not ask questions for which the answer could be found in the commit message. This was too cumbersome and he stopped using this feature . The first time he used this feature, he also got confused about how to finalize the review and clicked on "Files changed", thinking they may have missed another way to do it. And he discovered later that "showing all commits" would have also worked fine.
  • ... (add more testimonies here)
Here is how I see the "needs and benefits" section of an hypothetical feature request (it may be a good idea to create one, even if only for the sake of the UX debate). I find best if this section focuses on collecting evidence of the UX problem rather than hinting on a possible solution. This PR is already a solution and my intent here is more to establish a clear problem statement a-posteriori rather than revisiting the proposed UX entirely. In other words, even if there could be a different UX to solve that same problem, I would prefer this one because I tried it and find it solves the problem for me. And also because an existing working solution should only be discarded if it tries to solve a non-existing problem or if it is horribly implemented. ### Needs and benefits When reviewing a pull request that has multiple commits well organized in a series, it may be convenient to review them one by one instead of browsing the entire diff of the accumulated commits. This is possible with a select menu. ![image](/attachments/31903085-2ec4-444e-b06c-78aab9934772) To better understand the diff, the commit message can be displayed by opening the "Commits" in another browser tab, visually finding the SHA of the corresponding commit (the title is not displayed in the per-commit review page) and clicking on it. The menu can then be used again to select another commit. To do so the review needs visually match the SHA of the current commit in the menu if they want to work on them sequentially. Once the reviewer is done, they need to either select "Show all commits" from the menu to submit the review (it is not active when reviewing a single commit) or click on "Files changed". First hand testimonies: * @earl-warren likes reviewing neatly organized commit series and tried to use this feature. He ran into two problems (i) visually matching the current commit from the list and moving to the next one required memorizing the SHA (ii) the absence of the commit message on the display required navigating outside of the view to get it and not ask questions for which the answer could be found in the commit message. This was too cumbersome and he stopped using this feature . The first time he used this feature, he also got confused about how to finalize the review and clicked on "Files changed", thinking they may have missed another way to do it. And he discovered later that "showing all commits" would have also worked fine. * ... (add more testimonies here)
Contributor

First hand UX experience - navigating commits linked from a pull request

Preparation

  • Add three commits to a PR in a new repository
  • Visit the commit tab of the pull request
    image

Without this PR

  • Click on the SHA of a commit or the title of the commit, see the commit is displayed as if browsing the commit list of the branch
    image
  • Move to the conversation tab of the pull request, click on any of the links to SHA or title, , see the commit is displayed as if browsing the commit list of the branch
    image

With this PR

  • Click on the SHA of a commit or the title of the commit, see the per-commit review view is displayed, with only the matching commit displayed
    image
  • Move to the conversation tab of the pull request, click on any of the links to SHA or title, see the per-commit review view is displayed, with only the matching commit
    image
First hand UX experience - navigating commits linked from a pull request ## Preparation * Add three commits to a PR in a new repository * Visit the commit tab of the pull request ![image](/attachments/98878883-8fa5-4ac1-af34-9251d62bb0ad) ## Without this PR * Click on the SHA of a commit or the title of the commit, see the commit is displayed as if browsing the commit list of the branch ![image](/attachments/14216c22-7d00-4fe8-830d-79f83219f554) * Move to the conversation tab of the pull request, click on any of the links to SHA or title, , see the commit is displayed as if browsing the commit list of the branch ![image](/attachments/15d6d22a-6cc2-40c0-b448-b79786473e1d) ## With this PR * Click on the SHA of a commit or the title of the commit, see the per-commit review view is displayed, with only the matching commit displayed ![image](/attachments/ffc9f6c5-7f7a-4e3e-acd3-88481b1cf57c) * Move to the conversation tab of the pull request, click on any of the links to SHA or title, see the per-commit review view is displayed, with only the matching commit ![image](/attachments/15d6d22a-6cc2-40c0-b448-b79786473e1d)
earl-warren approved these changes 2025-06-05 13:49:20 +02:00
Dismissed
earl-warren left a comment
Contributor

Great piece of work 👍

From my point of view this is ready to merge but it needs review from @forgejo/UI, an area in which I'm not comfortable with. I hope my manual tests will help them and I'm sure the JavaScript tests you wrote will go a long way to speed up things.

I've been personally discouraged by the current UX and I wellcome this change. However, I think it is worth creating a minimal feature request issue (maybe re-using the "needs and benefits" section I suggested, or something else if you like). And with that collecting a few more first hand testimonies regarding how people have used the current UX and the problems they had, if any. It is, I think, enough to have a few. People expressing support for the feature request are absolutely not needed (although it is good for morale 😁). The goal is to collect facts, not speculations or opinions. If something think this is bad UX, they are entitled to their opinion but this is not helpful. If people remember being confused and can describe how, this is super useful.

Great piece of work 👍 From my point of view this is ready to merge but it needs review from @forgejo/UI, an area in which I'm not comfortable with. I hope my manual tests will help them and I'm sure the JavaScript tests you wrote will go a long way to speed up things. I've been personally discouraged by the current UX and I wellcome this change. However, I think it is worth creating a minimal feature request issue (maybe re-using the "needs and benefits" section I suggested, or something else if you like). And with that collecting a few more first hand testimonies regarding how people have used the current UX and the problems they had, if any. It is, I think, enough to have a few. People expressing support for the feature request are absolutely not needed (although it is good for morale 😁). The goal is to collect facts, not speculations or opinions. If something **think** this is bad UX, they are entitled to their opinion but this is not helpful. If people remember being confused and can describe how, this is super useful.
@ -49,6 +49,9 @@
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji $.Context}}</span>
{{else}}
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
{{if $.PageIsPullCommits}}
Contributor

Non blocking suggestion: if - else instead of overwriting.

Non blocking suggestion: if - else instead of overwriting.
Author
Member

The variable would still need to be declared outside the if block, otherwise it fails with

??? [TestLogger] 2025/06/05 14:32:56 ...ates/htmlrenderer.go:140:wrapTmplErrMsg() [F] Forgejo can't run with template errors: template error: builtin(static):repo/commits_list:56 : undefined
variable "$commitLink"
----------------------------------------------------------------------
                                                                <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.
Context .Message $commitLink ($.Repository.ComposeMetas ctx)}}</span>
----------------------------------------------------------------------

So if the else is desired, it would have to look like this:

{{$commitLink := ""}}
{{if $.PageIsPullCommits}}
  {{$commitLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}}
{{else}}
  {{$commitLink = printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
{{end}}

The variable would still need to be declared outside the if block, otherwise it fails with ``` ??? [TestLogger] 2025/06/05 14:32:56 ...ates/htmlrenderer.go:140:wrapTmplErrMsg() [F] Forgejo can't run with template errors: template error: builtin(static):repo/commits_list:56 : undefined variable "$commitLink" ---------------------------------------------------------------------- <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $. Context .Message $commitLink ($.Repository.ComposeMetas ctx)}}</span> ---------------------------------------------------------------------- ``` So if the `else` is desired, it would have to look like this: ```tmpl {{$commitLink := ""}} {{if $.PageIsPullCommits}} {{$commitLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} {{else}} {{$commitLink = printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} {{end}} ```
Contributor

I don't have strong feelings about that, it is fine as it is.

I don't have strong feelings about that, it is fine as it is.
earl-warren marked this conversation as resolved
@ -53,7 +53,7 @@
{{if not .DiffNotAvailable}}
{{if and .IsShowingOnlySingleCommit .PageIsPullFiles}}
<div class="ui info message">
<div>{{ctx.Locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{ctx.Locale.Tr "repo.pulls.show_all_commits"}}</a></div>
Contributor

I'm not sure to understand why this change is required, could you please explain? Or link to where you already explained and I missed.

I'm not sure to understand why this change is required, could you please explain? Or link to where you already explained and I missed.
Author
Member

Before this change, there were always two properties, .BeforeCommitID and .AfterCommitID, even when there was only a single commit in context.
From a technical point of view, that's not that big of a deal, they can simply be set to the same value. But I did get confused multiple times about which one would be the "correct" one, and it has the potential to diverge if some part of the template uses "BeforeCommit", the other uses "AfterCommit".
If I only glance at the code, .AfterCommitID suggests to me that there should be more than one commit in context.

So, since I already had to touch the part of the backend code that sets these two properties, I chose to also change it to only create one property when there is only a single commit.

Before this change, there were always two properties, `.BeforeCommitID` and `.AfterCommitID`, even when there was only a single commit in context. From a technical point of view, that's not that big of a deal, they can simply be set to the same value. But I did get confused multiple times about which one would be the "correct" one, and it has the potential to diverge if some part of the template uses "BeforeCommit", the other uses "AfterCommit". If I only glance at the code, `.AfterCommitID` suggests to me that there should be more than one commit in context. So, since I already had to touch the part of the backend code that sets these two properties, I chose to also change it to only create one property when there is only a single commit.
Contributor

Got it, thanks for explaining.

Got it, thanks for explaining.
earl-warren marked this conversation as resolved
sclu1034 force-pushed feat/single-commit-review from 1a3fd1e649
All checks were successful
requirements / merge-conditions (pull_request) Successful in 5s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 2m3s
testing / backend-checks (pull_request) Successful in 4m47s
Integration tests for the release process / release-simulation (pull_request) Successful in 7m0s
testing / test-unit (pull_request) Successful in 6m56s
testing / test-e2e (pull_request) Successful in 8m22s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m46s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m46s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m45s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m46s
testing / test-mysql (pull_request) Successful in 18m45s
testing / test-sqlite (pull_request) Successful in 22m29s
testing / test-pgsql (pull_request) Successful in 24m56s
testing / security-check (pull_request) Successful in 44s
to 54934b9109
All checks were successful
testing / frontend-checks (pull_request) Successful in 56s
testing / backend-checks (pull_request) Successful in 2m58s
testing / test-unit (pull_request) Successful in 5m31s
testing / test-e2e (pull_request) Successful in 6m55s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m53s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m53s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m55s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m54s
testing / test-mysql (pull_request) Successful in 16m3s
testing / test-sqlite (pull_request) Successful in 20m23s
testing / test-pgsql (pull_request) Successful in 23m6s
testing / security-check (pull_request) Successful in 49s
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
2025-06-05 16:18:41 +02:00
Compare
Author
Member

Rebased and added a few tests for the commit header in the diff view, akin to the other ones.

Interestingly, even though there a PRs with multiple commits in the test data, those would not show up in the corresponding timeline view. So I could only test the dedicated "Commits" tab.

Rebased and added a few tests for the commit header in the diff view, akin to the other ones. Interestingly, even though there a PRs with multiple commits in the test data, those would not show up in the corresponding timeline view. So I could only test the dedicated "Commits" tab.
Contributor

Could you please add R#7155 to the list of issues this closes?

Could you please add Rhttps://codeberg.org/forgejo/forgejo/pulls/7155 to the list of issues this closes?
Author
Member

@earl-warren wrote in #7155 (comment):

Could you please add R#7155 to the list of issues this closes?

7155 would be this PR itself. I've added #8084, though

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5015601: > Could you please add R#7155 to the list of issues this closes? 7155 would be this PR itself. I've added #8084, though
earl-warren approved these changes 2025-06-07 08:53:02 +02:00
Dismissed
@ -12,3 +12,3 @@
{{end}}
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
{{$commitLink:= printf "%s/pulls/%d/commits/%s" $.comment.Issue.PullRequest.BaseRepo.Link $.comment.Issue.PullRequest.ID (PathEscape .ID.String)}}
Owner

This returns an incorrect ID (if there are issues created before this PR), it must be $.comment.Issue.ID.

When you fix it, it would be great if you could also add a test case covering this.

This returns an incorrect ID (if there are issues created before this PR), it must be `$.comment.Issue.ID`. When you fix it, it would be great if you could also add a test case covering this.
Author
Member

I had tried to add tests for this with the other ones, but when I clicked through PRs in the test data, including the ones I used for the other tests, none of them had their commits show up in the timeline.

Is there a specific pull request in the fixtures that's been set up to have a proper timeline?

I had tried to add tests for this with the other ones, but when I clicked through PRs in the test data, including the ones I used for the other tests, none of them had their commits show up in the timeline. Is there a specific pull request in the fixtures that's been set up to have a proper timeline?
Author
Member

Fixed the link. Though I needed the repo scoped Issue.Index instead.

Fixed the link. Though I needed the repo scoped `Issue.Index` instead.
Author
Member

A test has been added as well.

A test has been added as well.
Contributor
https://codeberg.org/forgejo/forgejo/pulls/7155/commits/f65aece6cdda13352a030af4603eae2cb60f01d5
Contributor

This is fine. I would have nitpicking comments but this works and that is what matters.

This is fine. I would have nitpicking comments but this works and that is what matters.
earl-warren marked this conversation as resolved
Beowulf requested changes 2025-06-07 17:57:28 +02:00
Dismissed
Beowulf left a comment
Owner

I think there is the need for some furhter consideration... 🤔

I can comment on commits, but the comment is added to the latest state. This means if e.g. in commit 1 a new file is added, in commit 2 it is deleted, I can comment on it when I view commit 1:

grafik

In the conversation view, the diff is empty (because the comment is not really added to the specific state of the comment):

grafik


I have current no good idea how this can be fixed. Just changing how the comment works and add it to the specific commit is probably not the best solution 🤔


Otherwise: I would say the UI changes look good, but still need to take a look at the tests.

I think there is the need for some furhter consideration... 🤔 I can comment on commits, but the comment is added to the latest state. This means if e.g. in commit 1 a new file is added, in commit 2 it is deleted, I can comment on it when I view commit 1: ![grafik](/attachments/5eb4d1e4-1a0e-4e35-a961-2bfd9ad2a0e2) In the conversation view, the diff is empty (because the comment is not really added to the specific state of the comment): ![grafik](/attachments/6361b05e-ed38-4b63-8e00-7a2373c2d97a) *** I have current no good idea how this can be fixed. Just changing how the comment works and add it to the specific commit is probably not the best solution 🤔 *** Otherwise: I would say the UI changes look good, but still need to take a look at the tests.
@ -21,0 +24,4 @@
</a>
<a class="ui tiny button {{if .NextCommitLink}}" href="{{.NextCommitLink}}"{{else}}disabled"{{end}}>
{{ctx.Locale.Tr "repo.diff.commit.next-short"}} {{svg "octicon-chevron-right"}}
</a>
Owner

Because of 16px icons, the buttons end up larger than usual. In this case the class small works better than tiny.

Because contents of conditions {{if .PageIsPullFiles}} and {{else if not $.PageIsWiki}} are never shown together, it should be alright to not maintain complete consistency of buttons here - so using small on the new buttons only is fine.

I propose a quick UI fix, something better can be figured out later after we have some better foundation for buttons outside of Fomantic.

Because of 16px icons, the buttons end up larger than usual. In this case the class `small` works better than `tiny`. Because contents of conditions `{{if .PageIsPullFiles}}` and `{{else if not $.PageIsWiki}}` are never shown together, it should be alright to not maintain complete consistency of buttons here - so using `small` on the new buttons only is fine. I propose a quick UI fix, something better can be figured out later after we have some better foundation for buttons outside of Fomantic.
Author
Member

Change the class to small.

Change the class to `small`.
0ko marked this conversation as resolved
@ -19,2 +19,2 @@
{{if not $.PageIsWiki}}
<div class="commit-header-buttons">
<div class="commit-header-buttons">
{{if .PageIsPullFiles}}
Owner

Mobile usability is pretty bad, the new buttons are quite long even with the shorter English variant.
Please add max-sm:tw-flex-col to the Tailwind mess above that houses "tw-flex tw-mb-4 tw-gap-1".

Mobile usability is pretty bad, the new buttons are quite long even with the shorter English variant. Please add `max-sm:tw-flex-col` to the Tailwind mess above that houses `"tw-flex tw-mb-4 tw-gap-1"`.
Author
Member

Add the class as suggested.

Add the class as suggested.
0ko marked this conversation as resolved
Contributor

@Beowulf wrote in #7155 (comment):

I can comment on commits, but the comment is added to the latest state. This means if e.g. in commit 1 a new file is added, in commit 2 it is deleted, I can comment on it when I view commit 1:

If I'm not mistaken, this is an inconsistency that already exists in the current codebase and would deserve a bug report of its own. In that case I think it is out of scope for the current pull request. What do you think?

@Beowulf wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5035212: > I can comment on commits, but the comment is added to the latest state. This means if e.g. in commit 1 a new file is added, in commit 2 it is deleted, I can comment on it when I view commit 1: If I'm not mistaken, this is an inconsistency that already exists in the current codebase and would deserve a bug report of its own. In that case I think it is out of scope for the current pull request. What do you think?
Owner

@earl-warren wrote in #7155 (comment):

If I'm not mistaken, this is an inconsistency that already exists in the current codebase and would deserve a bug report of its own.

I would say it is new, because previously yes, your comment is outdated when new commits are added or there is a force push changing the line you commented on. (But isn't the preview in the conversation tab still the old state?). Additionally the comment is marked as outdated.

Now you can comment and it isn't marked e.g. as outdated even if there is already a later commit changing it and it can produce empty previous as shown above. - But if you would say it is a separate future task, or an acceptable "regression" I'm also fine with it.

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5041611: > If I'm not mistaken, this is an inconsistency that already exists in the current codebase and would deserve a bug report of its own. I would say it is new, because previously yes, your comment is outdated when new commits are added or there is a force push changing the line you commented on. (But isn't the preview in the conversation tab still the old state?). Additionally the comment is marked as outdated. Now you can comment and it isn't marked e.g. as outdated even if there is already a later commit changing it and it can produce empty previous as shown above. - But if you would say it is a separate future task, or an acceptable "regression" I'm also fine with it.
Contributor

I now understand and it would lead to confusion indeed, good catch.

I just tried to manually craft !7155 (commit b7177a23f4) which is an outdated commit of #7155 still in the repository at b7177a23f4 and it is 404, presumably because there is a check to verify if it is part of the current PR commits and not an outdated one.

@sclu1034 does it sound reasonable to change the current code so that links to the per-commit review is only displayed for commits that are not outdated?

I now understand and it would lead to confusion indeed, good catch. I just tried to manually craft https://codeberg.org/forgejo/forgejo/pulls/7155/commits/b7177a23f47b3fe0fbff096dcb3c059150f66eab which is an outdated commit of https://codeberg.org/forgejo/forgejo/pulls/7155 still in the repository at https://codeberg.org/forgejo/forgejo/commit/b7177a23f47b3fe0fbff096dcb3c059150f66eab and it is 404, presumably because there is a check to verify if it is part of the current PR commits and not an outdated one. @sclu1034 does it sound reasonable to change the current code so that links to the per-commit review is only displayed for commits that are not outdated?
earl-warren dismissed earl-warren's review 2025-06-08 11:25:57 +02:00
Reason:

pending the change to avoid displaying per-commit review link to outdated commits

Author
Member

@earl-warren wrote in #7155 (comment):

@sclu1034 does it sound reasonable to change the current code so that links to the per-commit review is only displayed for commits that are not outdated?

I haven't looked into it, but I would assume it's possible to treat outdated ones differently. Can you be more specific about what behavior you'd prefer instead of the current one?

I think #240 also covers the area of outdated commits in the history, but hasn't seen consensus, yet.

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5042271: > @sclu1034 does it sound reasonable to change the current code so that links to the per-commit review is only displayed for commits that are not outdated? I haven't looked into it, but I would assume it's possible to treat outdated ones differently. Can you be more specific about what behavior you'd prefer instead of the current one? I think #240 also covers the area of outdated commits in the history, but hasn't seen consensus, yet.
sclu1034 force-pushed feat/single-commit-review from 54934b9109
All checks were successful
testing / frontend-checks (pull_request) Successful in 56s
testing / backend-checks (pull_request) Successful in 2m58s
testing / test-unit (pull_request) Successful in 5m31s
testing / test-e2e (pull_request) Successful in 6m55s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m53s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m53s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m55s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m54s
testing / test-mysql (pull_request) Successful in 16m3s
testing / test-sqlite (pull_request) Successful in 20m23s
testing / test-pgsql (pull_request) Successful in 23m6s
testing / security-check (pull_request) Successful in 49s
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
to c5c2e8c34c
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 1m7s
testing / backend-checks (pull_request) Successful in 3m58s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m52s
testing / test-unit (pull_request) Successful in 6m22s
testing / test-e2e (pull_request) Successful in 8m1s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m2s
testing / test-remote-cacher (valkey) (pull_request) Successful in 2m2s
testing / test-remote-cacher (garnet) (pull_request) Successful in 2m2s
testing / test-remote-cacher (redict) (pull_request) Successful in 2m2s
testing / test-mysql (pull_request) Failing after 17m21s
testing / test-sqlite (pull_request) Failing after 21m48s
testing / test-pgsql (pull_request) Failing after 24m12s
testing / security-check (pull_request) Has been skipped
2025-06-08 16:15:12 +02:00
Compare
Contributor

@sclu1034 wrote in #7155 (comment):

I think #240 also covers the area of outdated commits in the history, but hasn't seen consensus, yet.

Yes and that is a more complicated one.

@sclu1034 wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5044236: > I think #240 also covers the area of outdated commits in the history, but hasn't seen consensus, yet. Yes and that is a more complicated one.
Contributor

@sclu1034 wrote in #7155 (comment):

I haven't looked into it, but I would assume it's possible to treat outdated ones differently. Can you be more specific about what behavior you'd prefer instead of the current one?

Let say the conversation tab is as follows:

image

and the 52f... commit (the first one), is outdated.

Current behavior

It links to a commit specific review tab.

Desired behavior

It links to a display of the commit.

Does that sound reasonable? AFAIK, if this is done, there would be no way for the user to accidentally review an outdated commit. Except if they did not refresh a page that was displayed before the commit was outdated but I don't think addressing this border case is necessary.

@sclu1034 wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5044236: > I haven't looked into it, but I would assume it's possible to treat outdated ones differently. Can you be more specific about what behavior you'd prefer instead of the current one? Let say the conversation tab is as follows: ![image](/attachments/531aee2f-d014-4fd9-b749-95f9d4eb4451) and the `52f...` commit (the first one), is outdated. ## Current behavior It links to a commit specific review tab. ## Desired behavior It links to a display of the commit. Does that sound reasonable? AFAIK, if this is done, there would be no way for the user to accidentally review an outdated commit. Except if they did not refresh a page that was displayed **before** the commit was outdated but I don't think addressing this border case is necessary.
Author
Member

I would assume it's possible to treat outdated ones differently

Not sure if I'd consider my solution elegant. Comment.Invalidated wouldn't work since multiple commits group into one Commit might not all be outdated, and I didn't want to change any of the commit structs.

> I would assume it's possible to treat outdated ones differently Not sure if I'd consider my solution elegant. `Comment.Invalidated` wouldn't work since multiple commits group into one `Commit` might not all be outdated, and I didn't want to change any of the commit structs.
Contributor

This looks fine to me in principle. It may not be the most elegant solution but it is easy to understand/read/review.

Could you add a case in the tests that cover this? It is a strong candidate for future regressions 😁

This looks fine to me in principle. It may not be the most elegant solution but it is easy to understand/read/review. Could you add a case in the tests that cover this? It is a strong candidate for future regressions 😁
Author
Member

@earl-warren wrote in #7155 (comment):

Could you add a case in the tests that cover this?

As mentioned earlier, I cannot find a PR in the test data that would allow me to test this.

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5069613: > Could you add a case in the tests that cover this? [As mentioned earlier](https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5035320), I cannot find a PR in the test data that would allow me to test this.
sclu1034 force-pushed feat/single-commit-review from b73df5be34
Some checks failed
Integration tests for the release process / release-simulation (pull_request) Successful in 7m46s
requirements / merge-conditions (pull_request) Successful in 3s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 1m19s
testing / backend-checks (pull_request) Failing after 3m18s
testing / test-unit (pull_request) Has been skipped
testing / test-e2e (pull_request) Has been skipped
testing / test-mysql (pull_request) Has been skipped
testing / test-pgsql (pull_request) Has been skipped
testing / test-sqlite (pull_request) Has been skipped
testing / test-remote-cacher (redis) (pull_request) Has been skipped
testing / test-remote-cacher (valkey) (pull_request) Has been skipped
testing / test-remote-cacher (garnet) (pull_request) Has been skipped
testing / test-remote-cacher (redict) (pull_request) Has been skipped
testing / security-check (pull_request) Has been skipped
to c8675d25cb
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 1m57s
Integration tests for the release process / release-simulation (pull_request) Successful in 7m58s
testing / backend-checks (pull_request) Successful in 6m39s
testing / test-unit (pull_request) Successful in 7m14s
testing / test-e2e (pull_request) Successful in 9m6s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m3s
testing / test-remote-cacher (valkey) (pull_request) Successful in 2m3s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m49s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m46s
testing / test-mysql (pull_request) Failing after 21m8s
testing / test-sqlite (pull_request) Failing after 24m22s
testing / test-pgsql (pull_request) Failing after 28m11s
testing / security-check (pull_request) Has been skipped
2025-06-10 16:56:23 +02:00
Compare
Contributor

@sclu1034 wrote in #7155 (comment):

@earl-warren wrote in #7155 (comment):

Could you add a case in the tests that cover this?

As mentioned earlier, I cannot find a PR in the test data that would allow me to test this.

Maybe not in the existing fixtures but you could create one? AFAIU TestProtectedBranch_AdminEnforcement needs this as well. Or other tests that rely on force pushing. I'm not very surprised that there is no ready-to-use / mimic pull request integration test that involves a force push.

Or is there a particular difficult that I'm not seeing?

@sclu1034 wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5069646: > @earl-warren wrote in #7155 (comment): > > > Could you add a case in the tests that cover this? > > [As mentioned earlier](https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5035320), I cannot find a PR in the test data that would allow me to test this. Maybe not in the existing fixtures but you could create one? AFAIU `TestProtectedBranch_AdminEnforcement` needs this as well. Or other tests that rely on force pushing. I'm not very surprised that there is no ready-to-use / mimic pull request integration test that involves a force push. Or is there a particular difficult that I'm not seeing?
sclu1034 force-pushed feat/single-commit-review from c8675d25cb
Some checks failed
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 1m57s
Integration tests for the release process / release-simulation (pull_request) Successful in 7m58s
testing / backend-checks (pull_request) Successful in 6m39s
testing / test-unit (pull_request) Successful in 7m14s
testing / test-e2e (pull_request) Successful in 9m6s
testing / test-remote-cacher (redis) (pull_request) Successful in 2m3s
testing / test-remote-cacher (valkey) (pull_request) Successful in 2m3s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m49s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m46s
testing / test-mysql (pull_request) Failing after 21m8s
testing / test-sqlite (pull_request) Failing after 24m22s
testing / test-pgsql (pull_request) Failing after 28m11s
testing / security-check (pull_request) Has been skipped
to f65aece6cd
All checks were successful
testing / frontend-checks (pull_request) Successful in 54s
testing / backend-checks (pull_request) Successful in 3m16s
Integration tests for the release process / release-simulation (pull_request) Successful in 6m0s
testing / test-unit (pull_request) Successful in 6m0s
testing / test-e2e (pull_request) Successful in 7m41s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m55s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m54s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m54s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m55s
testing / test-mysql (pull_request) Successful in 16m47s
testing / test-sqlite (pull_request) Successful in 21m14s
testing / test-pgsql (pull_request) Successful in 23m50s
testing / security-check (pull_request) Successful in 1m4s
milestone / set (pull_request_target) Successful in 5s
issue-labels / backporting (pull_request_target) Has been skipped
issue-labels / cascade (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 2s
issue-labels / release-notes (pull_request_target) Successful in 39s
2025-06-13 10:58:15 +02:00
Compare
Author
Member

@earl-warren wrote in #7155 (comment):

Or is there a particular difficult that I'm not seeing?

The difficulty of not being familiar with the code base, I guess. I was simply waiting for an answer, though.

I'm not very surprised that there is no ready-to-use / mimic pull request integration test that involves a force push.

That may be the case for you or the other maintainers, but I'm not yet at the point where I could have intuitions like that.
From my perspective, an answer like "Yes, you can use user5/pull4711" could have been just as likely.

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5095122: > Or is there a particular difficult that I'm not seeing? The difficulty of not being familiar with the code base, I guess. I was simply waiting for an answer, though. > I'm not very surprised that there is no ready-to-use / mimic pull request integration test that involves a force push. That may be the case for you or the other maintainers, but I'm not yet at the point where I could have intuitions like that. From my perspective, an answer like "Yes, you can use `user5/pull4711`" could have been just as likely.
Contributor

I'll research how to write that test.

I'll research how to write that test.
Author
Member

@earl-warren wrote in #7155 (comment):

I'll research how to write that test.

Have you seen the most recent force push, specifically f65aece6cd?

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5117904: > I'll research how to write that test. Have you seen the most recent force push, specifically [`f65aece6cd`](https://codeberg.org/forgejo/forgejo/pulls/7155/commits/f65aece6cdda13352a030af4603eae2cb60f01d5)?
Contributor

I was not able to find a test for pull requests that:

  • asserts on URLs found in .comment-list .timeline-item
  • creates a pull request and then force pushes and then asserts something

So it will be more work. I would

  • start from TestPullBranchDelete, copy/paste it and adapt
  • add a variation of doGitAddSomeCommits to have an equivalent that can force push
  • borrow code from TestPullCreate_TitleEscape to get the relevant URL htmlDoc.doc.Find(".comment-list .timeline-item....

And before that probably ask @Gusted @christopher-besch and in the dev chatroom in case someone has a simpler way out of this.

Is this helpful?

I was not able to find a test for pull requests that: - asserts on URLs found in `.comment-list .timeline-item` - creates a pull request and then force pushes and then asserts something So it will be more work. I would - start from `TestPullBranchDelete`, copy/paste it and adapt - add a variation of doGitAddSomeCommits to have an equivalent that can force push - borrow code from `TestPullCreate_TitleEscape` to get the relevant URL `htmlDoc.doc.Find(".comment-list .timeline-item`.... And before that probably ask @Gusted @christopher-besch and in the dev chatroom in case someone has a simpler way out of this. Is this helpful?
Contributor

@sclu1034 wrote in #7155 (comment):

Have you seen the most recent force push, specifically f65aece6cd?

I did not and as you can see I went in another direction 😅

@sclu1034 wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5122305: > Have you seen the most recent force push, specifically [`f65aece6cd`](https://codeberg.org/forgejo/forgejo/pulls/7155/commits/f65aece6cdda13352a030af4603eae2cb60f01d5)? I did not and as you can see I went in another direction 😅
Owner

The things raised in #7155 (comment) are unchanged. Where there a decision on it I cannot find or are they unadressed?

The things raised in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5035212 are unchanged. Where there a decision on it I cannot find or are they unadressed?
Contributor

They are mitigated in a way that is, IMHO quite acceptable. But for clarification a comment from @sclu1034 to articulate how would help, I agree.

They are mitigated in a way that is, IMHO quite acceptable. But for clarification a comment from @sclu1034 to articulate how would help, I agree.
Owner

I may misunderstood what you meant on matrix @earl-warren with:

( I mean, you can manually build such a view but you can no longer click on a link that will go to an outdated commit )


What I mean:

  1. Create a commit where a new file is created [commit 1]
  2. Create another commit on top where the file is deleted again [commit 2]

The history now looks like:
Bildschirmfoto 2025-06-16 um 12.19.24.png

  1. Start the single commit based review
  2. You get to the first commit, where the file is deleted:
    grafik
  3. You comment in this file:
    Bildschirmfoto 2025-06-16 um 12.21.23.png
  4. You return to the conversation tab. The review comment isn't marked as outdated and the preview is empty:
    grafik

Previously:

  1. Create a commit where a new file is created [commit 1]
  2. I need to do the review here, because afterwards I can no longer comment on the file
  3. Create another commit on top where the file is deleted again [commit 2]

Result:
In the conversation tab I have a comment with a valid preview and it is marked as outdated:
grafik

I may misunderstood what you meant on matrix @earl-warren with: > ( I mean, you can manually build such a view but you can no longer click on a link that will go to an outdated commit ) *** What I mean: 1. Create a commit where a new file is created [commit 1] 2. Create another commit on top where the file is deleted again [commit 2] The history now looks like: ![Bildschirmfoto 2025-06-16 um 12.19.24.png](/attachments/49967cd2-936e-4122-bbf5-541471d65529) 3. Start the single commit based review 4. You get to the first commit, where the file is deleted: ![grafik](/attachments/fa3bdd4b-68a7-4943-baee-43564d53c982) 5. You comment in this file: ![Bildschirmfoto 2025-06-16 um 12.21.23.png](/attachments/4cb14408-05c0-48fd-8be9-5e925a2796bf) 6. You return to the conversation tab. The review comment isn't marked as outdated and the preview is empty: ![grafik](/attachments/0b2f5196-c9aa-48b1-af77-7f4ca824720d) *** Previously: 1. Create a commit where a new file is created [commit 1] 2. I need to do the review here, because afterwards I can no longer comment on the file 3. Create another commit on top where the file is deleted again [commit 2] Result: In the conversation tab I have a comment with a valid preview and it is marked as outdated: ![grafik](/attachments/dded49a3-caf1-4683-ac6d-00423dc246cc)
Contributor

@Beowulf wrote in #7155 (comment):

Previously:

1. Create a commit where a new file is created [commit 1]

2. I need to do the review here, because afterwards I can no longer comment on the file

3. Create another commit on top where the file is deleted again [commit 2]

I don't understand why you can no longer comment on the file. Here is how I would run the reproducer on the main forgejo branch (without this PR). I can start a per-review commit there too:

  • Start the single commit based review
    image
  • Add a comment
    image
  • Click on the "Files changed" tab and approve
    image
  • See a result that also does not show that it is outdated (which is not good but also not a problem specific to this pull request)
    image

What am I missing?

@Beowulf wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5404362: > Previously: > > 1. Create a commit where a new file is created [commit 1] > > 2. I need to do the review here, because afterwards I can no longer comment on the file > > 3. Create another commit on top where the file is deleted again [commit 2] I don't understand why you can no longer comment on the file. Here is how I would run the reproducer on the main forgejo branch (without this PR). I can start a per-review commit there too: - Start the single commit based review ![image](/attachments/3d3833d7-c427-41fe-b79e-b3499639a5a8) - Add a comment ![image](/attachments/2c6f4be7-a52e-4003-8306-f2a6d7c2bd92) - Click on the "Files changed" tab and approve ![image](/attachments/c0a56f94-c8d9-42b4-a2fa-7f7d1c42704d) - See a result that also does not show that it is outdated (which is not good but also not a problem specific to this pull request) ![image](/attachments/500f60a2-fb2a-4e6f-8bbe-fca788cbb55c) What am I missing?
Owner

@earl-warren wrote in #7155 (comment):

What am I missing?

Oh, never realized I can also comment in the single commit view and thought that is new. My fault... Then it is nothing new.

@earl-warren wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5405055: > What am I missing? Oh, never realized I can also comment in the single commit view and thought that is new. My fault... Then it is nothing new.
Beowulf requested changes 2025-06-16 13:16:25 +02:00
Dismissed
Beowulf left a comment
Owner

The changes introduced regarding the force push, don't seem to work. I have a PR with 6 commits and amended the last commit and force pushed it. Now all commits link to the "default" commit view instead of the review commit view.

The changes introduced regarding the force push, don't seem to work. I have a PR with 6 commits and amended the last commit and force pushed it. Now all commits link to the "default" commit view instead of the review commit view.
Author
Member

@Beowulf wrote in #7155 (comment):

I have a PR with 6 commits and amended the last commit and force pushed it. Now all commits link to the "default" commit view instead of the review commit view.

I cannot reproduce this. I

  1. created a new branch
  2. created 6 commits
  3. pushed the branch
  4. opened a pull request
    • all commits link to the review tab
  5. amended the sixth commit only
  6. force pushed

The sixth commit now links to the commit view, while the other five still link to the review tab. Comparing the Conversation and Commits tab, the first five commits are the same (by SHA), the sixth is different.

@Beowulf wrote in https://codeberg.org/forgejo/forgejo/pulls/7155#issuecomment-5405115: > I have a PR with 6 commits and amended the last commit and force pushed it. Now all commits link to the "default" commit view instead of the review commit view. I cannot reproduce this. I 1. created a new branch 2. created 6 commits 3. pushed the branch 4. opened a pull request - all commits link to the review tab 5. amended the sixth commit only 6. force pushed The sixth commit now links to the commit view, while the other five still link to the review tab. Comparing the Conversation and Commits tab, the first five commits are the same (by SHA), the sixth is different.
Beowulf approved these changes 2025-06-16 14:04:57 +02:00
Beowulf left a comment
Owner

I don't know what I saw, but youre right.

Looks good to me. Only thing you may want to add is that the sha in the force push (if the commit is still valid and included) also links to the single commit review.

I don't know what I saw, but youre right. Looks good to me. Only thing you may want to add is that the sha in the force push (if the commit is still valid and included) also links to the single commit review.
Where does that come from? The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `release-notes/7155.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference.

This message and the release notes originate from a call to the release-notes-assistant.

@@ -41,2 +41,10 @@
 - [x] I want the title to show in the release notes with a link to this pull request.
 - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.
+
+<!--start release-notes-assistant-->
+
+## Release notes
+<!--URL:https://codeberg.org/forgejo/forgejo-->
+- Features
+  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description SW1wbGVtZW50IHNpbmdsZS1jb21taXQgUFIgcmV2aWV3IGZsb3c=-->Implement single-commit PR review flow<!--description-->
+<!--end release-notes-assistant-->

Release notes

  • Features
    • PR: Implement single-commit PR review flow
<details> <summary>Where does that come from?</summary> The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `release-notes/7155.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference. This message and the release notes originate from a call to the [release-notes-assistant](https://code.forgejo.org/forgejo/release-notes-assistant). ```diff @@ -41,2 +41,10 @@ - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. + +<!--start release-notes-assistant--> + +## Release notes +<!--URL:https://codeberg.org/forgejo/forgejo--> +- Features + - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description SW1wbGVtZW50IHNpbmdsZS1jb21taXQgUFIgcmV2aWV3IGZsb3c=-->Implement single-commit PR review flow<!--description--> +<!--end release-notes-assistant--> ``` </details> <!--start release-notes-assistant--> ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> - Features - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description SW1wbGVtZW50IHNpbmdsZS1jb21taXQgUFIgcmV2aWV3IGZsb3c=-->Implement single-commit PR review flow<!--description--> <!--end release-notes-assistant-->
Contributor

@sclu1034 I suspect this will make per-commit review actually used, if only because people will have an easy access to them via the links in the pull request and not via the icon in file review that is currently awkward to use.

For release notes,

Implement single-commit PR review flow

suggests it did not exist before. What about something like this?

improve the user experience to review individual commits in a pull request

@sclu1034 I suspect this will make per-commit review actually used, if only because people will have an easy access to them via the links in the pull request and not via the icon in file review that is currently awkward to use. For release notes, > Implement single-commit PR review flow suggests it did not exist before. What about something like this? > improve the user experience to review individual commits in a pull request
sclu1034 changed title from Implement single-commit PR review flow to feat(ui): improve the user experience to review individual commits in a pull request 2025-06-17 09:48:53 +02:00
Where does that come from? The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `release-notes/7155.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference.

This message and the release notes originate from a call to the release-notes-assistant.

@@ -47,4 +47,4 @@
 <!--URL:https://codeberg.org/forgejo/forgejo-->
 - Features
-  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description SW1wbGVtZW50IHNpbmdsZS1jb21taXQgUFIgcmV2aWV3IGZsb3c=-->Implement single-commit PR review flow<!--description-->
+  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description-->
 <!--end release-notes-assistant-->

Release notes

  • Features
    • PR: feat(ui): improve the user experience to review individual commits in a pull request
<details> <summary>Where does that come from?</summary> The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `release-notes/7155.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference. This message and the release notes originate from a call to the [release-notes-assistant](https://code.forgejo.org/forgejo/release-notes-assistant). ```diff @@ -47,4 +47,4 @@ <!--URL:https://codeberg.org/forgejo/forgejo--> - Features - - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description SW1wbGVtZW50IHNpbmdsZS1jb21taXQgUFIgcmV2aWV3IGZsb3c=-->Implement single-commit PR review flow<!--description--> + - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description--> <!--end release-notes-assistant--> ``` </details> <!--start release-notes-assistant--> ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> - Features - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description--> <!--end release-notes-assistant-->
Member

congrats on the merge @sclu1034 :D

congrats on the merge @sclu1034 :D
Where does that come from? The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `release-notes/7155.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference.

This message and the release notes originate from a call to the release-notes-assistant.

@@ -46,5 +46,5 @@
 ## Release notes
 <!--URL:https://codeberg.org/forgejo/forgejo-->
-- Features
+- User Interface features
   - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description-->
 <!--end release-notes-assistant-->

Release notes

  • User Interface features
    • PR: feat(ui): improve the user experience to review individual commits in a pull request
<details> <summary>Where does that come from?</summary> The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `release-notes/7155.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference. This message and the release notes originate from a call to the [release-notes-assistant](https://code.forgejo.org/forgejo/release-notes-assistant). ```diff @@ -46,5 +46,5 @@ ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> -- Features +- User Interface features - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description--> <!--end release-notes-assistant--> ``` </details> <!--start release-notes-assistant--> ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> - User Interface features - [PR](https://codeberg.org/forgejo/forgejo/pulls/7155): <!--number 7155 --><!--line 0 --><!--description ZmVhdCh1aSk6IGltcHJvdmUgdGhlIHVzZXIgZXhwZXJpZW5jZSB0byByZXZpZXcgaW5kaXZpZHVhbCBjb21taXRzIGluIGEgcHVsbCByZXF1ZXN0-->feat(ui): improve the user experience to review individual commits in a pull request<!--description--> <!--end release-notes-assistant-->
Member

Unfortunately, it seems that the Create review from commit e2e test introduced in this PR is flaky.
In the interest of it not blocking work in unrelated areas, I have proposed to disable it in #9049.

It would be fantastic if someone with knowledge of this PR could work on re-enabling the test, making it 100% reliable.

Unfortunately, it seems that the `Create review from commit` e2e test introduced in this PR is flaky. In the interest of it not blocking work in unrelated areas, I have proposed to disable it in #9049. It would be fantastic if someone with knowledge of this PR could work on re-enabling the test, making it 100% reliable.
Sign in to join this conversation.
No labels
arch
riscv64
backport/v1.19
backport/v1.20
backport/v1.21/forgejo
backport/v10.0/forgejo
backport/v11.0/forgejo
backport/v12.0/forgejo
backport/v13.0/forgejo
backport/v14.0/forgejo
backport/v7.0/forgejo
backport/v8.0/forgejo
backport/v9.0/forgejo
breaking
bug
bug
confirmed
bug
duplicate
bug
needs-more-info
bug
new-report
bug
reported-upstream
code/actions
code/api
code/auth
code/auth/faidp
code/auth/farp
code/email
code/federation
code/git
code/migrations
code/packages
code/wiki
database
MySQL
database
PostgreSQL
database
SQLite
dependency-upgrade
dependency
certmagic
dependency
chart.js
dependency
Chi
dependency
Chroma
dependency
citation.js
dependency
codespell
dependency
css-loader
dependency
devcontainers
dependency
dropzone
dependency
editorconfig-checker
dependency
elasticsearch
dependency
enmime
dependency
F3
dependency
ForgeFed
dependency
garage
dependency
Git
dependency
git-backporting
dependency
Gitea
dependency
gitignore
dependency
go-ap
dependency
go-enry
dependency
go-gitlab
dependency
Go-org
dependency
go-rpmutils
dependency
go-sql-driver mysql
dependency
go-swagger
dependency
go-version
dependency
go-webauthn
dependency
gocron
dependency
Golang
dependency
goldmark
dependency
goquery
dependency
Goth
dependency
grpc-go
dependency
happy-dom
dependency
Helm
dependency
image-spec
dependency
jsonschema
dependency
KaTeX
dependency
lint
dependency
MariaDB
dependency
Mermaid
dependency
minio-go
dependency
misspell
dependency
Monaco
dependency
PDFobject
dependency
playwright
dependency
postcss
dependency
postcss-plugins
dependency
pprof
dependency
prometheus client_golang
dependency
protobuf
dependency
relative-time-element
dependency
renovate
dependency
reply
dependency
ssh
dependency
swagger-ui
dependency
tailwind
dependency
temporal-polyfill
dependency
terminal-to-html
dependency
tests-only
dependency
text-expander-element
dependency
urfave
dependency
vfsgen
dependency
vite
dependency
Woodpecker CI
dependency
x tools
dependency
XORM
Discussion
duplicate
enhancement/feature
forgejo/accessibility
forgejo/branding
forgejo/ci
forgejo/commit-graph
forgejo/documentation
forgejo/furnace cleanup
forgejo/i18n
forgejo/interop
forgejo/moderation
forgejo/privacy
forgejo/release
forgejo/scaling
forgejo/security
forgejo/ui
Gain
High
Gain
Nice to have
Gain
Undefined
Gain
Very High
good first issue
i18n/backport-stable
impact
large
impact
medium
impact
small
impact
unknown
Incompatible license
issue
closed
issue
do-not-exist-yet
issue
open
manual test
Manually tested during feature freeze
OS
FreeBSD
OS
Linux
OS
macOS
OS
Windows
problem
QA
regression
release blocker
Release Cycle
Feature Freeze
release-blocker
v7.0
release-blocker
v7.0.1
release-blocker
v7.0.2
release-blocker
v7.0.3
release-blocker
v7.0.4
release-blocker
v8.0.0
release-blocker/v9.0.0
run-all-playwright-tests
run-end-to-end-tests
test
manual
test
needed
test
needs-help
test
not-needed
test
present
untested
User research - time-tracker
valuable code
worth a release-note
User research - Accessibility
User research - Blocked
User research - Community
User research - Config (instance)
User research - Errors
User research - Filters
User research - Future backlog
User research - Git workflow
User research - Labels
User research - Moderation
User research - Needs input
User research - Notifications/Dashboard
User research - Rendering
User research - Repo creation
User research - Repo units
User research - Security
User research - Settings (in-app)
No milestone
No project
No assignees
10 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/forgejo!7155
No description provided.