- {#if changed.added.length}
- added label{changed.added.length > 1 ? "s" : ""}
- {#each changed.added as label}
-
+
+
+
+
+
+ {#if op.previous && op.previous.type === op.type}
+ {@const changed = itemDiff(op.previous?.labels ?? [], op.labels)}
+ {#if changed.added.length || changed.removed.length}
+ {#if changed.added.length}
+ added {pluralize("label", changed.removed.length)}
+ {#each changed.added as label}
+
{label}
+ {/each}
+ {/if}
+ {#if changed.removed.length}
+ removed {pluralize("label", changed.removed.length)}
+ {#each changed.removed as label}
+
{label}
+ {/each}
+ {/if}
{/if}
- {#if changed.removed.length}
- removed label{changed.removed.length > 1 ? "s" : ""}
- {#each changed.removed as label}
-
{label}
- {/each}
- {/if}
-
- {formatTimestamp(op.timestamp)}
-
+ {:else}
+ added {pluralize("label", op.labels.length)}
+ {#each op.labels as label}
+
{label}
+ {/each}
+ {/if}
+
+ {formatTimestamp(op.timestamp)}
- {/if}
- {:else if op.type === "assign" && op.previous && op.previous.type === op.type}
- {@const changed = itemDiff(op.previous?.assignees ?? [], op.assignees)}
- {#if changed.added.length || changed.removed.length}
-
-
-
-
-
-
- {#if changed.added.length}
- assigned
- {#each changed.added as assignee}
- {#await invoke( "alias", { nid: publicKeyFromDid(assignee) }, ) then alias}
-
- {/await}
- {/each}
+
+ {:else if op.type === "assign"}
+
+
+
+
+
+
+ {#if op.previous && op.previous.type === op.type}
+ {@const changed = itemDiff(
+ op.previous?.assignees ?? [],
+ op.assignees,
+ )}
+ {#if changed.added.length || changed.removed.length}
+ {#if changed.added.length}
+ assigned
+ {#each changed.added as assignee}
+ {#await invoke
( "alias", { nid: publicKeyFromDid(assignee) }, ) then alias}
+
+ {/await}
+ {/each}
+ {/if}
+ {#if changed.removed.length}
+ unassigned
+ {#each changed.removed as assignee}
+ {#await invoke( "alias", { nid: publicKeyFromDid(assignee) }, ) then alias}
+
+ {/await}
+ {/each}
+ {/if}
{/if}
- {#if changed.removed.length}
- unassigned
- {#each changed.removed as assignee}
- {#await invoke( "alias", { nid: publicKeyFromDid(assignee) }, ) then alias}
-
- {/await}
- {/each}
- {/if}
-
- {formatTimestamp(op.timestamp)}
-
+ {:else}
+ assigned
+ {#each op.assignees as assignee}
+ {#await invoke( "alias", { nid: publicKeyFromDid(assignee) }, ) then alias}
+
+ {/await}
+ {/each}
+ {/if}
+
+ {formatTimestamp(op.timestamp)}
- {/if}
+
{:else if op.type === "edit"}
{#if op.previous && op.previous.type === op.type}
diff --git a/src/components/PatchTimeline.svelte b/src/components/PatchTimeline.svelte
index a90b4de37..b573e8095 100644
--- a/src/components/PatchTimeline.svelte
+++ b/src/components/PatchTimeline.svelte
@@ -17,6 +17,7 @@
authorForNodeId,
formatTimestamp,
patchStatusColor,
+ pluralize,
publicKeyFromDid,
} from "@app/lib/utils";
import Icon from "./Icon.svelte";
@@ -147,42 +148,52 @@
- {:else if op.type === "label" && op.previous && op.previous.type === op.type}
- {@const changed = itemDiff(op.previous?.labels ?? [], op.labels)}
- {#if changed.added.length || changed.removed.length}
-