From 2f5bcd6c62a4ed12a6bf7f06aadec14d010e44fe Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 9 Sep 2026 18:54:28 +0200 Subject: [PATCH] web/profile: extract shared chrome pieces from the org profile Signed-off-by: eti wip: conflict resolution Signed-off-by: eti wip: sv-fe fixes Signed-off-by: eti wip Signed-off-by: eti --- .../profile/ProfileSocialLinks.svelte | 19 +--- .../profile/UserProfileChrome.svelte | 61 ++++++------- .../organization/OrganizationChrome.svelte | 65 ++----------- .../OrganizationOverviewTab.svelte | 91 ------------------- web/src/routes/[handle]/+layout.svelte | 16 +++- 5 files changed, 51 insertions(+), 201 deletions(-) delete mode 100644 web/src/lib/components/profile/organization/OrganizationOverviewTab.svelte diff --git a/web/src/lib/components/profile/ProfileSocialLinks.svelte b/web/src/lib/components/profile/ProfileSocialLinks.svelte index 1a0898483..0c159096f 100644 --- a/web/src/lib/components/profile/ProfileSocialLinks.svelte +++ b/web/src/lib/components/profile/ProfileSocialLinks.svelte @@ -14,18 +14,9 @@ following?: number; followersHref?: string; followingHref?: string; - class?: string; } - let { - identity, - profile, - followers, - following, - followersHref, - followingHref, - class: className - }: Props = $props(); + let { identity, profile, followers, following, followersHref, followingHref }: Props = $props(); const links = $derived((profile.links ?? []).filter((link) => link.trim().length > 0)); const linkLabel = (link: string) => { @@ -37,8 +28,8 @@ }; -
-
+
+
diff --git a/web/src/lib/components/profile/organization/OrganizationOverviewTab.svelte b/web/src/lib/components/profile/organization/OrganizationOverviewTab.svelte deleted file mode 100644 index 0adfdf5e2..000000000 --- a/web/src/lib/components/profile/organization/OrganizationOverviewTab.svelte +++ /dev/null @@ -1,91 +0,0 @@ - - -
-
-

Languages

-
- {#each organizationLanguages as language (language)} - - - {language} - - {/each} -
-
- -
-

Topics

-
- {#each organizationTopics as topic (topic)} - {topic} - {/each} -
-
- -
-

Pinned repositories

- {#if repositories.length > 0} -
- {#each repositories as repo (repo.repoDid || repo.rkey || repo.name)} - - {/each} -
-
- -
- {:else} - - {/if} -
-
diff --git a/web/src/routes/[handle]/+layout.svelte b/web/src/routes/[handle]/+layout.svelte index 2410d28d0..548685392 100644 --- a/web/src/routes/[handle]/+layout.svelte +++ b/web/src/routes/[handle]/+layout.svelte @@ -35,7 +35,9 @@ const viewerFollowRkey = $derived(data.viewerFollowRkey); const notJoined = $derived(data.notJoined); - const synchronousProfile = $derived(data.profile instanceof Promise ? null : data.profile); + const synchronousProfile = $derived( + data.profile instanceof Promise ? null : data.profile + ); let asyncProfile = $state(null); $effect(() => { let active = true; @@ -50,7 +52,9 @@ }); const resolvedProfile = $derived(asyncProfile ?? synchronousProfile); - const synchronousIdentity = $derived(data.identity instanceof Promise ? null : data.identity); + const synchronousIdentity = $derived( + data.identity instanceof Promise ? null : data.identity + ); let asyncIdentity = $state<{ did: string; handle: string } | null>(null); $effect(() => { let active = true; @@ -68,7 +72,7 @@ const rawHandle = $derived(decodeURIComponent(page.params.handle ?? "")); const handle = $derived(resolvedIdentity?.handle ?? rawHandle); const displayName = $derived( - ((resolvedProfile as Record | null)?.displayName as string | undefined) || + (resolvedProfile as Record | null)?.displayName as string | undefined || resolvedProfile?.preferredHandle || handle ); @@ -100,11 +104,13 @@ return "Couldn't load this profile"; }; - // client navigation settles identity, so the canonical redirect happens here once it lands + // client navigations stream identity, so canonical redirects happen here once resolved $effect(() => { + const pending = data.identity; + if (!(pending instanceof Promise)) return; const identifier = decodeURIComponent(page.params.handle ?? ""); const search = page.url.search; - void Promise.resolve(data.identity) + void pending .then((resolved) => { const canonical = resolved.handle.endsWith(".invalid") ? null : resolved.handle; if (canonical && identifier.toLowerCase() !== canonical.toLowerCase()) { -- 2.51.2