@@ -96,24 +101,31 @@
{#if shown?.location}
-
+
{shown.location}
{/if}
{#if blueskyUrl}
{/if}
{#each links as link, index (index)}
@@ -152,7 +175,10 @@
/>
{/if}
{#if networkVouches.length > 0}
-
+
{/if}
{/if}
diff --git a/web/src/lib/components/profile/pages.ts b/web/src/lib/components/profile/pages.ts
index c61005c7..d8431640 100644
--- a/web/src/lib/components/profile/pages.ts
+++ b/web/src/lib/components/profile/pages.ts
@@ -130,7 +130,8 @@ const resolvePeople = (
dids: string[],
data: Sidecar,
docSource: LinkSource,
- viewerDid?: string
+ viewerDid?: string,
+ profiles?: Map
): PersonData[] => {
return [...new Set(dids)].map((did) => {
const handle = handleOf(data, did, docSource);
@@ -139,7 +140,17 @@ const resolvePeople = (
const isSelf = viewerDid === did;
const viewerUri = viewerUriOf(data, did, FOLLOW_VIEWER.source);
const viewerFollowRkey = viewerUri ? rkeyFromUri(viewerUri) : viewerUri;
- return { did, handle, followers, following, isSelf, viewerFollowRkey };
+ const profile = profiles?.get(did);
+ return {
+ did,
+ handle,
+ description: profile?.description,
+ pronouns: profile?.pronouns,
+ followers,
+ following,
+ isSelf,
+ viewerFollowRkey
+ };
});
};
@@ -154,8 +165,10 @@ const resolveVouches = async (
// the record's author is the voucher: if that's the profile itself
// the vouch is outgoing, otherwise someone vouched for the profile
const direction = didFromUri(item.uri) === profileDid ? "outgoing" : "incoming";
- const otherDid = direction === "incoming" ? didFromUri(item.uri) : rkeyFromUri(item.uri);
- const handle = (await cache.resolve(otherDid).catch(() => null))?.handle ?? INVALID_HANDLE;
+ const otherDid =
+ direction === "incoming" ? didFromUri(item.uri) : rkeyFromUri(item.uri);
+ const handle =
+ (await cache.resolve(otherDid).catch(() => null))?.handle ?? INVALID_HANDLE;
return {
uri: item.uri,
did: otherDid,
@@ -185,14 +198,14 @@ const resolveStars = async (
const enriched =
repoDids.length > 0
? await enrich<{ items: ListItem[] }>(ctx, {
- xrpc: "sh.tangled.repo.getReposByRepoDids",
- params: { dids: repoDids },
- enrich: [
- ...targetAll(starDescriptors(viewerDid), ["items[].value.repoDid"]),
- target(REPO_OWNER_DOCS, ["items[].uri"])
- ],
- ...(viewerDid ? { viewer: viewerDid } : {})
- })
+ xrpc: "sh.tangled.repo.getReposByRepoDids",
+ params: { dids: repoDids },
+ enrich: [
+ ...targetAll(starDescriptors(viewerDid), ["items[].value.repoDid"]),
+ target(REPO_OWNER_DOCS, ["items[].uri"])
+ ],
+ ...(viewerDid ? { viewer: viewerDid } : {})
+ })
: { output: { items: [] }, data: {} as Sidecar };
const reposByDid = new Map(
enriched.output.items.map((item) => [(item.value as RepoRecord).repoDid, item])
@@ -328,7 +341,9 @@ export const fetchPeoplePage = async (
const targets = direction === "followers" ? ["items[].uri"] : ["items[].value.subject"];
const enriched = await enrich>(ctx, {
xrpc:
- direction === "followers" ? "sh.tangled.graph.listFollows" : "sh.tangled.graph.listFollowsBy",
+ direction === "followers"
+ ? "sh.tangled.graph.listFollows"
+ : "sh.tangled.graph.listFollowsBy",
params: { subject: did, limit, offset },
enrich: targetAll(
viewerDid ? [...FOLLOW_STATS, FOLLOW_VIEWER, docs] : [...FOLLOW_STATS, docs],
@@ -339,9 +354,25 @@ export const fetchPeoplePage = async (
const dids =
direction === "followers"
? enriched.output.items.map((item) => didFromUri(item.uri))
- : enriched.output.items.map((item) => (item.value as ShTangledGraphFollow.Main).subject);
+ : enriched.output.items.map(
+ (item) => (item.value as ShTangledGraphFollow.Main).subject
+ );
+ // the enrich minidocs give handles but not bio/pronouns, so pull the profile
+ // records for this page's dids and merge them in. getProfiles takes the profile
+ // record at-uris, not bare dids
+ const uniqueDids = [...new Set(dids)];
+ const profileUris = uniqueDids.map((d) => `at://${d}/sh.tangled.actor.profile/self`);
+ const profiles =
+ profileUris.length > 0
+ ? await getProfiles(ctx, profileUris)
+ .then(
+ (list) =>
+ new Map(list.items.map((item) => [didFromUri(item.uri), item.value]))
+ )
+ .catch(() => new Map())
+ : new Map();
return {
- items: resolvePeople(dids, enriched.data, docs.source, viewerDid),
+ items: resolvePeople(dids, enriched.data, docs.source, viewerDid, profiles),
cursor: enriched.output.cursor
};
};
@@ -454,19 +485,19 @@ export const fetchPinned = async (
const [byDid, byUri] = await Promise.all([
dids.length > 0
? enrich<{ items: ListItem[] }>(ctx, {
- xrpc: "sh.tangled.repo.getReposByRepoDids",
- params: { dids },
- enrich: targetAll(descriptors, ["items[].value.repoDid"]),
- ...(viewerDid ? { viewer: viewerDid } : {})
- })
+ xrpc: "sh.tangled.repo.getReposByRepoDids",
+ params: { dids },
+ enrich: targetAll(descriptors, ["items[].value.repoDid"]),
+ ...(viewerDid ? { viewer: viewerDid } : {})
+ })
: empty,
uris.length > 0
? enrich<{ items: ListItem[] }>(ctx, {
- xrpc: "sh.tangled.repo.getRepos",
- params: { repos: uris },
- enrich: targetAll(descriptors, ["items[].value.repoDid"]),
- ...(viewerDid ? { viewer: viewerDid } : {})
- })
+ xrpc: "sh.tangled.repo.getRepos",
+ params: { repos: uris },
+ enrich: targetAll(descriptors, ["items[].value.repoDid"]),
+ ...(viewerDid ? { viewer: viewerDid } : {})
+ })
: empty
]);
const cards = new Map();
diff --git a/web/src/lib/components/profile/tabs/PeopleTab.svelte b/web/src/lib/components/profile/tabs/PeopleTab.svelte
index 1c86e86e..cf4e8db8 100644
--- a/web/src/lib/components/profile/tabs/PeopleTab.svelte
+++ b/web/src/lib/components/profile/tabs/PeopleTab.svelte
@@ -42,7 +42,7 @@
{#each people as person (person.did)}
-
+
{/each}
{#snippet footer()}
{#if pages > 1}
diff --git a/web/src/lib/components/profile/types.ts b/web/src/lib/components/profile/types.ts
index 0239b249..51285e56 100644
--- a/web/src/lib/components/profile/types.ts
+++ b/web/src/lib/components/profile/types.ts
@@ -49,6 +49,7 @@ export interface PersonData {
did: string;
handle: string;
description?: string;
+ pronouns?: string;
followers?: number;
following?: number;
viewerFollowRkey?: string | null;
diff --git a/web/src/lib/components/shell/Topbar.svelte b/web/src/lib/components/shell/Topbar.svelte
index d14b2980..08e18b1b 100644
--- a/web/src/lib/components/shell/Topbar.svelte
+++ b/web/src/lib/components/shell/Topbar.svelte
@@ -174,16 +174,16 @@
{#snippet trigger()}
{/snippet}
- Profile
-
+ Profile
+
Repositories
-
+
Strings
- Settings
+ Settings
- Logout
+ Logout
{:else}
diff --git a/web/src/routes/login/+page.svelte b/web/src/routes/login/+page.svelte
index bbc91244..aa7bcd13 100644
--- a/web/src/routes/login/+page.svelte
+++ b/web/src/routes/login/+page.svelte
@@ -56,7 +56,7 @@
inputmode="url"
required
placeholder="akshay.tngl.sh"
- class="w-full rounded-sm border border-border-default bg-background-default p-3 typography-paragraph-large text-foreground-default placeholder:text-foreground-placeholder focus:ring-1 focus:ring-border-strong focus:outline-none"
+ class="w-full rounded-sm border border-border-default bg-background-default p-2 typography-paragraph-large text-foreground-default placeholder:text-foreground-placeholder focus:ring-1 focus:ring-border-strong focus:outline-none"
/>
Use your AT Protocol handle to log in. If
@@ -76,7 +76,6 @@