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

Improve PR diff view on mobile #27883

Merged
2 changes: 1 addition & 1 deletion templates/repo/diff/box.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
<div class="diff-detail-actions">
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}}
<div class="gt-df gt-ac gt-fc gt-whitespace-nowrap gt-mr-2">
<div id="viewed-files-summary-container" class="gt-df gt-ac gt-fc gt-whitespace-nowrap gt-mr-2">
<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{ctx.Locale.Tr "repo.pulls.viewed_files_label"}}">
{{ctx.Locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
</label>
Expand Down
27 changes: 2 additions & 25 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,6 @@
@media (max-width: 991.98px) {
.repository .diff-detail-box {
flex-direction: row;
height: 77px; /* this height should match sticky-2nd-row */
}
}

Expand Down Expand Up @@ -1534,13 +1533,9 @@
color: var(--color-red);
}

@media (max-width: 480px) {
@media (max-width: 991.98px) {
.repository .diff-detail-box .diff-detail-stats {
font-size: 0;
line-height: 1.6rem;
}
.repository .diff-detail-box .diff-detail-stats strong {
font-size: 1rem;
display: none !important;
}
}

Expand Down Expand Up @@ -1735,12 +1730,6 @@
border: none;
}

@media (max-width: 991.98px) {
.diff-file-box {
scroll-margin-top: 77px; /* match .repository .diff-detail-box */
}
}

/* TODO: this can potentially be made "global" by removing the class prefix */
.diff-file-box .ui.attached.header,
.diff-file-box .ui.attached.table {
Expand Down Expand Up @@ -2826,18 +2815,6 @@ tbody.commit-list {
z-index: 7;
}

@media (max-width: 991.98px) {
.ui.attached.header.diff-file-header.sticky-2nd-row {
top: 77px; /* match .repository .diff-detail-box */
}
}

@media (max-width: 480px) {
.ui.attached.header.diff-file-header.sticky-2nd-row {
position: static;
}
}

.diff-file-name {
flex: auto;
min-width: 100px;
Expand Down
6 changes: 6 additions & 0 deletions web_src/css/review.css
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,9 @@
width: 100%;
height: 8px;
}

@media (max-width: 480px) {
#viewed-files-summary-container {
display: none !important;
}
sebastian-sauer marked this conversation as resolved.
Show resolved Hide resolved
}