diff --git a/src/components/Discussion.svelte b/src/components/Discussion.svelte index d1fc64176..bcd083bfe 100644 --- a/src/components/Discussion.svelte +++ b/src/components/Discussion.svelte @@ -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; } @@ -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" && diff --git a/src/components/Revision.svelte b/src/components/Revision.svelte index 66ad14f78..fae5c2a66 100644 --- a/src/components/Revision.svelte +++ b/src/components/Revision.svelte @@ -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", }); }); });