fix: link commit SHAs so they lead somewhere
commit
bdbd739fix: link commit SHAs so they lead somewhere
The check-run page showed the commit SHA as plain text beside a check name, the commit page showed its own SHA as plain text, and a release card showed its target SHA as plain text; none of them went anywhere despite looking like the SHA links used elsewhere. Each now links to where a visitor would expect: the check page to the commit view, the commit page to the tree at that commit, and the release card to the commit view.
Assisted-by: Claude:claude-sonnet-5
Reviews
No reviews of this commit yet — record a verdict below.
Start a review
crates/git-ents-server/src/web/pages.rs
@@ -852,7 +852,10 @@
auth,
html! {
div.card {
- div.card-header { (icon_commit()) " Commit " span.sha { (short) } }
+ div.card-header {
+ (icon_commit()) " Commit "
+ a.sha href={ "/" (meta.rel) "/tree/" (oid) } { (short) }
+ }
div.commit {
div.commit-subject { (subject) }
@if !body.is_empty() {
@@ -911,7 +914,9 @@
div.release-body { p { (release.body) } }
}
div.release-foot {
- span.sha { (icon_commit()) (short_oid(&release.oid)) }
+ a.sha href={ "/" (meta.rel) "/commit/" (release.oid) } {
+ (icon_commit()) (short_oid(&release.oid))
+ }
}
}
}
@@ -1106,7 +1111,10 @@
auth,
html! {
div.page-header {
- h1.page-title { (name) " on " code { (short_commit) } }
+ h1.page-title {
+ (name) " on "
+ a href={ "/" (rel) "/commit/" (commit) } { code { (short_commit) } }
+ }
}
(body)
},
crates/git-ents-server/src/web/style.css
@@ -161,6 +161,8 @@
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; overflow: hidden; }
.card-header { display: flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); background: var(--color-code-bg); padding: .55rem 1.1rem; border-bottom: 1px solid var(--color-border); }
+.card-header .sha { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 25%, transparent); }
+.card-header .sha:hover { color: var(--color-accent); }
.card-row { display: flex; align-items: center; gap: .65rem; padding: .7rem 1.1rem; font-family: var(--font-mono); font-size: .9rem; }
.card-row + .card-row { border-top: 1px solid var(--color-border); }
.card-row .icon { color: var(--color-text-muted); }
@@ -306,7 +308,8 @@
.release-body p { white-space: pre-wrap; font-size: .9rem; }
.release-body .muted { color: var(--color-text-muted); }
.release-foot { display: flex; align-items: center; padding: .7rem 1.1rem; border-top: 1px solid var(--color-border); font-family: var(--font-mono); font-size: .74rem; }
-.release-foot .sha { margin-left: auto; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: .35rem; }
+.release-foot .sha { margin-left: auto; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: .35rem; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 25%, transparent); }
+.release-foot .sha:hover { color: var(--color-accent); }
.notice { font-size: .9rem; font-weight: 600; padding: .6rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.notice-success { color: var(--s-func); background: color-mix(in srgb, var(--s-func) 12%, transparent); border: 1px solid color-mix(in srgb, var(--s-func) 30%, transparent); }