Keep every review comment in inbox summaries

Notification actions were deduplicated by operation and type, so the
several code comments of one published review collapsed into one.
This commit is contained in:
Rūdolfs Ošiņš
2026-10-01 18:20:24 +02:00
parent 5b3bc10a06
commit 89131f3b3a
3 changed files with 61 additions and 25 deletions
+4 -24
View File
@@ -1,14 +1,9 @@
<script lang="ts">
import type { RepoRoute } from "@app/views/repo/router";
import type { ActionWithAuthor } from "@bindings/cob/inbox/ActionWithAuthor";
import type { NotificationItem } from "@bindings/cob/inbox/NotificationItem";
import type { Action as IssueAction } from "@bindings/cob/issue/Action";
import type { Action as PatchAction } from "@bindings/cob/patch/Action";
import type { ComponentProps } from "svelte";
import uniqWith from "lodash/uniqWith";
import { compressActions } from "@app/lib/notification";
import { compressActions, notificationActions } from "@app/lib/notification";
import { push } from "@app/lib/router";
import {
absoluteTimestamp,
@@ -47,24 +42,9 @@
selected = false,
}: Props = $props();
type Action = ActionWithAuthor<IssueAction> | ActionWithAuthor<PatchAction>;
const uniqueActions = $derived.by(() => {
return compressActions(
uniqWith(
notificationItems.flatMap<Action>(n => n.actions),
(a, b) =>
Boolean(
a.oid === b.oid &&
a.type === b.type &&
a.author.did &&
b.author.did,
),
).sort((a, b) => b.timestamp - a.timestamp),
kind,
oid,
);
});
const uniqueActions = $derived(
compressActions(notificationActions(notificationItems), kind, oid),
);
const title = $derived.by(() => {
const lastDetail = notificationItems.at(-1);