Keep merge and review rows out of author runs

This commit is contained in:
Rūdolfs Ošiņš
2026-08-14 17:30:46 +02:00
parent a7c35340ec
commit 75ebece30d
2 changed files with 20 additions and 1 deletions
+17 -1
View File
@@ -3,6 +3,11 @@
key: string;
timestamp: number;
data: T;
/// Renders as a card or a filled band rather than a bare row of text.
/// Grouped rows are packed tight against each other, which reads as one
/// element when the things being packed have their own edges, so these are
/// never folded into a run.
standalone?: boolean;
}
</script>
@@ -77,7 +82,13 @@
type TimelineEntry =
| { kind: "thread"; key: string; timestamp: number; thread: Thread }
| { kind: "activity"; key: string; timestamp: number; data: A };
| {
kind: "activity";
key: string;
timestamp: number;
data: A;
standalone: boolean;
};
const timeline: TimelineEntry[] = $derived(
[
@@ -97,6 +108,7 @@
key: item.key,
timestamp: item.timestamp,
data: item.data,
standalone: item.standalone === true,
}) satisfies TimelineEntry,
),
].sort((a, b) => a.timestamp - b.timestamp),
@@ -138,7 +150,11 @@
}
const author = entryAuthor(entry);
const last = result[result.length - 1];
const groupable =
!entry.standalone &&
!(last?.kind === "single" && last.entry.standalone);
if (
groupable &&
author &&
last &&
((last.kind === "single" &&
+3
View File
@@ -785,6 +785,9 @@
key: `${operation.id}:${actionIndex}`,
timestamp: operation.timestamp,
data: { kind: "op", op, commits, reviewThreads, reviewComments },
// A merge draws a filled band and a review draws a card; both need
// the space around them that a run of bare rows deliberately drops.
standalone: op.type === "merge" || op.type === "review",
});
});
});