-
-
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
De-emphasize signed commits #31160
base: main
Are you sure you want to change the base?
De-emphasize signed commits #31160
Conversation
Rework the signed commits UI to show a clickable badge for signed commits. Clicking this badge reveals further information about the trust status of the signature.
Thanks!! 🙏 This is so helpful. The visual changes look great! I think the CI changes may be related, perhaps due to an undefined variable previously wrapped in a guard conditional. My main development machine is undergoing some repairs, and so I can't properly go through this changeset for review right now, but if you'd like for me to determine the cause of the CI fail I can do that for you once I'm back on my main device. |
@techknowlogick That would be really helpful. Do you know who I can ask to review this PR? |
Looks nice based on the screenshots. I had started only on the commit detail page in #30221, but this looks more complete. Maybe you can take some inspiration from my PR. You will definitely want to include the removal of unused CSS here. |
@silverwind Looks like there are quite a few styles that will be removed with this... The |
Indeed, please remove all CSS that has the |
This commit removes all classnames (like for example `ui text`) that don't have any effect on the elements they're applied to.
One request: Instead of could we use this SVG icon: If you want to show some additional text, it can be done with |
These styles aren't used anymore, so they can be safely deleted
I'm trying to find the causes of the failing tests, here's what I've found: And the tests in repo_commits_test.go still fail, unfortunately. |
I guess this needs to be fixed... It would be great, if the backend processed the commit summary in a way, that the summary has a maximum length, and everything longer than that would be added to the multiline commit message. For now, I'm fixing this by adding |
We tend to fix such issues in the frontend only, and I guess in the case of commit list we could just make it wrap for now which matches the previous implementation.
Maybe unify later, backend already has a mechanism for the "..." button for the commit message body. |
|
This whole commit message wrapping/ellipsis CSS is a huge mess that needs cleanup, I will see what I can do. |
{{if .verification.Verified}} | ||
{{if ne .verification.SigningUser.ID 0}} | ||
{{if .verification.SigningSSHKey}} | ||
<span>{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> | ||
{{.verification.SigningSSHKey.Fingerprint}} | ||
{{else}} | ||
<span>{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> | ||
{{.verification.SigningKey.PaddedKeyID}} | ||
{{end}} | ||
{{else}} | ||
{{if .verification.SigningSSHKey}} | ||
<span data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> | ||
{{.verification.SigningSSHKey.Fingerprint}} | ||
{{else}} | ||
<span data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> | ||
{{.verification.SigningKey.PaddedKeyID}} | ||
{{end}} | ||
{{end}} | ||
{{else if .verification.Warning}} | ||
{{if .verification.SigningSSHKey}} | ||
<span>{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> | ||
{{.verification.SigningSSHKey.Fingerprint}} | ||
{{else}} | ||
<span>{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> | ||
{{.verification.SigningKey.PaddedKeyID}} | ||
{{end}} | ||
{{else}} | ||
{{if .verification.SigningKey}} | ||
{{if ne .verification.SigningKey.KeyID ""}} | ||
<span>{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> | ||
{{.verification.SigningKey.PaddedKeyID}} | ||
{{end}} | ||
{{end}} | ||
{{if .verification.SigningSSHKey}} | ||
{{if ne .verification.SigningSSHKey.Fingerprint ""}} | ||
<span>{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> | ||
{{.verification.SigningSSHKey.Fingerprint}} | ||
{{end}} | ||
{{end}} | ||
{{end}} |
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.
Wait, how do all these span
s differ?
To me, it looks like there's a lot of unnecessary duplication here.
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.
That's honestly a good question, I've pretty much just copied over the code from templates/repo/commit_page.tmpl
and adapted the layout to fit into the modal. I'll try to find ways to remove duplication here.
For reference, here are the currently failing tests. Failing very likely because of changed HTML structure.
|
@silverwind Regarding the failing tests, would it be an option to add a |
Littering templates with test attributes is not acceptable imho. I still think we can fix them without such hacks, I will check later but feel free to investigate yourself in the meanwhile. |
@silverwind did you have time to fix these hacks? |
This pull request changes how signed commits are displayed, as signed commits were emphasized too much previously. This includes a rewrite of the commit list UI, which now uses an unordered list instead of a table. If a commit is signed, a clickable badge is shown, indicating that the commit is signed with either a verified or an unverified signature.
fixes #29641
Comparison:
Latest commit
Before
After
Commit list
Before
After
Commit details
Before
After
Commit Graph
Before
After
Clicking on the badge opens the following modal: