From 448c76283156f0929aaa52bc54a6a965cdb14f8c Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 12 Dec 2023 13:18:32 +0100 Subject: [PATCH] Show edited label on edited comments and issues If a comment or an issue had at least one additional edit, we show a `edited` label, which on hover shows the standard tooltip with more information on who edited it and when. --- httpd-client/lib/project/comment.ts | 8 ++++++++ src/components/Comment.svelte | 13 ++++++++++--- src/components/Thread.svelte | 2 ++ src/lib/utils.ts | 10 ++++++++++ src/views/projects/Issue.svelte | 16 ++++++++++++++++ 5 files changed, 46 insertions(+), 3 deletions(-) diff --git a/httpd-client/lib/project/comment.ts b/httpd-client/lib/project/comment.ts index 6bd1f5a1e..78a3f5437 100644 --- a/httpd-client/lib/project/comment.ts +++ b/httpd-client/lib/project/comment.ts @@ -8,6 +8,14 @@ export const commentSchema = object({ id: string(), author: object({ id: string(), alias: string().optional() }), body: string(), + edits: array( + object({ + author: object({ id: string(), alias: string().optional() }), + body: string(), + embeds: array(object({ name: string(), content: string() })), + timestamp: number(), + }), + ), embeds: array(object({ name: string(), content: string() })), reactions: array(tuple([string(), string()])), timestamp: number(), diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte index 2af1f4b09..7f5a03b24 100644 --- a/src/components/Comment.svelte +++ b/src/components/Comment.svelte @@ -1,5 +1,5 @@