fix: resolve committer DIDs to handles in CommitList

Author: Aaron Steven White
Commit 2035c70bd487db2c5c1d2acb6a6327fdaef6112c
Parent: ef94763fe6
Structural diff unavailable

These commits were pushed via plain git push, so no pre-parsed schemas are available. Install git-remote-cospan and re-push via panproto:// to see scope-level changes, breaking change detection, and semantic diffs.

brew install panproto/tap/git-remote-cospan
1 file changed +19 -2
@@ -1,8 +1,25 @@
11 <script lang="ts">
2+	import { onMount } from 'svelte';
23 	import type { RefUpdateView } from '$lib/generated/views.js';
4+	import { resolveHandle } from '$lib/api/handle.js';
35 
46 	let { refUpdates }: { refUpdates: RefUpdateView[] } = $props();
57 
8+	let handles = $state<Record<string, string>>({});
9+
10+	onMount(async () => {
11+		const dids = [...new Set(refUpdates.map(u => u.committerDid).filter(Boolean))];
12+		const resolved: Record<string, string> = {};
13+		await Promise.allSettled(
14+			dids.map(async (did) => { resolved[did] = await resolveHandle(did); })
15+		);
16+		handles = resolved;
17+	});
18+
19+	function displayName(did: string): string {
20+		return handles[did] || (did.startsWith('did:plc:') ? did.slice(8, 18) + '\u2026' : did);
21+	}
22+
623 	function truncateHash(hash: string): string {
724 		return hash.slice(0, 8);
825 	}
@@ -33,8 +50,8 @@
3350 						</code>
3451 					</div>
3552 					{#if update.committerDid}
36-						<p class="mt-0.5 text-sm text-text-secondary">
37-							{update.committerDid}
53+						<p class="mt-0.5 text-xs text-text-secondary">
54+							{displayName(update.committerDid)}
3855 						</p>
3956 					{/if}
4057 				</div>
cospan · schematic version control on atproto built on AT Protocol