Skip to content

Commit 622d216

Browse files
authored
Fix diff tree height and adjust target file style (#23616)
Extract from #23553, just the parts that fix the diff tree height and the change to the file `:target` style. Fixes: #23593
1 parent 774b37b commit 622d216

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

web_src/css/repository.css

+26-6
Original file line numberDiff line numberDiff line change
@@ -1611,14 +1611,12 @@
16111611
padding: 7px 0;
16121612
background: var(--color-body);
16131613
line-height: 30px;
1614-
height: 47px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
16151614
}
16161615

16171616
@media (max-width: 991px) {
16181617
.repository .diff-detail-box {
16191618
flex-direction: column;
16201619
align-items: flex-start;
1621-
height: 77px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
16221620
}
16231621
}
16241622

@@ -1674,6 +1672,13 @@
16741672
}
16751673
}
16761674

1675+
.diff-detail-actions {
1676+
/* prevent font-size from increasing element height so that .diff-detail-box comes
1677+
out with height of 47px (one line) and 77px (two lines), which is important for
1678+
position: sticky */
1679+
height: 33px;
1680+
}
1681+
16771682
.repository .diff-detail-box .diff-detail-actions > * {
16781683
margin-right: 0;
16791684
}
@@ -1848,10 +1853,24 @@
18481853
padding-bottom: 5px;
18491854
}
18501855

1856+
.diff-file-box {
1857+
border: 1px solid transparent;
1858+
border-radius: var(--border-radius);
1859+
}
1860+
1861+
/* TODO: this can potentially be made "global" by removing the class prefix */
1862+
.diff-file-box .ui.attached.header,
1863+
.diff-file-box .ui.attached.table {
1864+
margin: 0; /* remove fomantic negative margins */;
1865+
width: initial; /* remove fomantic over 100% width */;
1866+
max-width: initial; /* remove fomantic over 100% width */;
1867+
}
1868+
18511869
.repository .diff-stats {
18521870
clear: both;
18531871
margin-bottom: 5px;
1854-
max-height: 400px;
1872+
max-height: 200px;
1873+
height: fit-content;
18551874
overflow: auto;
18561875
padding-left: 0;
18571876
}
@@ -2647,7 +2666,8 @@
26472666
filter: drop-shadow(-3px 0 0 var(--color-primary-alpha-30)) !important;
26482667
}
26492668

2650-
.code-comment:target {
2669+
.code-comment:target,
2670+
.diff-file-box:target {
26512671
border-color: var(--color-primary) !important;
26522672
border-radius: var(--border-radius) !important;
26532673
box-shadow: 0 0 0 3px var(--color-primary-alpha-30) !important;
@@ -3238,13 +3258,13 @@ td.blob-excerpt {
32383258
}
32393259

32403260
#diff-file-tree {
3241-
width: 20%;
3261+
flex: 0 0 20%;
32423262
max-width: 380px;
32433263
line-height: inherit;
32443264
position: sticky;
32453265
padding-top: 0;
32463266
top: 47px;
3247-
max-height: calc(100vh - 50px);
3267+
max-height: calc(100vh - 47px);
32483268
height: 100%;
32493269
overflow-y: auto;
32503270
}

web_src/css/review.css

-8
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,3 @@ a.blob-excerpt:hover {
308308
width: 72px;
309309
height: 10px;
310310
}
311-
312-
.diff-file-box {
313-
border-radius: 0.285rem; /* Just like ui.top.attached.header */
314-
}
315-
316-
.diff-file-box:target {
317-
box-shadow: 0 0 0 3px var(--color-accent);
318-
}

0 commit comments

Comments
 (0)