enhance(repo): unify diff stats on commit pages, misc diff tweaks (#39134)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
tara~ ♡
2026-08-30 22:17:32 +08:00
committed by GitHub
co-authored by silverwind wxiaoguang
parent 8ef7a9e46d
commit 27570ea685
10 changed files with 42 additions and 39 deletions
+1 -4
View File
@@ -144,11 +144,8 @@
border-top: none;
}
.ui.attached.segment:has(+ .ui[class*="top attached"].header),
.ui.attached.segment:has(+ .page.buttons),
.ui.attached.segment:last-child,
.ui.segment:has(+ .ui.segment:not(.attached)),
.ui.attached.segment:has(+ .ui.modal) {
.ui.attached.segment:has(+ :not(.ui.attached.segment)) {
border-bottom-left-radius: 0.28571429rem;
border-bottom-right-radius: 0.28571429rem;
}
+7 -16
View File
@@ -829,9 +829,9 @@ td .commit-summary {
position: sticky;
top: 0;
z-index: 8;
padding: 7px 5px;
padding: 4px 5px;
margin: 0 -5px; /* negative margin so it covers active file shadow */
height: 44px; /* this height should match sticky-2nd-row */
height: 41px; /* this height should match sticky-2nd-row */
background: var(--color-body);
}
@@ -840,6 +840,7 @@ td .commit-summary {
flex-wrap: wrap;
}
}
.repository .diff-detail-box .diff-detail-stats strong {
margin-left: 0.25rem;
margin-right: 0.25rem;
@@ -972,25 +973,16 @@ td .commit-summary {
width: 100%;
}
.repository .diff-file-box.file-content {
clear: right;
}
.repository .diff-file-box.file-content .image-diff img {
max-width: 100%;
padding: 0;
border-radius: 0;
}
.repository .diff-file-box .ui.bottom.attached.table.segment {
padding-top: 5px;
padding-bottom: 5px;
}
.diff-file-box {
border: 1px solid transparent;
border-radius: var(--border-radius);
scroll-margin-top: 47px; /* match .repository .diff-detail-box */
scroll-margin-top: 44px; /* .diff-detail-box height plus the :target shadow */
}
.file.editor .diff-file-box {
@@ -1549,7 +1541,6 @@ tbody.commit-list {
#diff-container {
display: flex;
padding-top: 4px; /* for box-shadow from .diff-file-box */
gap: var(--page-spacing);
}
@@ -1570,8 +1561,8 @@ tbody.commit-list {
line-height: inherit;
position: sticky;
padding-top: 0;
top: 47px;
max-height: calc(100vh - 47px);
top: 44px; /* match .diff-file-box scroll-margin-top */
max-height: calc(100vh - 44px);
height: 100%;
display: flex;
flex-direction: column;
@@ -1669,7 +1660,7 @@ tbody.commit-list {
.ui.attached.header.diff-file-header.sticky-2nd-row {
position: sticky;
top: 44px; /* match .repository .diff-detail-box */
top: 41px; /* dock right below .repository .diff-detail-box */
z-index: 7;
}
-4
View File
@@ -114,10 +114,6 @@
margin: 0 0 0 3em;
}
.diff-file-body.binary {
padding: 5px 10px;
}
.file-comment {
color: var(--color-text);
}
-2
View File
@@ -114,7 +114,6 @@ function updateState(visible: boolean) {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-right: .5rem;
flex: 1;
min-height: 0;
}
@@ -124,7 +123,6 @@ function updateState(visible: boolean) {
align-items: center;
gap: 8px;
padding-top: 1px; /* match .diff-file-box's top border so this row aligns with .diff-file-header */
padding-bottom: 0.25rem;
}
.diff-file-search-wrapper {