Fold a whole run of plain commits, so only its labelled ends stay

This commit is contained in:
2026-10-14 22:10:47 +02:00
parent e09dabd441
commit bf9b3baa1f
3 changed files with 62 additions and 42 deletions
+5 -5
View File
@@ -156,15 +156,15 @@ async function copyHash() {
}
function toggleRun(hash: string) {
const id = built.value.runOf.get(hash);
if (!id) return;
const ids = built.value.runsAt.get(hash);
if (!ids) return;
const next = new Set(toggled.value);
if (!next.delete(id)) next.add(id);
for (const id of ids) if (!next.delete(id)) next.add(id);
toggled.value = next;
}
function toggleCollapseAll() {
if (!built.value.collapsible) return showToast("nothing to fold: no run of 3 or more plain commits");
if (!built.value.collapsible) return showToast("nothing to fold: no 2 or more plain commits in a row");
collapseAll.value = !collapseAll.value;
toggled.value = new Set();
}
@@ -249,7 +249,7 @@ onUnmounted(() => {
class="collapse"
:class="{ on: collapseAll && built.collapsible }"
:disabled="!built.collapsible"
:title="built.collapsible ? 'c' : 'Nothing to fold: no run of 3 or more commits without a branch, tag or merge'"
:title="built.collapsible ? 'c' : 'Nothing to fold: no 2 or more commits in a row without a branch, tag, fork or merge'"
@click="toggleCollapseAll"
>
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round">