diff --git a/web/src/lib/api/repo.ts b/web/src/lib/api/repo.ts --- a/web/src/lib/api/repo.ts +++ b/web/src/lib/api/repo.ts @@ -219,6 +219,9 @@ committerEmail: string; committerWhen: string; coAuthors: { name: string; email: string }[]; + // filled in by the loader when the author's email resolves to an account + authorDid?: string; + authorHandle?: string; } // the diff endpoint's commit carries both signatures, unlike the log's @@ -234,6 +237,7 @@ body, authorName: commit.author?.Name ?? "", authorEmail: commit.author?.Email ?? "", + authorDid: didFromSignature(commit.author?.Email ?? ""), authorWhen: commit.author?.When ?? "", committerName: commit.committer?.Name ?? "", committerEmail: commit.committer?.Email ?? "", diff --git a/web/src/lib/components/repo/CommitHeader.svelte b/web/src/lib/components/repo/CommitHeader.svelte --- a/web/src/lib/components/repo/CommitHeader.svelte +++ b/web/src/lib/components/repo/CommitHeader.svelte @@ -3,6 +3,7 @@ import type { CommitDetail } from "$lib/api/repo"; import Avatar from "$lib/components/ui/Avatar.svelte"; import Pending from "$lib/components/ui/Pending.svelte"; + import User from "$lib/components/ui/User.svelte"; import TimeAgo from "$lib/components/ui/TimeAgo.svelte"; import { formatDateTime } from "$lib/format"; import type { CommitStatuses } from "$lib/api/commitStatuses"; @@ -48,24 +49,39 @@ {/if} - {#snippet attribution(label: string, name: string, email: string)} + {#snippet attribution( + label: string, + name: string, + email: string, + did?: string, + handle?: string + )} {label} - - - - {#if email} - {name} - {:else} - {name} - {/if} - + {#if handle} + + {:else} + + + {#if email} + {name} + {:else} + {name} + {/if} + + {/if} {/snippet}
- {@render attribution("author", commit.authorName, commit.authorEmail)} + {@render attribution( + "author", + commit.authorName, + commit.authorEmail, + commit.authorDid, + commit.authorHandle + )} {#each commit.coAuthors as coAuthor (coAuthor.email)} {@render attribution("co-author", coAuthor.name, coAuthor.email)} diff --git a/web/src/lib/components/repo/pulls/PullCommitRow.svelte b/web/src/lib/components/repo/pulls/PullCommitRow.svelte --- a/web/src/lib/components/repo/pulls/PullCommitRow.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitRow.svelte @@ -4,6 +4,7 @@ import type { CommitStatuses } from "$lib/api/commitStatuses"; import Link from "$lib/components/ui/Link.svelte"; import Tag from "$lib/components/ui/Tag.svelte"; + import User from "$lib/components/ui/User.svelte"; import PipelineWorkflows from "../pipelines/PipelineWorkflows.svelte"; import type { CommitSummary } from "../types"; @@ -47,6 +48,17 @@
{commit.subject}
+ {#if commit.authorHandle} + + {:else if commit.authorName && commit.authorEmail && !commit.authorDid} + + + + {:else if commit.authorName} + {commit.authorName} + {/if} {#if commit.body}