-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add commits dropdown in PR files view and allow commit by commit review #25528
Add commits dropdown in PR files view and allow commit by commit review #25528
Conversation
when selecting a commit only the changes of this commit will be shown.
1a5797d
to
acbd8dd
Compare
Hmm…
I think for now, the easiest thing to combat all these problems is to disable the |
Thanks for your feedback - disabling the Viewed Checkboxes should be an easy thing. I'll add this. |
As for UI:
|
thanks @silverwind - do you mean all span (class description and text) should have the class gt-ellipsis? |
At least the commit message and author line will needed it. Commit hash is fixed width, so doesn't. |
@silverwind are there any more ui / review comments that I'll need to address? @delvh is the current solution (disabling file viewed when loading specific commit) ok for you? |
Looks good. Something to test: What happens when number of commits is large. Will the dropdown become scrollable? |
Yep, of course. Otherwise I wouldn't have suggested it. |
@sebastian-sauer install a https://editorconfig.org/ plugin in your editor. |
Thanks @silverwind - i've now added a max height and overflow-y auto to add scrollbar for long lists. The following screenshot is with 500 commits in one PR: |
I guess we can reduce item padding a bit in that dropdown specifically, maybe |
I was thinking the same. |
Thanks @wxiaoguang for your changes - these look good to me! |
@sebastian-sauer I've updated your screenshots now with the current state. |
@sebastian-sauer please fix the merge conflicts. 🍵 |
templates/repo/diff/box.tmpl
Outdated
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}} | ||
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-3" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}> | ||
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm… Somehow this line lost half of its indentation in the merge.
Thank you @delvh for resolving the merge conflict. And thanks to all of you for all your support! It's always fun contributing to gitea! |
But apparently the web editor used spaces instead of tabs which is why the CI fails. |
I'll check this and push a fix asap. |
Fixed. |
I've just noticed something strange, which is present both in the screenshots I added, and in the original ones: |
@delvh do you got Ignore Whitespace active? This could be the reason With ignore whitespace - looks wrong (but is just wrong cause white space changes are not shown): Without ignore whitespace: |
I mean, it doesn't appear to occur on every commit. |
Please see my last comment - maybe it's caused by ignore whitespace option? |
* origin/main: (43 commits) Add `/public/assets` to `.ignore` (go-gitea#26232) Fix attachment clipboard copy on insecure origin (go-gitea#26224) Fix commit compare style (go-gitea#26209) Fix unable to display individual-level project (go-gitea#26198) Fix access check for org-level project (go-gitea#26182) Fixed incorrect locale references (go-gitea#26218) Use calendar icon for `Joined on...` in profiles (go-gitea#26215) Add changelog for 1.20.2 (go-gitea#26208) Add commits dropdown in PR files view and allow commit by commit review (go-gitea#25528) Warn instead of reporting an error when a webhook cannot be found (go-gitea#26039) Fixing the align of commit stats in commit_page template. (go-gitea#26161) Fix allowed user types setting problem (go-gitea#26200) Hide branch/tag icon if branches/tags are empty (go-gitea#26204) Prevent primary key update on migration (go-gitea#26192) improve unit test for caching (go-gitea#26185) Render plaintext task list items for markdown files (go-gitea#26186) Add tooltip to describe LFS table column and color `delete LFS file` button red (go-gitea#26181) Show branches and tags that contain a commit (go-gitea#25180) Release attachments duplicated check (go-gitea#26176) Calculate MAX_WORKERS default value by CPU number (go-gitea#26177) ...
This PR adds a new dropdown to select a commit or a commit range (shift-click like github) of a Pull Request.
After selection of a commit only the changes of this commit will be shown. When selecting a range of commits the diff of this range is shown.
This allows to review a PR commit by commit or by viewing only commit ranges.
The "Show changes since your last review" mechanism github uses is implemented, too.
When reviewing a single commit or a commit range the "Viewed" functionality is disabled.
Screenshots
The commit dropdown
Selecting a commit range
Show changes of a single commit only
Show changes of a commit range
Fixes #20989
Fixes #19263