diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte index 9c25b75..847bd5e 100644 --- a/src/components/Icon.svelte +++ b/src/components/Icon.svelte @@ -8,14 +8,17 @@ styleDisplay?: string; styleVerticalAlign?: string; name: - | "attachment" | "arrow-left" | "arrow-right" + | "arrow-right-hollow" + | "attachment" | "checkmark" | "chevron-down" | "chevron-right" | "collapse-panel" | "comment" + | "comment-checkmark" + | "comment-cross" | "copy" | "cross" | "dashboard" @@ -30,6 +33,7 @@ | "issue" | "lock" | "markdown" + | "merge" | "moon" | "more-vertical" | "none" @@ -115,6 +119,24 @@ + {:else if name === "arrow-right-hollow"} + + + + + + + + + + + + + + + + + {:else if name === "attachment"} @@ -188,6 +210,72 @@ + {:else if name === "comment-checkmark"} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {:else if name === "comment-cross"} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {:else if name === "copy"} @@ -415,6 +503,16 @@ + {:else if name === "merge"} + + + {:else if name === "moon"} diff --git a/src/components/PatchTimeline.svelte b/src/components/PatchTimeline.svelte new file mode 100644 index 0000000..b7c4756 --- /dev/null +++ b/src/components/PatchTimeline.svelte @@ -0,0 +1,187 @@ + + + + +
+ {#each timeline as op} + {#if op.type === "revision"} +
+ + +
created a new revision
+
+ {:else if op.type === "lifecycle"} +
+ + + {#if op.previous} + changed state from + + -> + + {:else} + changed state from + + -> + + {/if} +
+ {:else if op.type === "label"} + {@const changed = itemDiff(op.previous?.labels ?? [], op.labels)} + {#if changed.added.length || changed.removed.length} +
+ + {#if changed.added.length} + {#each changed.added as label} +
+ {/if} + {:else if op.type === "assign"} + {@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} + {assignee} + {/each} + {/if} + {#if changed.removed.length} + unassigned + {#each changed.removed as assignee} + {assignee} + {/each} + {/if} +
+ {/if} + {:else if op.type === "merge"} +
+
+ +
+ +
+ merged this patch at revision +
+
+ {:else if op.type === "edit"} + {#if op.previous} +
+ + + changed title + + {op.previous.title} + + -> {op.title} +
+ {/if} + {:else if op.type === "review"} +
+ {#if op.verdict === "accept"} +
+ +
+ + reviewed and accepted revision + {:else} +
+ +
+ + reviewed and rejected revision + {/if} +
+ {/if} + {/each} +
diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte index d931b66..4a479fb 100644 --- a/src/views/repo/Patch.svelte +++ b/src/views/repo/Patch.svelte @@ -1,10 +1,10 @@