Skip to content
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

Fix diff tree height and adjust target file style #23616

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -1611,14 +1611,12 @@
padding: 7px 0;
background: var(--color-body);
line-height: 30px;
height: 47px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
}

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

Expand Down Expand Up @@ -1674,6 +1672,13 @@
}
}

.diff-detail-actions {
/* prevent font-size from increasing element height so that .diff-detail-box comes
out with height of 47px (one line) and 77px (two lines), which is important for
position: sticky */
height: 33px;
}

.repository .diff-detail-box .diff-detail-actions > * {
margin-right: 0;
}
Expand Down Expand Up @@ -1848,10 +1853,24 @@
padding-bottom: 5px;
}

.diff-file-box {
border: 1px solid transparent;
border-radius: var(--border-radius);
}

/* TODO: this can potentially be made "global" by removing the class prefix */
.diff-file-box .ui.attached.header,
.diff-file-box .ui.attached.table {
margin: 0; /* remove fomantic negative margins */;
width: initial; /* remove fomantic over 100% width */;
max-width: initial; /* remove fomantic over 100% width */;
}

.repository .diff-stats {
clear: both;
margin-bottom: 5px;
max-height: 400px;
max-height: 200px;
height: fit-content;
overflow: auto;
padding-left: 0;
}
Expand Down Expand Up @@ -2647,7 +2666,8 @@
filter: drop-shadow(-3px 0 0 var(--color-primary-alpha-30)) !important;
}

.code-comment:target {
.code-comment:target,
.diff-file-box:target {
border-color: var(--color-primary) !important;
border-radius: var(--border-radius) !important;
box-shadow: 0 0 0 3px var(--color-primary-alpha-30) !important;
Expand Down Expand Up @@ -3238,13 +3258,13 @@ td.blob-excerpt {
}

#diff-file-tree {
width: 20%;
flex: 0 0 20%;
max-width: 380px;
line-height: inherit;
position: sticky;
padding-top: 0;
top: 47px;
max-height: calc(100vh - 50px);
max-height: calc(100vh - 47px);
height: 100%;
overflow-y: auto;
}
Expand Down
8 changes: 0 additions & 8 deletions web_src/css/review.css
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,3 @@ a.blob-excerpt:hover {
width: 72px;
height: 10px;
}

.diff-file-box {
border-radius: 0.285rem; /* Just like ui.top.attached.header */
}

.diff-file-box:target {
box-shadow: 0 0 0 3px var(--color-accent);
}