review tab

This commit is contained in:
Ian Gulliver
2026-10-16 09:53:34 -07:00
parent 48ef2d6bb5
commit 2107a43ef2
8 changed files with 42 additions and 21 deletions
+3 -4
View File
@@ -20,10 +20,9 @@ export function findingCount(r: Review): number {
return r.state === "done" ? findingsOf(r).length : 0;
}
export function latestFindingCount(events: ByreEvent[]): number {
const finished = events.filter((ev) => ev.kind === "review.finished").map((ev) => ev.payload as unknown as Review);
const top = finished.reduce<Review | undefined>((best, r) => (!best || r.snapshot_n >= best.snapshot_n ? r : best), undefined);
return top ? findingCount(top) : 0;
export function latestReview(events: ByreEvent[]): Review | undefined {
const all = events.filter(isReviewEvent).map((ev) => ev.payload as unknown as Review);
return all.reduce<Review | undefined>((best, r) => (!best || r.snapshot_n >= best.snapshot_n ? r : best), undefined);
}
export function reviewCounts(r: Review): string {