Merge branch 'main' into lunny/fix_delete_code_comment

This commit is contained in:
Lunny Xiao
2025-08-27 21:37:42 -07:00
435 changed files with 6475 additions and 4636 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
.admin code,
.admin pre {
white-space: pre-wrap;
word-wrap: break-word;
overflow-wrap: break-word;
}
.admin .ui.table.segment {
+2 -4
View File
@@ -604,10 +604,8 @@ img.ui.avatar,
}
.ui .message > ul {
margin-left: auto;
margin-right: auto;
display: table;
text-align: left;
margin: 0;
padding: 0 1em;
}
.ui .header > i + .content {
+1 -1
View File
@@ -15,7 +15,7 @@
top: 50%;
transform: translateY(-50%);
border-radius: 2px;
background: repeating-linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa), repeating-linear-gradient(45deg, #aaa 25%, #fff 25%, #fff 75%, #aaa 75%, #aaa); /* stylelint-disable-line scale-unlimited/declaration-strict-value */
background: repeating-linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa), repeating-linear-gradient(45deg, #aaa 25%, #fff 25%, #fff 75%, #aaa 75%, #aaa);
background-position: 0 0, 4px 4px;
background-size: 8px 8px;
}
+2 -1
View File
@@ -1,6 +1,6 @@
.markup {
overflow: hidden;
font-size: 16px;
font-size: 14px; /* 14px for comments, overridden to 16px for .file-view below. */
line-height: 1.5 !important;
overflow-wrap: break-word;
}
@@ -318,6 +318,7 @@ In markup content, we always use bottom margin for all elements */
.file-view.markup {
padding: 1em 2em;
font-size: 16px;
}
.file-view.markup:has(.file-not-rendered-prompt) {
+1 -1
View File
@@ -20,7 +20,7 @@
background: var(--color-card);
border: 1px solid var(--color-secondary);
box-shadow: none;
word-wrap: break-word;
overflow-wrap: break-word;
border-radius: var(--border-radius);
}
+1 -1
View File
@@ -83,6 +83,6 @@
.ui.comments .comment .text {
margin: 0.25em 0 0.5em;
font-size: 1em;
word-wrap: break-word;
overflow-wrap: break-word;
line-height: 1.3;
}
-12
View File
@@ -300,10 +300,6 @@ td .commit-summary {
min-width: 100px;
}
.repository.new.issue .comment.form .content .markup {
font-size: 14px;
}
.repository.view.issue .instruct-toggle {
display: inline-block;
}
@@ -630,10 +626,6 @@ td .commit-summary {
background: var(--color-light);
}
.repository.view.issue .comment-list .comment .markup {
font-size: 14px;
}
.repository.view.issue .comment-list .comment .no-content {
color: var(--color-text-light-2);
font-style: italic;
@@ -723,10 +715,6 @@ td .commit-summary {
text-align: center;
}
.repository.compare.pull .markup {
font-size: 14px;
}
.repository.branches .commit-divergence .bar-group {
position: relative;
float: left;
+25 -18
View File
@@ -32,6 +32,7 @@ export default defineComponent({
locale: {
filter_changes_by_commit: el.getAttribute('data-filter_changes_by_commit'),
} as Record<string, string>,
mergeBase: el.getAttribute('data-merge-base'),
commits: [] as Array<Commit>,
hoverActivated: false,
lastReviewCommitSha: '',
@@ -176,32 +177,38 @@ export default defineComponent({
}
},
/**
* When a commit is clicked with shift this enables the range
* selection. Second click (with shift) defines the end of the
* range. This opens the diff of this range
* Exception: first commit is the first commit of this PR. Then
* the diff from beginning of PR up to the second clicked commit is
* opened
* When a commit is clicked while holding Shift, it enables range selection.
* - The range selection is a half-open, half-closed range, meaning it excludes the start commit but includes the end commit.
* - The start of the commit range is always the previous commit of the first clicked commit.
* - If the first commit in the list is clicked, the mergeBase will be used as the start of the range instead.
* - The second Shift-click defines the end of the range.
* - Once both are selected, the diff view for the selected commit range will open.
*/
commitClickedShift(commit: Commit) {
this.hoverActivated = !this.hoverActivated;
commit.selected = true;
// Second click -> determine our range and open links accordingly
if (!this.hoverActivated) {
// since at least one commit is selected, we can determine the range
// find all selected commits and generate a link
if (this.commits[0].selected) {
// first commit is selected - generate a short url with only target sha
const lastCommitIdx = this.commits.findLastIndex((x) => x.selected);
if (lastCommitIdx === this.commits.length - 1) {
// user selected all commits - just show the normal diff page
window.location.assign(`${this.issueLink}/files${this.queryParams}`);
} else {
window.location.assign(`${this.issueLink}/files/${this.commits[lastCommitIdx].id}${this.queryParams}`);
}
const firstSelected = this.commits.findIndex((x) => x.selected);
const lastSelected = this.commits.findLastIndex((x) => x.selected);
let beforeCommitID: string;
if (firstSelected === 0) {
beforeCommitID = this.mergeBase;
} else {
const start = this.commits[this.commits.findIndex((x) => x.selected) - 1].id;
const end = this.commits.findLast((x) => x.selected).id;
window.location.assign(`${this.issueLink}/files/${start}..${end}${this.queryParams}`);
beforeCommitID = this.commits[firstSelected - 1].id;
}
const afterCommitID = this.commits[lastSelected].id;
if (firstSelected === lastSelected) {
// if the start and end are the same, we show this single commit
window.location.assign(`${this.issueLink}/commits/${afterCommitID}${this.queryParams}`);
} else if (beforeCommitID === this.mergeBase && afterCommitID === this.commits.at(-1).id) {
// if the first commit is selected and the last commit is selected, we show all commits
window.location.assign(`${this.issueLink}/files${this.queryParams}`);
} else {
window.location.assign(`${this.issueLink}/files/${beforeCommitID}..${afterCommitID}${this.queryParams}`);
}
}
},
@@ -58,8 +58,8 @@ onMounted(() => {
<template>
<div>
<div class="activity-bar-graph" ref="styleElement" style="width: 0; height: 0;"/>
<div class="activity-bar-graph-alt" ref="altStyleElement" style="width: 0; height: 0;"/>
<div class="activity-bar-graph tw-w-0 tw-h-0" ref="styleElement"/>
<div class="activity-bar-graph-alt tw-w-0 tw-h-0" ref="altStyleElement"/>
<vue-bar-graph
:points="graphPoints"
:show-x-axis="true"