From dbe9f2f13ac286eccdafe01cd6c9c607c5d4f9bf Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Mon, 21 Sep 2026 15:33:38 +0100 Subject: [PATCH] web/components: fix fork listing in pull composer Signed-off-by: oppiliappan --- web/src/lib/api/pullCompose.ts | 10 ++++++---- web/src/lib/components/profile/tabs/PeopleTab.svelte | 1 - .../components/repo/pulls/PullCompose.stories.svelte | 1 + web/src/lib/components/repo/pulls/PullCompose.svelte | 6 +++++- .../lib/components/timeline/TimelineRepoEvent.svelte | 5 ++++- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/web/src/lib/api/pullCompose.ts b/web/src/lib/api/pullCompose.ts index bc9223a4f..b6366ca7d 100644 --- a/web/src/lib/api/pullCompose.ts +++ b/web/src/lib/api/pullCompose.ts @@ -90,6 +90,7 @@ const COMMIT_LIMIT = 100; export interface ForkOption { uri: string; repoDid: string; + owner: string; name: string; knot: string; } @@ -140,15 +141,16 @@ export const loadCompose = async (args: { ? listRepos(ctx, viewer.did, { limit: 100 }) .then((page) => page.items - // `source` is any uri: an at-uri means a fork, anything else is - // an import, same test the repo layout's resolveSource makes .filter( (item) => - item.value.source?.startsWith("at://") && item.value.repoDid + (item.value.source === repoDid || + item.value.source === repo.uri) && + item.value.repoDid ) .map((item): ForkOption => ({ uri: item.uri, repoDid: item.value.repoDid as string, + owner: viewer.handle, name: repoNameOf(item), knot: item.value.knot })) @@ -218,7 +220,7 @@ export const loadCompose = async (args: { commitsError, mergeBase, sourceRepoPath: forkRepo - ? `${viewer?.handle ?? repo.ownerHandle}/${forkRepo.name}` + ? `${forkRepo.owner}/${forkRepo.name}` : `${repo.ownerHandle}/${repo.name}`, branches: sortBranches(branchList.map(toBranchSummary)), sourceBranches, diff --git a/web/src/lib/components/profile/tabs/PeopleTab.svelte b/web/src/lib/components/profile/tabs/PeopleTab.svelte index 634c31045..7106dc942 100644 --- a/web/src/lib/components/profile/tabs/PeopleTab.svelte +++ b/web/src/lib/components/profile/tabs/PeopleTab.svelte @@ -45,7 +45,6 @@ {title} {emptyMessage} rowCapture={profileFollowcardBordered} - listClass="flex flex-col gap-8" key={(person) => person.did} > {#snippet row(person)} diff --git a/web/src/lib/components/repo/pulls/PullCompose.stories.svelte b/web/src/lib/components/repo/pulls/PullCompose.stories.svelte index 2630023de..a634562fd 100644 --- a/web/src/lib/components/repo/pulls/PullCompose.stories.svelte +++ b/web/src/lib/components/repo/pulls/PullCompose.stories.svelte @@ -37,6 +37,7 @@ { uri: "at://did:plc:alice/sh.tangled.repo/3m2k1", repoDid: sourceRepoDid, + owner: "alice.pds.tngl.boltless.dev", name: "core", knot: "knot.example.test" } diff --git a/web/src/lib/components/repo/pulls/PullCompose.svelte b/web/src/lib/components/repo/pulls/PullCompose.svelte index 5918bfcff..d0561d152 100644 --- a/web/src/lib/components/repo/pulls/PullCompose.svelte +++ b/web/src/lib/components/repo/pulls/PullCompose.svelte @@ -206,7 +206,7 @@ const forkOptions = $derived( view.forks.map((fork): SelectOption => ({ value: fork.repoDid, - label: `${ownerHandle}/${fork.name}` + label: `${fork.owner}/${fork.name}` })) ); @@ -438,6 +438,10 @@ {#snippet children({ id })}