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.
This commit is contained in:
Sebastian Martinez
2023-12-15 07:10:14 +01:00
parent 10c54ace67
commit 448c762831
5 changed files with 46 additions and 3 deletions
+16
View File
@@ -387,6 +387,10 @@
$httpdStore.state === "authenticated" && utils.isLocal(baseUrl.hostname)
? $httpdStore.session
: undefined;
$: lastDescriptionEdit =
issue.discussion[0].edits.length > 1
? issue.discussion[0].edits.pop()
: undefined;
type State = "read" | "edit" | "submit";
@@ -425,6 +429,10 @@
flex-wrap: nowrap;
gap: 0.5rem;
}
.author-metadata {
color: var(--color-fill-gray);
font-size: var(--font-size-small);
}
.title {
overflow: hidden;
text-overflow: ellipsis;
@@ -571,6 +579,14 @@
nodeId={issue.author.id}
alias={issue.author.alias} />
{utils.formatTimestamp(issue.discussion[0].timestamp)}
{#if lastDescriptionEdit}
<div class="author-metadata">•</div>
<div
class="author-metadata"
title={utils.formatEditedCaption(lastDescriptionEdit)}>
edited
</div>
{/if}
</div>
</CobHeader>
{#if threads.length > 0}