From fa3b63322733bc7d77695e727728be43033fc5f1 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Tue, 4 Aug 2026 17:47:56 +0300 Subject: [PATCH] web/components: add NetworkVouches component Signed-off-by: oppiliappan --- bobbin/crates/resolver/src/legacy_upgrade.rs | 1 - .../profile/AvatarList.stories.svelte | 46 +++++++++++++++ .../lib/components/profile/AvatarList.svelte | 43 ++++++++++++++ .../profile/NetworkVouches.stories.svelte | 44 ++++++++++++++ .../components/profile/NetworkVouches.svelte | 59 +++++++++++++++++++ .../testing/MockAuthProvider.svelte | 31 ++++++---- 6 files changed, 213 insertions(+), 11 deletions(-) create mode 100644 web/src/lib/components/profile/AvatarList.stories.svelte create mode 100644 web/src/lib/components/profile/AvatarList.svelte create mode 100644 web/src/lib/components/profile/NetworkVouches.stories.svelte create mode 100644 web/src/lib/components/profile/NetworkVouches.svelte diff --git a/bobbin/crates/resolver/src/legacy_upgrade.rs b/bobbin/crates/resolver/src/legacy_upgrade.rs index dc10f925..51ba684b 100644 --- a/bobbin/crates/resolver/src/legacy_upgrade.rs +++ b/bobbin/crates/resolver/src/legacy_upgrade.rs @@ -383,7 +383,6 @@ async fn upgrade_pull( }; Some(Pull { created_at: l.created_at, - blobs: None, body: l.body, dependent_on: l.dependent_on, mentions: l.mentions, diff --git a/web/src/lib/components/profile/AvatarList.stories.svelte b/web/src/lib/components/profile/AvatarList.stories.svelte new file mode 100644 index 00000000..7e22d5a8 --- /dev/null +++ b/web/src/lib/components/profile/AvatarList.stories.svelte @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + diff --git a/web/src/lib/components/profile/AvatarList.svelte b/web/src/lib/components/profile/AvatarList.svelte new file mode 100644 index 00000000..c1ce1213 --- /dev/null +++ b/web/src/lib/components/profile/AvatarList.svelte @@ -0,0 +1,43 @@ + + + + +
+ {#each shown as person, i (person.did)} + +
+ + + +
+ {/each} + + {#if overflow > 0} + +{overflow} + {/if} +
diff --git a/web/src/lib/components/profile/NetworkVouches.stories.svelte b/web/src/lib/components/profile/NetworkVouches.stories.svelte new file mode 100644 index 00000000..7e7ca719 --- /dev/null +++ b/web/src/lib/components/profile/NetworkVouches.stories.svelte @@ -0,0 +1,44 @@ + + + + + + + + + + + + + vouch(i + 1)) }} /> + + + diff --git a/web/src/lib/components/profile/NetworkVouches.svelte b/web/src/lib/components/profile/NetworkVouches.svelte new file mode 100644 index 00000000..6b92db0c --- /dev/null +++ b/web/src/lib/components/profile/NetworkVouches.svelte @@ -0,0 +1,59 @@ + + +{#if vouchers.length > 0 || denouncers.length > 0} +
+ {#if vouchers.length > 0} + + {/if} + + {#if denouncers.length > 0} + + {/if} +
+{/if} diff --git a/web/src/lib/components/testing/MockAuthProvider.svelte b/web/src/lib/components/testing/MockAuthProvider.svelte index a37350bd..4eeccd26 100644 --- a/web/src/lib/components/testing/MockAuthProvider.svelte +++ b/web/src/lib/components/testing/MockAuthProvider.svelte @@ -8,25 +8,36 @@ interface Props { // message the fake agent rejects submissions with failWith?: string; + // when false, injects a signed-out context (no agent / null did) so stories + // can exercise the logged-out affordance + signedIn?: boolean; children: Snippet; } let { failWith = "MockAuthProvider: network request failed, this error is intentional.", + signedIn = true, children }: Props = $props(); - const agent = { - sub: "did:plc:alice", - handle: () => Promise.reject(new Error(failWith)) - }; + // props are fixed for this provider's lifetime, so a one-time snapshot is intended + // svelte-ignore state_referenced_locally + const agent = signedIn + ? { + sub: "did:plc:alice", + handle: () => Promise.reject(new Error(failWith)) + } + : null; - const auth = { - agent, - currentDid: "did:plc:alice", - currentUser: { did: "did:plc:alice", handle: "alice.pds.tngl.boltless.dev" }, - bobbinUrl: "https://bobbin.story" - } as unknown as Auth; + // svelte-ignore state_referenced_locally + const auth = (signedIn + ? { + agent, + currentDid: "did:plc:alice", + currentUser: { did: "did:plc:alice", handle: "alice.pds.tngl.boltless.dev" }, + bobbinUrl: "https://bobbin.story" + } + : { agent: null, currentDid: null, currentUser: null }) as unknown as Auth; setContext(AUTH_KEY, auth); -- 2.51.2